> Should I resample the images to a 2x2x2
> grid? Is there a way to do that easily in spm?
If you have a 2x2x2 image in the correct space, then you
could use the reslice option in Coregister or Realign, to
do the reslicing.
>
> I also would like to know how I can get the min, max and mean for the
> intensity values in an image when using spm.
V=spm_vol(spm_get(1,'*.img'));
mn=Inf;
mx=-Inf;
tot=0;
for i=1:V.dim(3),
img = spm_slice_vol(V,spm_matrix([0 0 i]),V.dim(1:2),0);
img = img(:);
mx = max(mx,max(img));
mn = min(mn,min(img));
tot = tot + sum(img);
end;
mx
mn
tot/prod(V.dim(1:3))
Best regards,
-John
--
Dr John Ashburner.
Functional Imaging Lab., 12 Queen Square, London WC1N 3BG, UK.
tel: +44 (0)20 78337491 or +44 (0)20 78373611 x4381
fax: +44 (0)20 78131420 http://www.fil.ion.ucl.ac.uk/~john
|