Dear Iain,
Have a look at spm_summarise:
spm_summarise('image.nii','all',@mean)
spm_summarise('image.nii','all',@min)
spm_summarise('image.nii','all',@max)
spm_summarise('image.nii','all',@(x)([min(x) max(x)]))
spm_summarise('image.nii','all',@std)
Instead of the input parameter 'all' you could provide a mask image to
restrict the computation within it.
Best regards,
Guillaume.
On 01/05/18 14:33, Iain Croall wrote:
> Hi everyone,
>
> I've got a very straightforward question and would really appreciate any answers!
>
> Is there an SPM function which will return basic statistics about an image? I mean values like the mean pixel intensity, or range of pixel values within the image etc.
>
> I'm aware of many ways to achieve this using either matlab itself or other software packages, but am giving a practical on SPM to some students who don't really have much of a coding background. In the practical, we will have created an image of white matter fractional anisotropy, and I want to extract the mean FA from this image. I think it would be ideal if I could stick to using (vanilla) SPM-specific functions for this practical, but I'm not aware of any way of doing this step in SPM and can't seem to find anything from searching either.
>
> Thanks in advance for any help,
> Iain
>
--
Guillaume Flandin, PhD
Wellcome Trust Centre for Neuroimaging
University College London
12 Queen Square
London WC1N 3BG
|