Manaal,
You're welcome to use the script, but I think it would be best to wait until we get the sign conventions straight.
I check the sign convention on the individual rotation matrices (Rx, Ry and Rz) as follows:
1. Simulate a motion-free HARDI data set by doing a tensor fit to a real data set and generating what the images would look like if they were described by a tensor. Besides not having motion, the simulated data also has realistic diffusion-weighted contrast.
2. Inject motion in one volume with flirt.
3. Apply eddy to the image with known motion.
4. Compare the motion-corrected images against the rotation angles from eddy. This is how I arrived at the sign conventions. For example, imagine a sagittal view. Now image that eddy makes the image have its chin tilted down with respect to the original, motion-corrupted image. Assuming RPI coordinates, this is motion would transform a unit vector along +y to a vector with a little negative z component. Although I am prone to mistakes, I'm pretty sure that plugging in the rotation angles provided by eddy into the matrices I have in my code gets the right answer. I would appreciate it if you could double-check and get back to me.
However, I'm stumped on getting the composite rotation right. I couldn't get an unambiguous motion that I was able to get with the individual rotation angles. If the angles are small enough, it doesn't make much of a difference which convention you use. There is, however, a correct answer, and I would appreciate finding that out.
Ken
|