Print

Print


Hi,

You don't have to worry about this within FSL - everything is taken
care of correctly.  The coordinates used in FSLView and tools like
img2imgcoord are completely consistent.  The FLIRT transforms
work internally with a mm coordinate system (not the voxels) and
so flip the handedness of the voxel coordinate system as needed.
However, the FLIRT internal coordinates are *not* the same as
the FSLView mm coordinates.

As for the resulting image after running FLIRT, it is the reference
image that determines the qform and sform, and consequently
the handedness.

So the big problem you have would be the method in your lab
that ignores the hdr information.  In this case you need to work
out what your software assumes and then make sure the images
that you use as input are in the correctly format.  Essentially, 
getting the reference volume in FLIRT setup with the right
information will do the trick.  You can also covert the handedness
of an image with the following commands (although I do not
generally recommend this, in exceptional circumstances like
this it can be useful):
  fslswapdim origim -x y z swappedim
  fslorient -swaporient swapeddim
Note that it is necessary to use both commands.
Also, this will not work if both the qform and sform codes
are both zero.  If that is the case then things are trickier and
the best thing is to use: fslorient -setsformcode
in order to set the sform code to a non-zero value and then
deal with it from then on (checking carefully the left-right
status, as the setting of the sform codes can alter the
left-right status).

I hope this fixes your problems.
All the best,
	Mark




On 5 Feb 2011, at 23:29, Yan wrote:

> Hi,
> 
> I really hope that someone can help me with this. I just cannot figure out the correct way to do it. I have some DTI data and I am trying to align them up to an white matter atlas. The data set (FA image) didn't have the same orientation with MNI152 (labeling is correct, but the orientation was 180 degree different), so I used "fslreorient2std" to reorient it with MNI152. After that, "fslhd" showed both qform_xorient and sform_xorient changed to "Left-to-Right" (Neurological orientation, it was Right-to-Left before). When I used "fslview" to see the volume, labeling was fine and x=0 is on the most right of the image (patient's left). 
> 
> Now the atlas (also an FA image) is an analyze image with radiological orientation. So I used some converter tool (Jimmy Chen's Nifti toolkit in Matlab) to convert it into a Nifti file. Then I also used "fsllreorient2std" to reorient it with MNI152. It actually didn't matter. The orientation and labeling was correct before this (I checked it with "fslview"). But this time, "fslhd" showed both qform_xorient and sform_xorient "Right-to-Left" (radiological). "fslview" showed x=0 on the most left of the image (patient's right).
> 
> Then I used "flirt" to register my DTI FA to this template FA and I got a transformation matrix.
> 
> Now I am starting to be confused:
> 
> 1. why did "fslreorient2std" change my data's orientation from LAS to RAS? Why not keep the same as MNI152, which is LAS?
> 
> 2. Does "Flirt" work properly in this situation with two nifti files of different orientation? What does this transformation matrix mean, to map an RAS image to an LAS image? What if I have a LAS image, can I apply this transformation matrix on it (it relates to the third question I have about the LAS fiber coordinates). 
> 
> 3. I actually assume Flirt will work properly. But then I had the fiber coordinates from TrackVis. They are in LAS (radiological), which means x=0 (in voxel) on the patient's right. I wanted to use "img2imgcoord" to convert those coordinates onto the atlas coordinate (in voxel) by applying the transformation matrix. But I don't know how "img2imgcoord" defines voxel dimension. Does voxel x=0 start at the left corner of the image (right of the patient) no matter what, or is it consistent with "fslview" that voxel x=0 is at the right corner of the image (patient's left)? Does it read the header information of the image (the reference image) to decide the definition?
> 
> 4. The next step I do is non-linear registration with the software in my lab. It only takes .img images without reading the .hdr file. So after "flirt", the resliced DTI FA image has the same orientation with the atlas FA (LAS). I was wondering how the resliced DTI data is stored in .img after "Flirt". Is it LAS then?
> 
> Sorry, the orientation really gives me  problems... However, it is very crucial for fiber alignment. I am trying to be very cautious here. So if anyone who can kindly answer my questions, I will deeply appreciate it! Thank you for your time and help!
> 
> Yan
>