Dear SPMers,
I’m trying to calculate total volume(in litre) of GM using segmented
modulated GM image using SPM5, and would like to use the volume as a global
measure in subsequent statistical analysis. I found a script posted by
John,
http://www.jiscmail.ac.uk/cgi-bin/wa.exe?A2=ind05&L=SPM&D=0&I=-3&P=300872
and it works well. From what I understand this script sums all of the non-
zero voxels and multiply by voxel volume to get a number in litre.
Here is my question. If I’m using masking with absolute threshold value
~0.05 during statistical estimate, isn’t it more appropriate to mask out
the modulated GM with the the threshold value, and then take the sum?
Thanks,
Hedok
This is the script I’m referring to
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
P = spm_select(Inf,'image','Select images');
for j=1:size(P,1),
V = spm_vol(deblank(P(j,:)));
vol = 0;
for i=1:V.dim(3),
img = spm_slice_vol(V,spm_matrix([0 0 i]),V.dim(1:2),0);
img = img(finite(img));
vol = vol + sum(img(:));
end;
voxvol = abs(det(V.mat(1:3,1:3)))*1e-6;
fprintf('%g voxels, %g litres\n', vol, vol*voxvol);
end;
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|