> I am trying to save one matrix as a new volume
>
> I build the matrix and use another volume as template
>
> fnm = spm_select(1, 'image');
>
>
> [pth bnm ext] = spm_fileparts(fnm);
>
> VI = spm_vol(fnm(1,:));
>
> VO = VI;
>
> VO.fname = fullfile(pth, [bnm '_connectivity_' ext]);
>
> spm_write_vol(VO,img);
>
>
>
> Where img is the matrix,
>
> Is possible that the script flips my image?
Yes. If the image you base the output on is flipped relative to your data.
> In the resulting image seems like the right hemisphere correspond to the
> left hemisphere
I'd suggest checking the orientations in the headers of the images
involved to see if you have used them properly. The .mat fields are
the ones to examine.
Best regards,
-John
|