ANTsX / ANTsPy

A fast medical imaging analysis library in Python with algorithms for registration, segmentation, and more.
https://antspyx.readthedocs.io
Apache License 2.0
608 stars 161 forks source link

Points transform is erroneous for ‘SyNRA’ registration #504

Open MariaBurd opened 11 months ago

MariaBurd commented 11 months ago

I am trying to register an experiment brain (light microscopy, 3D) to Allen brain atlas, using autofluorescent channels from the experiment and from the template atlas. The registration of the images using the ‘SyNRA’ method works very well basically every time. The image transform works perfectly, but it seems to be a known issue with the points transform. I wonder if the transform is performed only on the Affine transform and not the earlier parts of it. Is there a good workaround?

image

What was done specifically was, I checked the images and their formats; transformed the indices into the physical points and back; the coordinates are given in the XYZT order (no time direction in this experiment though).

For the transform I did:

REGISTRATION_METHOD = 'SyNRA' result = ants.registration(fi, mi, type_of_transform = REGISTRATION_METHOD, outprefix = PATH_TXT, verbose=True)

affine_file = PATH_TXT + '0GenericAffine.mat' inv_file = PATH_TXT + '1InverseWarp.nii.gz' transformlist = [affine_file, inv_file]

reg_coords = ants.apply_transforms_to_points(dim=3, points=coords_df, transformlist = transformlist, whichtoinvert = [True, False])

I would appreciate any suggestions!

ntustison commented 11 months ago

Have you run through these examples?