I'm not 100% certain that I understand your question, but if you use
SPM with deformation images, you need to be aware that the components
of the field are stored slightly differently. You need to specify
nii,1,1 nii,1,2 and nii,1,3 (rather than nii,1 nii,2 and nii,3). The
file selector doesn't easily allow you to select eg nii,1,2 , so you
need to use the Ed button on it to manually change the values.
Alternatively, if you know a bit of MATLAB, you can use the nifti
commands directly. Individual components of deformation fields may be
read using...
ni = nifti('filename.nii')
x = ni.dat(:,:,:,1,1);
y = ni.dat(:,:,:,1,2);
z = ni.dat(:,:,:,1,3);
Writing out images is slightly harder, but there is some example code
available by typing...
help nifti/Contents
Best regards,
-John
On 22 October 2010 09:18, maryam momeni <[log in to unmask]> wrote:
> Hi Dears,
>
> I am working with SPM5 and I am using deformation toolbox on it. As you know
> the deformation field has nii format and
> in my program I want to average nii files. After I averaged the nii files
> and I want to use them in spm there is an error
> which wants me the nii,2 and nii,3.
> If anyone knows about the nii file format or how I can do it please help me.
>
> Regards
> Maryam
|