General Registration (Elastix/BRAINS) unable to handle large rotation

Operating system: win 10
Slicer version: 4.11.0 (nightly build)
Expected behavior: input the fixed and moving volume to obtain a transformed volume and a transform matrix
Actual behavior: the transformed volume would not be aligned with the fixed volume (in Elastix module using the generic preset). I’ve also tried tuning the parameters using the BRAINS module, but it doesn’t seem to like to rotate much, despite increasing the maximum step length and decreasing the transform scale.

I am certain that the two volumes overlap because the moving volume is a cropped and rotated version of the fixed volume. I am applying the modules to try and recover the transform.

In summary, my first question is am I using the modules wrong?
Second question: can I recover the affine transform matrix when using the elastix module? Currently the transform file size is 2G for a 500x500x500 pixel volume… it seems too big for a 3x4 affine transform matrix.

Thank you in advance!

Intensity-based automatic registration methods typically do not converge if the initial rotation error is more than 15-20 degrees. You can pre-align the images visually, or by specifying a few matching landmarks, or if the images have approximately the same contents then automatically, based on second degree central moments.

Unfortunately, Elastix uses its own transformation file format that only Elastix can read and Slicer not. It should not be too difficult to implement reading at least linear transformation (and maybe bspline) from the Elastix transform files in SlicerElastix module. See issue on GitHub. We plan to work on this at some point, but if you need it soon then probably your best bet is to implement it yourself (read the text file that Elastix generates, find the transform parameters, and set the matrix values into a transform node) and send a pull request. If you have any help for it then let us know.

Thank you for the tip.