Hi Avia,
I am not sure what you mean with density but I can probably help you
with the volume calculation. Note that I haven't done any VBM so far and
there might be an easier solution to this.
First you select your GM and WM probability map (the output of the
segmentation):
%----------Copy/Paste into Matlab from here
V = spm_vol(spm_select(2,'image'));
%Next we select GM and WM:
GM = spm_read_vols(V(1));
WM = spm_read_vols(V(2));
%We need to calculate the voxel volume:
vox = sqrt(sum(V(1).mat(1:3,1:3).^2));
voxvol = vox(1)*vox(2)*vox(3);
%Next step, we multiply the probability map with our voxel volume:
GMvol = GM .* voxvol;
WMvol = WM .* voxvol;
fprintf('The GM volume is %d cm^3, the WM volume is %d cm^3',
sum(GMvol(:))/1000, sum(WMvol(:))/1000);
%------------End of Code
Hope this helps,
Benjamin
On 01/04/2010 05:33 PM, Avia Abramovitz wrote:
> Hi,
>
> I would like to thank everyone for their generous help.
> It gives me the courage to keep on asking naive question :-)
>
> Say I've done segmentation on my images.
> How do I calculate the GM/WM volume and density from them?
> If I would like to compare the volumes f between subjects I have to have
> this parameter calculated already right?
> Than how do I upload it to the batch?
>
> Thanks,
> Avia
--
Dr. med. Benjamin Bender
Abteilung Diagnostische und Interventionelle Neuroradiologie
Universitätsklinikum Tübingen
Hoppe-Seyler- Str. 3
72076 Tübingen
Tel. (07071) 29-85397
|