# align two segments to each other 

**URL:** <https://discourse.slicer.org/t/align-two-segments-to-each-other/2570>\
**Category:** Support\
**Created:** [April 12, 2018, 1:29pm UTC](https://discourse.slicer.org/t/align-two-segments-to-each-other/2570 "2018-04-12T13:29:02Z")\
**Posts on this page:** 15\
**Page:** 1

<div class="post-metadata">

**Author:** ![katharina\_hecker](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/katharina_hecker/32/3431_2.png) [@katharina\_hecker](https://discourse.slicer.org/u/katharina_hecker)\
**Post date:** [April 12, 2018, 1:29pm UTC](https://discourse.slicer.org/t/align-two-segments-to-each-other/2570/1 "2018-04-12T13:29:02Z")

</div>

Operating system: Windows  
Slicer version:4.9  
Expected behavior: align the size of two segments to each other  
Actual behavior: when i wanted to try to set the same size parameters for two different volumes the image dimensions could not be changed, so that the following created segments had different sizes. It is very time consuming and inaccurate to align them with the transformation matrix. Is there another way to set the parameters/dimensions, so that I can integrate one of them in the other?

---

<div class="post-metadata">

**Author:** ![cpinter](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/cpinter/32/7995_2.png) [@cpinter](https://discourse.slicer.org/u/cpinter)\
**Post date:** [April 12, 2018, 2:52pm UTC](https://discourse.slicer.org/t/align-two-segments-to-each-other/2570/2 "2018-04-12T14:52:43Z")

</div>

I can only guess what you’re trying to do exactly, so can you please give us more information? Such as

- Do you segment one anatomical image or more? If you segment more are they from the acquisition or modality?
- Are you trying to register two different segmentations, or you have a problem with the geometry of the images that represent the segments?

---

<div class="post-metadata">

**Author:** ![katharina\_hecker](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/katharina_hecker/32/3431_2.png) [@katharina\_hecker](https://discourse.slicer.org/u/katharina_hecker)\
**Post date:** [April 12, 2018, 3:08pm UTC](https://discourse.slicer.org/t/align-two-segments-to-each-other/2570/3 "2018-04-12T15:08:28Z")

</div>

Thanks for your reply!!!  
I am segmenting for each segment an image sequence. They are from acquisition…  
The images of those two image sequences are different in size. What I´m doing is: I´m creating out of those image sequences with ‘segment editor’ two segments. But it is hard to increase the properties of the first segment and align this perfectly to the size of the second segment (the first segment is just a part of the second segment (organ in body…)

---

<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:** [April 12, 2018, 3:33pm UTC](https://discourse.slicer.org/t/align-two-segments-to-each-other/2570/4 "2018-04-12T15:33:31Z")

</div>

Registration using transform slider is certainly very hard. Fortunately, there are several other registration tools in Slicer that can be applicable. For example:

- Segment registration module (in Segment registration extension): Fully automatic registration between two segments. Supports both rigid and deformable transforms.
- Fiducial registration wizard (in SlicerIGT extension): Landmark-based registration (you need to manually identify corresponding landmarks in the images).
- Model registration (in SlicerIGT extension): Iterative closest point (ICP) based fully automatic rigid registration. You need to export segments to models (using Segmentations module), as this module expects model nodes as input. ICP can stuck into local minimum, so this method requires the segments to be already somewhat aligned when you start the registration.

---

<div class="post-metadata">

**Author:** ![katharina\_hecker](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/katharina_hecker/32/3431_2.png) [@katharina\_hecker](https://discourse.slicer.org/u/katharina_hecker)\
**Post date:** [April 12, 2018, 3:37pm UTC](https://discourse.slicer.org/t/align-two-segments-to-each-other/2570/5 "2018-04-12T15:37:44Z")

</div>

Thank you very much for your help!

---

<div class="post-metadata">

**Author:** ![katharina\_hecker](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/katharina_hecker/32/3431_2.png) [@katharina\_hecker](https://discourse.slicer.org/u/katharina_hecker)\
**Post date:** [April 12, 2018, 3:49pm UTC](https://discourse.slicer.org/t/align-two-segments-to-each-other/2570/6 "2018-04-12T15:49:36Z")

</div>

Unfortunately I can´t find in Extensions the Segment registration module, can you maybe help me to get there?

---

<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:** [April 12, 2018, 3:52pm UTC](https://discourse.slicer.org/t/align-two-segments-to-each-other/2570/7 "2018-04-12T15:52:14Z")

</div>

I’ve just checked and it is available for latest stable (Slicer-4.8.1), in Registration category.

---

<div class="post-metadata">

**Author:** ![katharina\_hecker](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/katharina_hecker/32/3431_2.png) [@katharina\_hecker](https://discourse.slicer.org/u/katharina_hecker)\
**Post date:** [April 12, 2018, 3:58pm UTC](https://discourse.slicer.org/t/align-two-segments-to-each-other/2570/8 "2018-04-12T15:58:35Z")

</div>

Is it maybe also available for 4.9?

---

<div class="post-metadata">

**Author:** ![cpinter](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/cpinter/32/7995_2.png) [@cpinter](https://discourse.slicer.org/u/cpinter)\
**Post date:** [April 12, 2018, 4:05pm UTC](https://discourse.slicer.org/t/align-two-segments-to-each-other/2570/9 "2018-04-12T16:05:07Z")

</div>

Unfortunately the factory builds for 4.9 are down for a few days now. Also there is a Windows build system bug that prevents building extensions depending on other extensions (such as SegmentRegistration on SlicerRT) if there is one or more failing test in the extension, and this is why there are no SegmentRegistration builds for a while.

I can try to find you a successful build from the recent past, or I can do a custom build for you, it’s quite easy.

---

<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:** [April 12, 2018, 4:07pm UTC](https://discourse.slicer.org/t/align-two-segments-to-each-other/2570/10 "2018-04-12T16:07:02Z")

</div>

In the meantime, you can do the registration in Slicer-4.8.1, save the result, and load it into 4.9.x.

---

<div class="post-metadata">

**Author:** ![katharina\_hecker](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/katharina_hecker/32/3431_2.png) [@katharina\_hecker](https://discourse.slicer.org/u/katharina_hecker)\
**Post date:** [April 12, 2018, 5:04pm UTC](https://discourse.slicer.org/t/align-two-segments-to-each-other/2570/11 "2018-04-12T17:04:25Z")

</div>

Good, thank you for your help!

---

<div class="post-metadata">

**Author:** ![cpinter](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/cpinter/32/7995_2.png) [@cpinter](https://discourse.slicer.org/u/cpinter)\
**Post date:** [April 12, 2018, 6:13pm UTC](https://discourse.slicer.org/t/align-two-segments-to-each-other/2570/12 "2018-04-12T18:13:51Z")

</div>

I made a custom installer with a recent 4.9

> **[Dropbox - File Deleted](https://www.dropbox.com/sh/7zj4lrcizq2invk/AACtTi0Y2y_Fv4Ky1TFhEDXXa?dl=0)**
>
> Dropbox is a free service that lets you bring your photos, docs, and videos anywhere and share them easily. Never email yourself a file again!

Install Slicer, then install the extensions (SegmentRegistration last) in Extension Manager with the wrench icon in the top right. Make sure you wait a bit until it says the extension is installed, sometimes the message comes prematurely.

---

<div class="post-metadata">

**Author:** ![katharina\_hecker](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/katharina_hecker/32/3431_2.png) [@katharina\_hecker](https://discourse.slicer.org/u/katharina_hecker)\
**Post date:** [April 13, 2018, 4:26am UTC](https://discourse.slicer.org/t/align-two-segments-to-each-other/2570/13 "2018-04-13T04:26:04Z")

</div>

Thank you very much!

---

<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:21pm UTC](https://discourse.slicer.org/t/align-two-segments-to-each-other/2570/14 "2019-08-19T13:21:39Z")

</div>

Is there any module that supports non-rigid ICP registration? Or something like parametric non-rigid registration with gaussian processes?

---

<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:04pm UTC](https://discourse.slicer.org/t/align-two-segments-to-each-other/2570/15 "2019-08-19T14:04:19Z")

</div>

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.
