# angle constrain

**URL:** https://discourse.itk.org/t/angle-constrain/7718
**Category:** Uncategorized
**Created:** [February 27, 2026, 12:45pm UTC](https://discourse.itk.org/t/angle-constrain/7718 "2026-02-27T12:45:46Z")
**Posts on this page:** 6
**Page:** 1

<div class="post-metadata">

### Author: ![Chat\_Gpt](https://discourse.itk.org/user_avatar/discourse.itk.org/chat_gpt/32/4527_2.png) [@Chat\_Gpt](https://discourse.itk.org/u/Chat_Gpt)
#### Post date: [February 27, 2026, 12:45pm UTC](https://discourse.itk.org/t/angle-constrain/7718/1 "2026-02-27T12:45:46Z")

</div>

Hi,

Is it possible to constrain the rotational angles in `Euler3DTransform`? If so then what is the way for imposing lower and upper bounds on rotational angles within an Euler3DTransform object during a registration process in ITK?

---

<div class="post-metadata">

### Author: ![blowekamp](https://discourse.itk.org/user_avatar/discourse.itk.org/blowekamp/32/79_2.png) [@blowekamp](https://discourse.itk.org/u/blowekamp)
#### Post date: [February 27, 2026, 12:54pm UTC](https://discourse.itk.org/t/angle-constrain/7718/2 "2026-02-27T12:54:16Z")

</div>



---

<div class="post-metadata">

### Author: ![system](https://discourse.itk.org/uploads/default/original/2X/3/3adf1dc6b8787513c050a8952744199b6b1843eb.png) [@system](https://discourse.itk.org/u/system)
#### Post date: [February 27, 2026, 2:18pm UTC](https://discourse.itk.org/t/angle-constrain/7718/3 "2026-02-27T14:18:30Z")

</div>



---

<div class="post-metadata">

### Author: ![dzenanz](https://discourse.itk.org/user_avatar/discourse.itk.org/dzenanz/32/1093_2.png) [@dzenanz](https://discourse.itk.org/u/dzenanz)
#### Post date: [February 27, 2026, 2:27pm UTC](https://discourse.itk.org/t/angle-constrain/7718/4 "2026-02-27T14:27:39Z")

</div>

You might want to take a look at this post:

> [@constraining parameters during optimization](https://discourse.itk.org/t/constraining-parameters-during-optimization/2848):
>
> For example, I’m using the Similarity2DTransform. Here, I would like to enforce that the scale must be non-zero and positive, however I would like to allow for negative translation. Is it correct, that the only optimizer which can handle constraints is the LBFGSBOptimizer? But, it looks like that I can only constraint all parameters with the same bounds - is this correct? So I tried something like this: R = sitk.ImageRegistrationMethod() R.SetInitialTransform(sitk.Similarity2DTransform()) R.…

---

<div class="post-metadata">

### Author: ![Chat\_Gpt](https://discourse.itk.org/user_avatar/discourse.itk.org/chat_gpt/32/4527_2.png) [@Chat\_Gpt](https://discourse.itk.org/u/Chat_Gpt)
#### Post date: [March 2, 2026, 8:23am UTC](https://discourse.itk.org/t/angle-constrain/7718/5 "2026-03-02T08:23:07Z")

</div>

In this post they used LBFGSBOptimizer. But I am doing rigid transformation. Is there any way I can set constraints for rigid transformation?

---

<div class="post-metadata">

### Author: ![dzenanz](https://discourse.itk.org/user_avatar/discourse.itk.org/dzenanz/32/1093_2.png) [@dzenanz](https://discourse.itk.org/u/dzenanz)
#### Post date: [March 2, 2026, 1:37pm UTC](https://discourse.itk.org/t/angle-constrain/7718/6 "2026-03-02T13:37:06Z")

</div>

Yes. The transform parameters are 3 rotation angles, and 3 translations. You can set bounds for each of them independently. From [Euler3DTransform docs](https://docs.itk.org/projects/doxygen/en/stable/classitk_1_1Euler3DTransform.html):

> The serialization of the optimizable parameters is an array of 6 elements. The first 3 represents three euler angle of rotation respectively about the X, Y and Z axis. The last 3 parameters defines the translation in each dimension.
