Incompatible Elastix transformation parameters with Transforms module

Hi,

The resulting transform parameters from parameters file or elastix log are different from what I see in the transforms module and this is happening for all my registrations.
For example this is in the transform parameter file
(TransformParameters -0.03651878797625225 0.003033123843879148 -0.0006397282655260022 9.21029262141312 -27.286980280721142 252.7584809282367)
And this is what I see in the Transform Module:

Which is the correct one?

Thank you.

here is another example with more difference

(TransformParameters -0.10761595892949985 0.034073286732973586 -0.00008801191874278422 12.692584965893245 -31.151640872040343 145.8404685931222)

but this in the Transforms module

Elastix and Slicer represent the transformation differently. You might notice that there are only 6 numbers in the Elastix representation of the transform, whereas there are 12 in the Slicer representation. The Elastix representation parameters are 3 rotation and 3 translation parameters. The Slicer representation is a 4x4 homogeneous affine transformation matrix. The translation parts might differ either because

  • the order of translation vs rotation may differ between the two representations,
  • because a “CenterOfRotationPoint” was specified in the Elastix file, or
  • because Slicer is representing the “fixed to moving” transform and Elastix is representing the “moving to fixed” transform (these are inverses of each other).

I think it is likely the last one (moving to fixed vs fixed to moving), but I would need to take a closer look and do some testing to be 100% sure.

The following code shows exactly how Slicer converts from the Elastix version to the matrix version.

2 Likes