Composite Transform with second Transform on resampled Image

Hello Community,

my question is regarding a cleaner way to combine multiple transforms where the latter transforms are optimized over the resampled image.

So what I want to do smth like this:

resampled = T1(fixed,moving)
final = T2(fixed, resampled)

Im curretnly using itk-elastix for python, for which I can just stack 2 registration workflows after each other too achieve what I described above.

However, now I would like to combine these two registrations (T1,T2) into a single one that I can apply directly to the moving image with e.g. transformix to resample masks within the moving image.

When I just combine they with either “Compose” or “Add” in the TX parameter files the results differ noticeably from doing the transformations with 2 separate transforms T1,T2.

Having one transformation rather than too would be very helpful to calculate the inverse or transformation fields.

I hope my made my comment clear and I would be very grateful for any help with this!

Best wishes
Kenrick

@Niels_Dekker and @ntatsisk might provide some advice.

I’m not sure this is doable using ITK, but it is all trivial if you convert the ITK transforms to VTK transforms, because VTK can dynamically invert and combine any transform types.

1 Like

Thank you for the advice.
I will give it a go!