Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Affine registration #7421

Open
wants to merge 149 commits into
base: main
Choose a base branch
from

Conversation

jboulanger
Copy link

Description

Intensity based affine registration of image pairs.

  • estimate a transform to register the moving image using ndi.affine_transform
  • supports 2d and 3d images
  • supports color image using channel_axis parameter (more flexible for 3d images)
  • supports affine, euclidean and translation motion models using a string parameter
  • supports weights/mask to use only a part of the image. Modifies the normalized_mutual_information to support weights.
  • includes 2 solvers: lucas kanade [1] and studholme [2,3] parametrized as functions callback
  • related to PR 3544 and 7050. The studholme solver is inspired heavily from PR 3544.
  • include an quantification of alignment error (target registration error)

The API tries to take inspiration from the PR3455, however I found it not very user friendly to pass callback for handling euclidean or translation motion model. Moreover the logic is different between the two solvers and could not find a way to conciliate the previously discussed API with the added solver. PR3455 was relying on transforms in the example to handle restricted model (euclidean) which is not compatible with ndi.affine_transform, here we stick to ndi.affine_transform to ba able to handle 3D images.

Comparison bewteen the solvers and cv2.findTransformECC. The 2nd row display the registration error map.
image

Registration of a brain MRI volume
image

TODO

  • euclidean is not implemented for lucas kanade solver for dimension > 2.

References

  1. algo_affine
  2. Studholme C, Hill DL, Hawkes DJ. Automated 3-D registration of MR and CT images of the head. Med Image Anal. 1996 Jun;1(2):163-75.
  3. J. Nunez-Iglesias, S. van der Walt, and H. Dashnow, Elegant SciPy: The Art of Scientific Python. O’Reilly Media, Inc., 2017.

Checklist

Release note

For maintainers and optionally contributors, please refer to the instructions on how to document this PR for the release notes.

...

@jboulanger jboulanger marked this pull request as draft May 15, 2024 07:50
@jboulanger jboulanger marked this pull request as ready for review May 20, 2024 07:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

6 participants