Understanding image registration process

Hi,

I’m getting an unexpected behavior in the image registration process. I’m using Elastix registration to register two 4DCT frames of the popi-model data dir_validation_data - Rayonnement, Images, Oncologie (insa-lyon.fr)

In the registration process, I’m saving the warped volume and the DVF. The DVF is saved in a .txt file with the b-spline parameters.

The output of the registration (warped volume) is correct since the moving phase matches the original 4D CT frame. The image size, spacing, origin and directions are also the same as the original 4D CT frames.

Then, I imported the DVF generated by registration to the 3D slicer and tried to apply the DVF to the moving phase just to see if the output of the registration is exactly the same as when the DVF is manually applied to the original image. The DVF was applied by was right-clicking on the “Transform” column and hardening the transform.

After that, I used the Subtract Scalar Volume module to subtract both images and I got big differences and edges:

image

Also, I noticed that the origin and size of the image changed after manually applying the DVF, which is, in my opinion, a strange behavior. And a different behaviour from Elastix registration.

Volume information for the warped volume generated by Elastix:
image

Volume information for the warped volume generated by manually apply the DVF:

image

Information about the tranform:
image

I would really appreciate it if anyone could explain this behavior and how to solve it, please. Thank you in advance.

This all looks good and the subtraction result shows that registration is almost perfect.

Image geometry (origin, size, axis directions, and extents) are expected to change if you harden a non-linear transform. If you have a specific target geometry that you want to resample to then you can use one of the image resampling modules, such as “Resample Scalar/Vector/DWI volume” module.