# Rigid Transformation is-- scaling?

**URL:** <https://discourse.slicer.org/t/rigid-transformation-is-scaling/31953>\
**Category:** Support\
**Created:** [September 28, 2023, 8:53pm UTC](https://discourse.slicer.org/t/rigid-transformation-is-scaling/31953 "2023-09-28T20:53:32Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![Beth\_Bearce](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/beth_bearce/32/18556_2.png) [@Beth\_Bearce](https://discourse.slicer.org/u/Beth_Bearce)\
**Post date:** [September 28, 2023, 8:53pm UTC](https://discourse.slicer.org/t/rigid-transformation-is-scaling/31953/1 "2023-09-28T20:53:32Z")

</div>

Hi there!

I have a bit of a workflow to extract the simplified shapes of fish spines from their whole skeletons, and then align them to one another. (I work on scoliosis & spine morphology.) Here is what I typically do:

1. Create a Markup list, manually add a series of fiducial landmarks to the narrowest central point of each vertebra (Using Markups).
2. Create a “Spine Tube” that approximates the width and shape of the spinal column. (Markups-to-Model using the Markup List as the Input \> Create Tube \> Set Radius = .35mm \> Global Moving Polynomial for smoothing). Repeat for each fish from various scans, export the models.
3. Use the Markup Lists from the fish that I am registering to create “Rigid” Transforms. (Registration\>Specialized\>Fiducial Registration, Align 2 spines by assigning one as fixed & one as moving, Check “Rigid.”)
4. Align the Spine Tube Models by applying their corresponding markup transformations.

The problem that I have with this, is that this transformation is scaling my models, even though I am only applying Rigid transforms-- as in, if I align one small fish using the markups from its 32 vertebrae, to a rather big fish that has 32 vertebrae, the small fish ends up just as long as the big one. But “rigid” is checked, so this Transformation shouldn’t scale. (It appears to re-scale the whole model proportionally-- the tube radius of the scaled model ends up looking a little larger, even though I created the tubes with the same radius initially.) Can anyone figure out where this is going wrong?

---

<div class="post-metadata">

**Author:** ![mikebind](https://avatars.discourse-cdn.com/v4/letter/m/71e660/32.png) [@mikebind](https://discourse.slicer.org/u/mikebind)\
**Post date:** [September 28, 2023, 10:05pm UTC](https://discourse.slicer.org/t/rigid-transformation-is-scaling/31953/2 "2023-09-28T22:05:45Z")

</div>

That definitely sounds like a bug somewhere. You can check if the transform matrix is rigid using the Characterize Transform Matrix module of the Slicer Sandbox extension ([GitHub - PerkLab/SlicerSandbox: Collection of utilities that are not polished implementations but can be useful to users](https://github.com/PerkLab/SlicerSandbox#characterize-transform-matrix); the extension is installable through the extension manager). If the output transform matrix of Fiducial Registration with the “Rigid” box checked does not represent a rigid transformation, report back here, ideally with a simple data set which would allow others to reproduce the problem.

---

<div class="post-metadata">

**Author:** ![muratmaga](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/muratmaga/32/3622_2.png) [@muratmaga](https://discourse.slicer.org/u/muratmaga)\
**Post date:** [September 28, 2023, 10:11pm UTC](https://discourse.slicer.org/t/rigid-transformation-is-scaling/31953/3 "2023-09-28T22:11:40Z")

</div>

> [@Beth\_Bearce](#):
>
> Registration\>Specialized\>Fiducial Registration

Install the SlicerIGT and retry with the `Fiducial Registration Wizard`. and see if you are seeing the scaling.

---

<div class="post-metadata">

**Author:** ![mikebind](https://avatars.discourse-cdn.com/v4/letter/m/71e660/32.png) [@mikebind](https://discourse.slicer.org/u/mikebind)\
**Post date:** [September 28, 2023, 10:27pm UTC](https://discourse.slicer.org/t/rigid-transformation-is-scaling/31953/4 "2023-09-28T22:27:08Z")

</div>

I can reproduce this issue with a simple synthetic data set. I created a fixed fiducial set by clicking randomly, cloned it, created a scaling transformation, applied it to the clone and hardened it, and Fiducial Registration between the two produced a scaling transformation output even though the “Rigid” option was selected, which is clearly an error.

---

<div class="post-metadata">

**Author:** ![mikebind](https://avatars.discourse-cdn.com/v4/letter/m/71e660/32.png) [@mikebind](https://discourse.slicer.org/u/mikebind)\
**Post date:** [September 28, 2023, 10:30pm UTC](https://discourse.slicer.org/t/rigid-transformation-is-scaling/31953/5 "2023-09-28T22:30:16Z")

</div>

Fiducial Registration Wizard, on the other hand, produces a rigid transformation for the same data set.

---

<div class="post-metadata">

**Author:** ![Beth\_Bearce](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/beth_bearce/32/18556_2.png) [@Beth\_Bearce](https://discourse.slicer.org/u/Beth_Bearce)\
**Post date:** [September 28, 2023, 10:36pm UTC](https://discourse.slicer.org/t/rigid-transformation-is-scaling/31953/7 "2023-09-28T22:36:19Z")

</div>

Thank you for trying this (& also recapitulating the bug)! I will redo all the transforms with the Wizard.

---

<div class="post-metadata">

**Author:** ![muratmaga](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/muratmaga/32/3622_2.png) [@muratmaga](https://discourse.slicer.org/u/muratmaga)\
**Post date:** [September 28, 2023, 10:40pm UTC](https://discourse.slicer.org/t/rigid-transformation-is-scaling/31953/8 "2023-09-28T22:40:51Z")

</div>

awesome, if you can file a bug report for `Fiducial Transform` it will be great.  
cc @jcfr

---

<div class="post-metadata">

**Author:** ![lassoan](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/lassoan/32/13_2.png) [@lassoan](https://discourse.slicer.org/u/lassoan)\
**Post date:** [September 30, 2023, 4:41am UTC](https://discourse.slicer.org/t/rigid-transformation-is-scaling/31953/9 "2023-09-30T04:41:18Z")

</div>

The issue was the ITK has been improved to be able to compute the scaling. I’ve pushed a fix, it will be in the Slicer Preview Release within a couple of days.

> <https://github.com/Slicer/Slicer/pull/7255>
>
> When Rigid transform type was selected in Fiducial Registration module, the resu…lting transform included scaling (scale factor != 1.0) as reported at https://discourse.slicer.org/t/rigid-transformation-is-scaling/31953
> 
> The problem occurred because ITK landmark initializer has been improved so that it can now compute scaling. Fixed this by using more specific transform types (rigid/similarity).
> 
> Since ITK now also supports "affine" transform initialization, this option is now exposed in the module as well.
