Hi,
Swapping axes is equivalent to introducing a reflection, which
is equivalent to changing from a left-handed to right-handed
coordinate system. Hence LIP is a different handedness
to LPI, as reflected in the determinant of the matrices. For
FSL the most crucial thing is whether an image can be
registered only using rotations, translations, scalings and
skews to another image, or whether a reflection is also
involved. This is why we make a big deal about the difference
between the two settings, and why we use the determinant
of the matrix. Be warned that finding a way to make two people's
coordinate conventions consistent is really not easy. If you really
do need to do it then what you need to know is the following:
- positive determinants for the s-form (or q-form if there is no
valid s-form) means we treat the image as having a
"neurologically-ordered" coordinate system and this
means that the flirt mm coordinates are flipped along the
x-axis with respect to the voxel coordinates. Other axes
have the flirt mm coordinates as just positive scalings of
the voxel coordinates (and this is also true of the x-axis
when the determinant is negative).
- once you know whether to insert this flip or not, then you
should be able to relate the image voxel coordinates.
If in doubt look at the FSLView coordinates, or use
img2imgcoord for dealing with FLIRT matrices, or use
the -usesqform option (with -applyxfm and -omat) to
save the appropriate FLIRT matrix to map between
the voxel coordinates of different images (not doing
any registration - just using the qform/sform information).
I wish you luck.
All the best,
Mark
On 11 Aug 2010, at 22:54, Coalson, Timothy Scott (S&T-Student) wrote:
> I have made a utility for converting between affine transform files,
> since it seems everyone uses a different convention, and I had a
> question for providing maximum compatibility with flirt (currently
> the only other formats it knows are LPI world matrices and 2 4dfp
> suite formats): what exactly is the criterion for identifying
> neurological volumes? It was previously mentioned that a positive
> determinant was one way to check, but if axes are not in xyz
> anatomical order, this could be fooled, for instance the spacing
> part of a nifti sform:
>
> 1 0 0
> 0 0 1
> 0 1 0
>
> has a negative determinant, yet clearly specifies coordinates in an
> LPI fashion (specifically, LIP). I believe I have the scale and x
> flip matrices correct (scale using the magnitude of the spacing
> vectors), from a pair of posts from the archive and some matlab code
> to convert between flirt and inverse world matrices I was given. If
> this issue is unimportant due to a strong recommendation to only use
> transverse images in flirt, that would also be nice to know.
>
> Thanks,
> Tim Coalson
>
|