Transforming Points by using ScaleSkewVersor3DTransform

Hello dear community,
I register MRI images (moving) with different spacings and shapes to a template MRI (fixed) with spacing [1.0; 1.0; 1.0] and Shape[193, 229, 193]. I also have points for each moving MRI that represent an annotation for the respective image.
I followed the notebooks provided and registering works without any problems. As transformation type I use ScaleSkewVersor3DTransform.

I’m having trouble transferring the points to the template MRT with main_transform.TransformPoint. The points don’t seem to be in the desired position after the transformation.

fixed_image = sitk.ReadImage('../data/masks/mni_icbm152_nlin_sym_09/mni_icbm152_t1_tal_nlin_sym_09c.nii', sitk.sitkFloat32)
main_transform = sitk_registration(fixed_image, moving_image, mode='versor')
moving_sitk = sitk.Resample(moving_image, fixed_image, main_transform, sitk.sitkLinear, 0.0, moving_image.GetPixelID())
moving_sitk.CopyInformation(fixed_image)
# Point (_anno_dict['anchor3DX'], _anno_dict['anchor3DY'], _anno_dict['anchor3DZ']) in physical coordinates of the source image
x, y, z = main_final_transform.TransformPoint((_anno_dict['anchor3DX'], _anno_dict['anchor3DY'], _anno_dict['anchor3DZ']))

What am I doing wrong?

Just spotted the answer from dzenanz. Thanks that cleared my question.

1 Like