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