Hi Shary, everyone,
[log in to unmask] wrote:
> Sometime ago, one of you e-mailed the group a script that calculates sd,
> mean etc. images. This script is not functional under SPM5.
I think the script just needs Karsten's spm_get replacement:
http://www.jiscmail.ac.uk/cgi-bin/webadmin?A2=ind0608&L=SPM&P=R37213
Alternatively, it's fairly easy to use spm_imcalc with the dmtx mode
to get this kind of thing... setup the imcalc flags:
flags = {1,0,spm_type('float32'),0};
(use dmtx, don't treat 0 as NaN, save floats, use nearest neighbour
interpolation)
Then you can do things like:
spm_imcalc_ui('', 'mean.nii', 'mean(X)', flags);
spm_imcalc_ui('', 'var.nii', 'var(X)', flags);
and more complicated things like
spm_imcalc_ui('', 'SNR.nii', 'mean(X)./std(X)', flags);
spm_imcalc_ui('', 'lowerquartile.nii', 'prctile(X,25)', flags);
etc.
note that by default std and var divide by n-1 (degrees of freedom)
for the unbiased estimate; if you want, use var(X,1) to divide by n
for the ML estimate instead.
For scripting, note that the first arg can be a matrix of filenames,
rather than '', and then you don't need to interact.
Hope that helps,
Ged.
|