# Problem with registration

**URL:** <https://discourse.itk.org/t/problem-with-registration/6600>\
**Category:** Algorithms\
**Tags:** simpleitk, registration, python\
**Created:** [April 26, 2024, 11:33am UTC](https://discourse.itk.org/t/problem-with-registration/6600 "2024-04-26T11:33:19Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Sunita\_Patel](https://discourse.itk.org/user_avatar/discourse.itk.org/sunita_patel/32/3347_2.png) [@Sunita\_Patel](https://discourse.itk.org/u/Sunita_Patel)\
**Post date:** [April 26, 2024, 11:33am UTC](https://discourse.itk.org/t/problem-with-registration/6600/1 "2024-04-26T11:33:19Z")

</div>

Dear ITK Team,

Q.1) We are doing registration and visualize using gui.RegistrationPointDataAquisition(), it is showing the fixed and moving images. When we click on any point in the images it shows that point correctly on other image. However, when we click a second point on the same slice, it shows that point on a new slice in other image. Why the points are not visible on the same slice after registration?

Q.2) If I run the same registration two or three times every time there is little change in the registration in spite of providing the same seed value. Why is this change taking place in every registration?

Q.3) After registration followed by resampling using final transformation of the moving image, it shows slice mismatch in resampled image when we clicked on any random point.

We will highly appreciate your help.

Thank you so much.

Best regards,  
Sunita

---

<div class="post-metadata">

**Author:** ![zivy](https://discourse.itk.org/user_avatar/discourse.itk.org/zivy/32/1726_2.png) [@zivy](https://discourse.itk.org/u/zivy)\
**Post date:** [April 26, 2024, 3:42pm UTC](https://discourse.itk.org/t/problem-with-registration/6600/2 "2024-04-26T15:42:37Z")

</div>

Hello @Sunita_Patel,

Q1 and Q2: The `RegistrationPointDataAquisition` class works in two modes depending on the way it is created. The parameter of interest is [known\_transformation](https://github.com/InsightSoftwareConsortium/SimpleITK-Notebooks/blob/d8c3de720b2cba8df3fc0c20fbf7b1e959f35f60/Python/gui.py#L26). When not provided, the default, it is assumed to be the identity. This is used prior to registration. After registration, setting the `known_transformation` to the result of the registration will map corresponding points in the two images to each other (as close as the registration allows). This mapping is between the original images, not between the fixed image and the resampled moving image. The GUI eliminates the need for resampling. Please look at how this component is used in the notebooks.

Q3: Please see [the documentation](https://simpleitk.readthedocs.io/en/master/registrationOverview.html#reproducibility).

---

<div class="post-metadata">

**Author:** ![Sunita\_Patel](https://discourse.itk.org/user_avatar/discourse.itk.org/sunita_patel/32/3347_2.png) [@Sunita\_Patel](https://discourse.itk.org/u/Sunita_Patel)\
**Post date:** [April 28, 2024, 4:58pm UTC](https://discourse.itk.org/t/problem-with-registration/6600/3 "2024-04-28T16:58:24Z")

</div>

When we used affine interpolator in registration the resampled image is coming in the center. However, when we used any other interpolator such as linear, bspline, cosinewindowedsinc, the resampled image is shifted either bottom right or left?

Could you please help us to fix the problem.

Thank you so much.

Best regards,  
Sunita

---

<div class="post-metadata">

**Author:** ![zivy](https://discourse.itk.org/user_avatar/discourse.itk.org/zivy/32/1726_2.png) [@zivy](https://discourse.itk.org/u/zivy)\
**Post date:** [April 29, 2024, 3:54pm UTC](https://discourse.itk.org/t/problem-with-registration/6600/4 "2024-04-29T15:54:53Z")

</div>

Hello @Sunita_Patel,

There is no “affine interpolator”, please see the [list of interpolators](https://simpleitk.org/doxygen/latest/html/namespaceitk_1_1simple.html#a7cb1ef8bd02c669c02ea2f9f5aa374e5), so not sure exactly what it is you are doing and what exactly is the problem.

Possibly provide a minimal working code example illustrating your problem, or maybe images illustrating the issue. Based on the information you provided, the difference between what you expect and what you get is not clear.
