> I have two problems related to Left and Right issue with using SPM .
Its more of a feature than a problem.
>
> I am using both SPM2 and SPM5. In both version I have set
>
> defaults.analyze.flip = 0 in spm_default.m
> flip = 0 in spm_flip_analyze_images.m
>
> The first problem is that I find same dicom files converted by SPM2 (dicom
> conversion toolbox) and SPM5 have opposite x step, see attached screen shot
> from SPM5 display.
The DICOM conversion currently always writes data with left-handed storage.
If you look at spm_dicom_convert.m at the following lines, then you should
see that only a few slight modifications to the code could be made in order
to store the data in a right-handed form.
156:
if ~true, % LEFT-HANDED STORAGE
mat = mat*[-1 0 0 (dim(1)+1); 0 1 0 0; 0 0 1 0; 0 0 0 1];
volume = flipdim(volume,1);
end;
542:
if ~true, % LEFT-HANDED STORAGE
mat = mat*[-1 0 0 (dim(1)+1); 0 1 0 0; 0 0 1 0; 0 0 0 1];
end;
578:
if ~true, plane = flipud(plane); end; % LEFT-HANDED STORAGE
684:
if ~true, % LEFT-HANDED STORAGE
mat = mat*[-1 0 0 (dim(1)+1); 0 1 0 0; 0 0 1 0; 0 0 0 1];
end;
720:
if ~true, plane = flipud(plane); end; % LEFT-HANDED STORAGE
>
> The second problem I have is when I do segmentation with SPM5. I have input
> image in nifit format and the head is
>
>
> V1 =
>
> fname: 'rT199_brain.nii'
> mat: [4x4 double]
> dim: [512 512 53]
> dt: [16 0]
> pinfo: [3x1 double]
> n: [1 1]
> descrip: 'FSL3.2beta'
> private: [1x1 nifti]
>
> >>V1.mat
>
> ans =
>
> 0.4688 0 0 -120.2346
> 0 0.4688 0 -120.2344
> 0 0 3.0000 -81.0000
> 0 0 0 1.0000
I'm guessing that the original image was stored in the same orientation. Was
it one that had been converted from DICOM using SPM5, or was it one of your
old SPM2 images, created with the flip set to 0?
>
>
> So it's three dimesion all have positive step and check with SPM5 display
> its left is left and right is right (neurological, x increase from left to
> right). However after segmentation I have the normalised segmented image
> with x dimension has negative step:
>
>
> V2=spm_vol('wc1rT199_brain.nii')
>
> V2 =
>
> fname: 'wc1rT199_brain.nii'
> mat: [4x4 double]
> dim: [91 109 91]
> dt: [2 0]
> pinfo: [3x1 double]
> n: [1 1]
> descrip: 'spm - 3D normalized'
> private: [1x1 nifti]
>
> >>V2.mat
>
> ans =
>
> -2 0 0 92
> 0 2 0 -128
> 0 0 2 -74
> 0 0 0 1
>
>
> When I display it using SPM5, the image itself appears that left is left
> and right is right. However, I wonder it was flipped because now x
> increases from right to the left!
The spatial normalisation writes the images with the same orientation as the
templates. These are all stored with a left-handed system (except for the
SPECT template for some reason). The order of storage should not matter -
providing that the fields in the headers are set appropriately.
>
>
> I have a few questions:
>
> 1. What value should we set for "flip" in "spm_default.m" and
> "spm_flip_analyze_images.m" for SPM2 and SPM5, if we directly import
> images from dicom file?
In SPM5, it should not matter at all - providing you consistantly use SPM5 and
NIFTI format images. If you use the old SPM2 format images, then it will
matter. The important thing is that flip has been set in a way that is
appropriate for your images. Most people have flip set to 1, so it may be
easier to exchange data with such settings.
spm_flip_analyze_images is only consulted when reading non-nifti images that
don't have an SPM2 .mat file.
>
> 2. Why SPM2 and SPM5 convert image in different orientation (I mean lefe
> and right)?
SPM5 uses NIFTI. SPM2 doesn't. I figured that the new file format would be a
chance to eliminate some of the confusion.
>
> 3. What orientation (positive x step or negative x step, neurological or
> radiological) should use for nifit file, if we import nifit file to SPM5? I
> check SPM5 templates and they all have negative voxel size in x.
NIFTI can have either left- or right-handed storage - providing this
information is encoded in the headers. It is only ever used by:
** spm_orientations.m **
Shows the orientations that SPM assumes that the data are stored in.
** @nifti/nifti.m **
If there is an SPM99 format .mat file, then the info is needed.
** @nifti/private/decode_qform0.m **
** @nifti/private/mayo2nifti1.m **
For interpreting non-NIFTI header information.
Best regards,
-John
|