Hi,
I'm running SPM2 and trying to get actual volumes from my modulated
segmented grey and white images using the script found in the archives and
detailed below. I've placed the m file in the SPM2 directory and then use
the gui to select the m file. I can select the image file but all that
appears in the command window is a series of dots and then the prompt. Do I
need to look in another place in Matlab to see the calculated volume or is
it that the script below has a problem and isn't calculating the volume?
Sorry if this a stupid question and is something really trivial that I have
overlooked.
Thanks in advance for any possible help or advice you can offer.
best regards
Erik
function gl = get_integrals(P)
% Integrate the values in an image.
if nargin<1,
P = spm_get(Inf,'*.img');
end;
V = spm_vol(P);
gl = zeros(length(V),1);
for i=1:length(gl),
for z=1:V(i).dim(3),
img = spm_slice_vol(V(i),spm_matrix([0 0
z]),V(i).dim(1:2),0);
gl(i) = gl(i) + sum(img(:));
fprintf('.');
end;
gl(i) = gl(i)*(det(V(i).mat)/100^3);
fprintf('\n');
end;
Erik O'Hanlon,
School Of Psychology and Institute Of Neuroscience,
Trinity College Institute of Neuroscience,
The Lloyd Institute,
3'rd floor Rm 3.01,
Trinity College Dublin,
Dublin 2,
Ireland.
Ph: +353-1-6088417
Fax: +353-1-671-2006
E-mail: [log in to unmask]
|