Siemens gradient orientation and DTK | Diffus...

来源:百度文库 编辑:神马文学网 时间:2024/04/29 08:19:08

Siemens gradient orientation and DTK

Page:   1   User Post

4:55 pm
April 5, 2010


jzhuo

Baltimore

Member

posts 5

Print this Post 1

Post edited 4:56 pm – April 5, 2010 by jzhuo


Thank you for the really nice program that you have here. We enjoy using it a lot.

 

We've been all fine with DICOM import and auto orientation and corrected gradient table. But when I'm starting to use NIFTI format, I started to get confused.

 

So to my understanding, Siemens gradient is in the scanner co-ordinate and is not native to the collected image space. DTK doesn't care about the nifti transformation matrix that's been stored in the nifti header. Is that correct?

 

But I don't know how you get the real image orientation. I tried to use the transformation matrix from the nifti header and then rotate the orientation accordingly:

So, say I have an oblique Axial. And the rotation matrix from the NIFTI header is (supposely mapping from voxel coordinates to real world coordinates):

   -1.7945    0.0611   -0.0760  116.6597
   -0.0576   -1.7936   -0.1017  143.9828
   -0.0713   -0.0891    1.9960  -30.8756
         0         0         0    1.0000

 

If only care about the rotation, then I will get a matrix of:

   -0.9987    0.0340   -0.0380         0
   -0.0321   -0.9982   -0.0509         0
   -0.0397   -0.0496    0.9980         0
         0         0         0    1.0000

 

Then I used this matrix to rotate the Axial orientation co-ordinate: (1,0,0),(0,1,0) and I got:

(-0.9987, -0.0321, -0.0397),(0.0340, -0.9982, -0.0496).

But if I load the dicom image directly, I can see an image orientaion of:

(0.999, 0.032, -0.040), (-0.034, 0.998, -0.050).

 

It's close enough but with a sign difference for x and y. Are there anything I'm missing here?

 

Thank you very much.

 

Jiachen

 

 

 

 

12:05 pm
April 6, 2010


Ruopeng

Admin

posts 56

Print this Post 2

Post edited 12:29 pm – April 6, 2010 by Ruopeng


Hi Jiachen,

DTK does care transformation information saved in the nifti header (or in the dicom header). It uses it to determine the voxel coordinates (i.e., how volume data is saved, so it knows if it is an axial data, etc). Also, if it is oblique Siemens data, it also uses it to correct the gradient vectors.

As to the sign difference, I believe it is because image orientation saved in dicom is in LPS coordinates, when converting it to nifti, you must convert it to RAS coordinates. So you flip the sign of x & y components. You need to do the same thing when you convert it back from nifti to dicom.

Ruopeng

3:08 pm
April 6, 2010


jzhuo

Baltimore

Member

posts 5

Print this Post 3

Dear Ruopeng,

 

Thanks for the clarification.

 

Does DTK only care about NFITI header transformation information when I click 'Auto' correct for Image orientation?

I have some NIFTI format images from the dcm2nii program (part of the MRIcron package). I don't know why, I can not correct for image orientation with that (when trying to click 'Auto', I got error message saying 'Cannot retrieve image orientaion info…..' ). So does it mean that it's taking the image as is without any transformation? 

Then that means that even if I do 'Apply gradient orientation correction', it's not going to work, right? I have to either manually enter the image orientation information, or have a corrected gradient table?

Thank you very much.

 

Jiachen

3:49 pm
April 6, 2010


jzhuo

Baltimore

Member

posts 5

Print this Post 4

Post edited 5:46 pm – April 6, 2010 by jzhuo


I have another question, as regard to the co-ordinate system. So if I have to rotate the gradient table to suit my data, do I also need to flip the sign of x & y componets?

 

Thank you very much.

 

Jiachen

12:03 pm
April 7, 2010


Ruopeng

Admin

posts 56

Print this Post 5

The "Auto" check box right next to Image Orientation field is to automatically retrieve image orientation information from data file.

DTK will always use the image orientation information to determine voxel coordinates of the data (that's actually also a kind of correction). But only when you check "apply gradient orientation correction", it will take account the oblique information from the image orientation in the correction.

If the image orientation info is not available in the data file, it will give you error if you checked "Auto" button. So you need to uncheck it and manually enter the six values in the box.

No, you do not need to flip the sign of x & y of the gradient table. DTK manges all these craziness for you.

Ruopeng

9:42 pm
April 7, 2010


jzhuo

Baltimore

Member

posts 5

Print this Post 6

Thank you for your answer. Now I understand it better. 

 

My question is, what if the orientation information saved in the header is not correct? The nifti image I have generated from dcm2nii program also have a transformation matrix, but the matrix has some sign difference compare to the ones generated from diff_unpack. And it rendered a voxel size of (-1.76, 1.76, 2). I guess the negative voxel size is what DTK doesn't like (so I can not click the 'Auto' button)? In that case, does DTK just treat the images as real world co-ordinates? So I have to have a corrected gradient table to make it work, right? But then, do I need to worry about the co-ordinate system whether it's 'RAS' or 'LPS'? 

 

Thank you very much.

 

Jiachen

 

 

8:31 pm
April 8, 2010


jzhuo

Baltimore

Member

posts 5

Print this Post 7

I finally got it right! Looks like I do need to flip signs for x and y. Maybe as you said, it's a co-ordinate system difference between RAS and LPS.

 

Thank you very much.

 

Jiachen

Page:   1