# Interpolate between VersorRigid3DTransforms (with different centers of rotation)

I want to rigidly register two very large microCT volumes (~1000x1000x1000 voxels) of a material sample taken at different times. The sample has small features (eg. roughly 10x10x10 voids), homogeneously distributed across the volume. Registration on the full volume is intractable, and if I drastically downsample first, all the volume features get washed out and the registration fails. However if I take small crops of the volume (say 100x100x100), the registration succeeds. Rather than rely on the registration of a single crop, Iâ€™d like to â€śaverageâ€ť or â€śinterpolate betweenâ€ť the registrations of a few crops across the volume to be more robust to any small deformations there may be across the sample, or noise in the registration optimization.

Specifically, if I have two VersorRigid3DTransforms which represent registrations of 100x100x100 crops from opposing corners of the volume (eg, crops centered at [50,50,50] and [950,950,950]).

1. How can I interpolate between the transforms (perhaps using slerp?) to get a single rigid transform I can apply to my full volume?
2. Should the original crop transforms have the same center of rotation? Or is it possible to somehow adjust the center of rotation from the crop center (eg. [50,50,50]) to the full volume center ( [500,500,500])?

To make the averaging problem easier, you could set all your transforms to use the same center (center of your volume) using `transform->SetCenter(volumeCenterPoint);`.

Averaging translations should be simple enough.

And for averaging angle, I am not sure whether just simple average of the quaternions would do it. Unless you find some math describing averaging of quaternions, simple mean is worth a shot.

Hello @dperl

SLERP is appropriate if you have two quaternions.

To average multiple quaternions while retaining the unit norm see the paper by Markley et al. â€śAveraging Quaternionsâ€ť. Readily implemented as it only involves computing the eigenvector corresponding to the largest eigenvalue of a specific matrix.

1 Like

I would consider a different approach.

I the local rotation of the transform can be extrapolated to the global / average.

Iâ€™d consider solving the problem a set of local â€ślandmarkâ€ť based registrations. With these local transformation, a point set can be generated in the local â€ślandmarkâ€ť patched. Then the global transform could be solved from this point set.

1 Like

Thanks zivy. Two quaternions is probably enough for me, at least at first. Is there a SLERP implementation or example in ITK?

Interesting, do you propose the landmarks be generated from the cropped registrations, or in some other way? Is there an example for how to generate these landmarks in ITK?
Thanks

My suggestion was inspired by the 3D Slicer Landmark Registration module:

The module first registers cropped regions around user selected points ( local affine registration ). Then performs a global fitting of the corresponding fixed to moving point sets. It has options for a global affine and global thin plate spline.

Setting center of the local transform to the global volume center, would make the averaging problem easier at the cost of the robustness and/or stability of the optimization for the local registration.

1 Like

Ok thanks, Iâ€™ll have a look at this, maybe itâ€™s an easier way to get global registration than my original approach.

1 Like