# Non-rigid registration of meshes

**URL:** <https://discourse.slicer.org/t/non-rigid-registration-of-meshes/2247>\
**Category:** Support\
**Tags:** registration\
**Created:** [March 6, 2018, 2:52am UTC](https://discourse.slicer.org/t/non-rigid-registration-of-meshes/2247 "2018-03-06T02:52:36Z")\
**Posts on this page:** 13\
**Page:** 1

<div class="post-metadata">

**Author:** ![stevenagl12](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/stevenagl12/32/3391_2.png) [@stevenagl12](https://discourse.slicer.org/u/stevenagl12)\
**Post date:** [March 6, 2018, 2:52am UTC](https://discourse.slicer.org/t/non-rigid-registration-of-meshes/2247/1 "2018-03-06T02:52:36Z")

</div>

Hi, I was wondering if it is possible to perform non-rigid registrations of meshes between each other in slicer, or potentially in SPHARM-PDM? I know that SPHARM has Procrustes but I am looking for a deformation field to be applied to models to distort the mesh for my purposes.

---

<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:** [March 6, 2018, 3:48am UTC](https://discourse.slicer.org/t/non-rigid-registration-of-meshes/2247/2 "2018-03-06T03:48:58Z")

</div>

We usually do deformable surface registration based on landmarks, using `Fiducial registration wizard` module in SlicerIGT extension. If you can identify enough corresponding landmarks then the method works extremely well.

---

<div class="post-metadata">

**Author:** ![thewtex](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/thewtex/32/32_2.png) [@thewtex](https://discourse.slicer.org/u/thewtex)\
**Post date:** [March 7, 2018, 1:22am UTC](https://discourse.slicer.org/t/non-rigid-registration-of-meshes/2247/3 "2018-03-07T01:22:04Z")

</div>

Non-rigid registration of meshes [is available in ITK](http://www.insight-journal.org/browse/publication/317).

---

<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:** [March 10, 2018, 6:32pm UTC](https://discourse.slicer.org/t/non-rigid-registration-of-meshes/2247/4 "2018-03-10T18:32:23Z")

</div>

I just remember, [Segment registration](https://github.com/SlicerRt/SegmentRegistration) extension can do deformable mesh registration, too. It can work directly from segmentation nodes. If you have your input in model nodes then import those into a segmentation node using Segmentations module.

@thewtex, the mesh registration sounds interesting, too. Is it in ITK proper? Is it available in SimpleITK?

---

<div class="post-metadata">

**Author:** ![thewtex](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/thewtex/32/32_2.png) [@thewtex](https://discourse.slicer.org/u/thewtex)\
**Post date:** [March 10, 2018, 8:14pm UTC](https://discourse.slicer.org/t/non-rigid-registration-of-meshes/2247/5 "2018-03-10T20:14:19Z")

</div>

@lassoan Yes, the metrics that Nick Tustison wrote are very impressive and state-of-the-art. These are available in ITK proper. They are not available in SimpleITK.

---

<div class="post-metadata">

**Author:** ![stevenagl12](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/stevenagl12/32/3391_2.png) [@stevenagl12](https://discourse.slicer.org/u/stevenagl12)\
**Post date:** [August 19, 2019, 12:15pm UTC](https://discourse.slicer.org/t/non-rigid-registration-of-meshes/2247/6 "2019-08-19T12:15:51Z")

</div>

3 questions, 1) I am working in Slicer 4.11.0 nightly. When I went to download and install the Segment Registration module, it is displaying that it is downloaded in the extension manager, but is not showing up in the list of modules. Should I just download a new nightly build? 2) I did not find any documentation on how to perform mesh registration in ITK, are there code examples, and are there examples using 3D slicer to perform the registration? 3) Finally, is there any way to perform PCA modelling with the 3D models in Slicer?

---

<div class="post-metadata">

**Author:** ![stevenagl12](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/stevenagl12/32/3391_2.png) [@stevenagl12](https://discourse.slicer.org/u/stevenagl12)\
**Post date:** [August 19, 2019, 12:36pm UTC](https://discourse.slicer.org/t/non-rigid-registration-of-meshes/2247/7 "2019-08-19T12:36:16Z")

</div>

Actually, one more question, does anyone know the algorithm being applied for the deformable registration between the segments in Segment Registration? Is it Iterative Closest Points, or some variation thereof?

---

<div class="post-metadata">

**Author:** ![stevenagl12](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/stevenagl12/32/3391_2.png) [@stevenagl12](https://discourse.slicer.org/u/stevenagl12)\
**Post date:** [August 19, 2019, 1:17pm UTC](https://discourse.slicer.org/t/non-rigid-registration-of-meshes/2247/8 "2019-08-19T13:17:41Z")

</div>

I think that it was that particular nightly build that wasn’t able to load the Segment Registration module, but when I run the module with 2 meshes (in this case a lion and a sabretooth tiger skull), to perform deformable registration after registration with fiducials, it is not warping the model at all?

---

<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:** [August 19, 2019, 2:09pm UTC](https://discourse.slicer.org/t/non-rigid-registration-of-meshes/2247/9 "2019-08-19T14:09:56Z")

</div>

> [@stevenagl12](#):
>
> Actually, one more question, does anyone know the algorithm being applied for the deformable registration between the segments in Segment Registration? Is it Iterative Closest Points, or some variation thereof?

The method uses intensity-based b-spline registration of distance maps. See details at the links in this post:

> [@align two segments to each other](https://discourse.slicer.org/t/align-two-segments-to-each-other/2570/15):
>
> Segment Registration extension supports non-linear warping (based on b-spline registration of distance maps). We tried various approaches and this worked the best for our applications. It was [tested extensively on prostate US/MRI registration](http://perk.cs.queensu.ca/contents/open-source-image-registration-mri-trus-fusion-guided-prostate-interventions), [used successfully in clinical work](http://perk.cs.queensu.ca/contents/validation-mri-us-registration-focal-hdr-prostate-brachytherapy-treatment), and worked surprisingly well for other applications, too.

> [@stevenagl12](#):
>
> perform deformable registration after registration with fiducials, it is not warping the model at all?

You need to harden the landmark-based transform before starting the new registration.

---

<div class="post-metadata">

**Author:** ![stevenagl12](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/stevenagl12/32/3391_2.png) [@stevenagl12](https://discourse.slicer.org/u/stevenagl12)\
**Post date:** [September 5, 2019, 3:29pm UTC](https://discourse.slicer.org/t/non-rigid-registration-of-meshes/2247/10 "2019-09-05T15:29:16Z")

</div>

I already hardened the landmark transforms, but, what I’m nto sure about is, can you convert a model into a binary volume and use this volume along with the segmentations to perform the morphable registration?

---

<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 5, 2019, 8:42pm UTC](https://discourse.slicer.org/t/non-rigid-registration-of-meshes/2247/11 "2019-09-05T20:42:18Z")

</div>

There is no need to convert models to binary volumes. You can import your models into segmentation (few clicks in Segmentations module) and register them to each other or to other segments using Segment registration module.

---

<div class="post-metadata">

**Author:** ![stevenagl12](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/stevenagl12/32/3391_2.png) [@stevenagl12](https://discourse.slicer.org/u/stevenagl12)\
**Post date:** [September 11, 2019, 6:02am UTC](https://discourse.slicer.org/t/non-rigid-registration-of-meshes/2247/12 "2019-09-11T06:02:32Z")

</div>

Is it ok to leave the fixed and moving image sections blank? Also, when I try to run it this way, it looks like it’s just duplicating the same mesh that was the moving mesh without doing any deformations? Finally, is there any way to get the transform out? In the following image, there’s supposed to be 3 meshes. The blue is supposed to be the fixed mesh, the yellowish/white is supposed to be the original moving mesh, and the brown is supposed to be the deformed mesh:

 ![image](https://us1.discourse-cdn.com/flex002/uploads/slicer/original/3X/a/8/a8a41c47a1e589d438cdb0129e1e034f680d8088.jpeg)  
If it’s actually doing deformations to the moving mesh, then it should be creating a new deformed mesh right?

---

<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 11, 2019, 1:09pm UTC](https://discourse.slicer.org/t/non-rigid-registration-of-meshes/2247/13 "2019-09-11T13:09:58Z")

</div>

> [@stevenagl12](#):
>
> Is it ok to leave the fixed and moving image sections blank?

Fixed and moving images seems to be necessary (I got an error message when I did not set something - check your logs to confirm). You can load any of the Slicer sample data sets and use those.

I’ve submitted an issue for this (see [here](https://github.com/SlicerRt/SegmentRegistration/issues/5)). It would be great if you could fix it and send a pull request - it is just a Python script, that you need to modify so that if fixed or moving image is missing then skip any operations on them (do not try to resample).
