# Registration mask and rigidity penalty

**URL:** <https://discourse.itk.org/t/registration-mask-and-rigidity-penalty/6311>\
**Category:** Beginner Questions\
**Created:** [November 20, 2023, 2:47am UTC](https://discourse.itk.org/t/registration-mask-and-rigidity-penalty/6311 "2023-11-20T02:47:36Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![calici](https://discourse.itk.org/letter_avatar_proxy/v4/letter/c/ecb155/32.png) [@calici](https://discourse.itk.org/u/calici)\
**Post date:** [November 20, 2023, 2:47am UTC](https://discourse.itk.org/t/registration-mask-and-rigidity-penalty/6311/1 "2023-11-20T02:47:36Z")

</div>

My questions is actually the continuation of [elastix group discussion.](https://groups.google.com/g/elastix-imageregistration/c/f9FvaKAyT94).

Currently I am trying to assess treatment success by registering pretreatment CT and post treatment CT. I want to keep the lesion region undeformed as much as possible while registering other parts with deformable algorithms. Since my algorithm is intensity-based, lesion region in pretreatment CT and treatment region in posttreatment CT are confusing the algorithm.

Currently I am experimenting with TransformRigidityPenalty. But I am also wondering the effect of masking out those regions during registration. I read that TransformRigidityPenalty is calculated on control points not sampled points. So does it mean that even though the region-of-interest is masked out, TransformRigidityPenalty would still force the algorithm to keep that region rigid?

Thank you!
