help > RE: Using acpcdetect to get pitch, roll, and yaw
Nov 1, 2018  07:11 AM | Pravesh Parekh - National Institute of Mental Health and Neurosciences
RE: Using acpcdetect to get pitch, roll, and yaw
Hello,

Thank you for replying. Once the landmarks are detected and the matrices are saved, I am attempting the following:

To figure out the translation that is needed to be applied to shift the origin to the AC: convert the AC voxel location to coordinates in mm (by multiplying with the first three rows and columns of the header matrix) and then subtract from the original images' translation (the last column of the header matrix).

However, I am unsure of how to proceed with calculating the rotations. I tried deconstructing the header matrix into components but the rotation values do not look reasonable.

Here is the FSL matrix that I have:
-0.9995 -0.0116 0.0291 189.5262
0.0093 -0.9969 -0.0776 273.5740
-0.030 0.0773 -0.9965 262.7300
0 0 0 1

I used the spm_imatrix function (from SPM) to deconstruct it into translations and rotations:
translations = 189.5262, 273.5740, 262.7300 (x, y, z)
rotations = -3.0638 0.0292 -0.0116 (pitch, roll, yaw (the pitch value in radians is too high!)

The detected AC and PC locations are: 96.8, 141.8, 152.1 and 96.9, 118.3 152.1

To shift the origin to the AC, translation = -matrix(1:3,1:3)*AC_location - matrix(1:3,4)
which gives me 7.08, 11.29, and 9.5 mm shift in the right, forward, and up directions (seems reasonable; using these values does bring the origin to AC)

How can I go about calculating the rotations then to line up the PC? I apologize if this is trivial and/or if I am meandering down an overtly complicated path for no reason due to my limited understanding in this area.


Look forward to your thoughts

Warm Regards
Pravesh

Originally posted by Babak Ardekani:
Originally posted by Pravesh Parekh:
Hello,

Thank you for the wonderful acpcdetect (v1 and v2). It is working great for our dataset!
I would like to know if there is a way to derive the amount of pitch, roll, and yaw rotations that should be applied to the data once the AC and the PC voxel locations are detected? The idea is to include acpcdetect in some other preprocessing pipeline for which we would like to extract and use translations and rotations to shift the image origin to the AC (while ensuring that the PC lines up to the AC-PC line).

Thank you for your help


Best Regards
Pravesh

Hi Pravesh,

I'm glad the program is working well on your data.   acpcdetect v2 outputs two rigid-body affine transformation matrices that contain this information.
*.mrx Transformation matrix for tilt-correction in ART format
*.FSL.mat Transformation matrix for tilt-correction in FSL format

The two matrices contain the same information in different format.  ART uses the FOV center as the origin of the coordinates system while FSL use the FOV corner.

Regards
Babak

PS:  This information is available in the acpcdetect v2 documentation.

Threaded View

TitleAuthorDate
Pravesh Parekh Oct 31, 2018
Pravesh Parekh Nov 2, 2018
Babak Ardekani Nov 2, 2018
Babak Ardekani Nov 2, 2018
Pravesh Parekh Nov 2, 2018
Babak Ardekani Nov 2, 2018
Pravesh Parekh Nov 3, 2018
Babak Ardekani Nov 6, 2018
Babak Ardekani Oct 31, 2018
RE: Using acpcdetect to get pitch, roll, and yaw
Pravesh Parekh Nov 1, 2018
Babak Ardekani Nov 2, 2018
Pravesh Parekh Nov 2, 2018