Hi Brandon,
If you're looking to calculate standard deviation for all voxels, then it might be easier to just read in all images into a matrix, with something like:
scans = cell2mat(cellfun(@(x)reshape(spm_read_vols(spm_vol(x)), 1, []), images, 'UniformOutput', 0));
then you should just be able to do:
std(scans)
to get the standard deviation. You also might be able to do:
scans = spm_read_vols(spm_vol(char(images)), but that didn't work for me just now for whatever reason.
|