Rotational transformation matrix & surface registration of models

Hello,

Sorry for troubling you all, but I’d be grateful if you could kindly help with me with something I’m struggling with. I’ve been having trouble utilizing the rotational transformation matrix to suit my needs, and wanted to make sure I was interpreting things correctly.

What I am interested in knowing is the rotational transformation matrix in degrees, and I have been using an online calculator (3D Rotation Converter) to convert the 3x3 part of Slicer’s 4x4 matrix.

As a test, I created a cube on Meshmixer, and duplicated it. Then, I rotated the duplicate 11.1, 22.2, 33.3 degrees in the x, y, and z axes, respectively. After exporting these 2 surfaces, I then used the Slicer CMF registration and got the transformation matrix in the 4x4 matrix format.

image

MATRIX

However, when I tried to convert the 3x3 matrix to angles, all of the numbers seemed quite off from the 11.1, 22.2, 33.3 degrees. Even when accounting for possible registration errors, the discrepancies seem quite severe (plus on visual inspection the registration seems accurate).

I would again be grateful for everyone’s wisdom on this!!

If you can build Slicer, you could test my Dynamicmodeler Tool: transformMaker
It let’s you compose any number of angles, convert them in transforms and it will return the resulting rotation matrix angle

See more info here:

1 Like

You might also find this module helpful: GitHub - mikebind/SlicerCharacterizeTransformMatrix

Could your issue be that there are multiple ways to decompose a net rotation into series of rotations?

2 Likes

Thank you very much mau_igna_06 and mikebind, it’s incredibly helpful and I’m now able to do what I wanted thanks to you! Hope one day I’d be able to contribute to the community like you folks!

1 Like

@mikebind Would you consider adding this module to the Sandbox extension? We maintain this extension to make it easier for users to install small, experimental modules (few clicks instead of downloading and extracting a zip package, setting additional module paths, etc.).

2 Likes

Yes, I’ll work on that. I have already forked the Sandbox repo to work on adding the DICOM stitching module but got bogged down trying to improve it and add some tests, so had not finished that process yet. This transformation matrix module is very simple and I think will not really require much modification, so it should be quicker to add when I get a chance. I’ll try to get to that soon.

1 Like