# Registration fails if the moving image is translated

**URL:** https://discourse.itk.org/t/registration-fails-if-the-moving-image-is-translated/7701
**Category:** Algorithms
**Created:** [February 2, 2026, 8:33am UTC](https://discourse.itk.org/t/registration-fails-if-the-moving-image-is-translated/7701 "2026-02-02T08:33:35Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![Vasily\_Postnicov](https://discourse.itk.org/user_avatar/discourse.itk.org/vasily_postnicov/32/4604_2.png) [@Vasily\_Postnicov](https://discourse.itk.org/u/Vasily_Postnicov)
#### Post date: [February 2, 2026, 8:33am UTC](https://discourse.itk.org/t/registration-fails-if-the-moving-image-is-translated/7701/1 "2026-02-02T08:33:35Z")

</div>

Hi! I am trying to do different kinds of image registration with ITK (not simpleitk). I attach the code I use (it’s from one of the examples with small modifications).

[itk.cpp](https://discourse.itk.org/uploads/short-url/wcIY7wUKc5lRNf40LNTkdFJ6UfH.cpp) (6.1 KB)

I use the `Euler3DTransform` model because the documentation says it’s a rotation + translation (total 6 parameters for optimization). The target function to minimize is `MeanSquaresImageToImageMetricv4.` I have already tried different types of optimizers all with the same result. The problem is as follows: I have a test image. When I rotate the image (outside of ITK) by arbitrary angles around all 3 axes, ITK is able to find the correct transform. When I add an additional translation by a small vector, ITK always fails. If I e.g. try a small translation without rotations and use `TranslationTransform` instead, the registration succeeds. How can I register an image with both rotation and translation?

My ITK version is 5.3.0

---

<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: [February 2, 2026, 2:22pm UTC](https://discourse.itk.org/t/registration-fails-if-the-moving-image-is-translated/7701/2 "2026-02-02T14:22:36Z")

</div>

Hello @Vasily_Postnicov,

You are missing the scales estimation that is applied to the different transformation parameters. A step of 1mm in translation has a different effect than a rotation of 1radian on the optimization, so these are scaled to have similar effects. This is achieved using one of [RegistrationParameterScalesFromPhysicalShift](https://docs.itk.org/projects/doxygen/en/stable/classitk_1_1RegistrationParameterScalesFromPhysicalShift.html), [RegistrationParameterScalesFromIndexShift](https://docs.itk.org/projects/doxygen/en/stable/classitk_1_1RegistrationParameterScalesFromIndexShift.html), [itkRegistrationParameterScalesFromJacobian](https://docs.itk.org/projects/doxygen/en/stable/classitk_1_1RegistrationParameterScalesFromJacobian.html).

Usage illustrated in [this example](https://docs.itk.org/projects/doxygen/en/stable/Examples_2RegistrationITKv4_2ImageRegistration1_8cxx-example.html).

---

<div class="post-metadata">

### Author: ![Vasily\_Postnicov](https://discourse.itk.org/user_avatar/discourse.itk.org/vasily_postnicov/32/4604_2.png) [@Vasily\_Postnicov](https://discourse.itk.org/u/Vasily_Postnicov)
#### Post date: [February 3, 2026, 3:43am UTC](https://discourse.itk.org/t/registration-fails-if-the-moving-image-is-translated/7701/3 "2026-02-03T03:43:09Z")

</div>

Thanks!
