Erik,
You should look into Christian Gaser's VBM toolbox add-ons for SPM2 or SPM5
(http://dbm.neuro.uni-jena.de/released/). It has a function during
segmentation (optimized) to collect the actual volumes into a text file,
which can then be entered into subsequent analyses as nuisance or
covariates. The toolbox is quite easy to use and the internal notes are
quite instructive.
Hope this helps,
Jeff
--------------------------
Jeff Browndyke, Ph.D.
Duke Univ. Medical Center
-----Original Message-----
From: SPM (Statistical Parametric Mapping) [mailto:[log in to unmask]] On
Behalf Of Erik O'Hanlon
Sent: Thursday, March 22, 2007 5:49 AM
To: [log in to unmask]
Subject: [SPM] getting volumes from segmented images
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]
__________ NOD32 2137 (20070322) Information __________
This message was checked by NOD32 antivirus system.
http://www.eset.com
|