# Registration of two objects

**URL:** <https://discourse.slicer.org/t/registration-of-two-objects/34353>\
**Category:** Support\
**Tags:** registration\
**Created:** [February 16, 2024, 3:11am UTC](https://discourse.slicer.org/t/registration-of-two-objects/34353 "2024-02-16T03:11:27Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![labixin](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/labixin/32/1965_2.png) [@labixin](https://discourse.slicer.org/u/labixin)\
**Post date:** [February 16, 2024, 3:11am UTC](https://discourse.slicer.org/t/registration-of-two-objects/34353/1 "2024-02-16T03:11:27Z")

</div>

Hello everyone,

I want to register two objects. One is an ellipsoid represented as a model (Figure 1). It was created using “Create Models” and “Surface Toolbox” modules with specific dimensions (4.5×4.0×1.0). The other one is a few high density markers represented as segment (labelled in green on Figure 2). It was segmented using “Segment Editor” module within breast region.

I would like to register the two objects and make the markers as close to the surface of the ellipsoid as possible. Theoretically, the markers represented the margin/edge of the tumor resection cavity (modelled by ellipsoid). And I want to determine the location of ellipsoid through registration (rigid, translate or rotate).

 ![used_ask2](https://us1.discourse-cdn.com/flex002/uploads/slicer/original/3X/6/e/6ed43d823b696374071945439f9e06abad382841.png)

Is there any registration tool useful for achieving this? And do I need to change the markers segment into fiducials or models? Hope for some advice.

Thanks in advance. Your help is highly appreciated.

Best regards,

Crayon

---

<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:** [February 17, 2024, 1:06am UTC](https://discourse.slicer.org/t/registration-of-two-objects/34353/2 "2024-02-17T01:06:55Z")

</div>

I don’t think there is any registration tool that will do this automatically for you. However, if you can place 4-5 manual landmarks on each of the structures that you will like to register, you can use the Fiducial Registration Wizard in the SlicerIGT extension. It can create rigid, similarity, affine or warping transforms.

---

<div class="post-metadata">

**Author:** ![Matteboo](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/matteboo/32/66548_2.png) [@Matteboo](https://discourse.slicer.org/u/Matteboo)\
**Post date:** [February 19, 2024, 10:13am UTC](https://discourse.slicer.org/t/registration-of-two-objects/34353/3 "2024-02-19T10:13:20Z")

</div>

Hello,  
One thing that I did in the past that could work for you is to transform your segmentation in a volume by exporting it to a labelmap. I guess that you can do the same thing with you model.  
This way you can use all the toolbox made to register volumes on them.  
Once you have your registration, you can just apply it to the model.

---

<div class="post-metadata">

**Author:** ![labixin](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/labixin/32/1965_2.png) [@labixin](https://discourse.slicer.org/u/labixin)\
**Post date:** [February 19, 2024, 3:47pm UTC](https://discourse.slicer.org/t/registration-of-two-objects/34353/4 "2024-02-19T15:47:51Z")

</div>

Thanks for your advice. I have tried “Fiducial Registration Wizard” and the result is pretty good. I would like to know more about the registration algorithm. And I wonder what to reference if the work is prepared for research paper.

Hope for your reply. Thank you very much again.

Best regards,

Crayon

---

<div class="post-metadata">

**Author:** ![labixin](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/labixin/32/1965_2.png) [@labixin](https://discourse.slicer.org/u/labixin)\
**Post date:** [February 19, 2024, 4:01pm UTC](https://discourse.slicer.org/t/registration-of-two-objects/34353/5 "2024-02-19T16:01:32Z")

</div>

> [@Matteboo](#):
>
> This way you can use all the toolbox made to register volumes on them.

Thanks for your inspiring suggestions. I wonder what registration module did you use in your task. I could only perform “General Registration (BRAINS)” and “General Registration (ANTs)” for registration of the two labelmap volume. Is there any other registration module that I could have a try?

Hope for your reply. Thank you very much again.

Best regards,

Crayon

---

<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:** [February 19, 2024, 4:24pm UTC](https://discourse.slicer.org/t/registration-of-two-objects/34353/6 "2024-02-19T16:24:04Z")

</div>

That’s the nice thing about open source, you can look under the hood to see what they are using. I am not familiar with technical aspects of Fiducial Registration Wizard module, but quick look to the source code, found this section ComputedPairedPointMapping:

> <https://github.com/SlicerIGT/SlicerIGT/blob/20ff7abdb7fd0126f353337d3c90aed323f8b9eb/FiducialRegistrationWizard/Logic/vtkSlicerFiducialRegistrationWizardLogic.h#L92>

which looks like traditional point correspondence algorithm that tries to minimize the total sum of squares between two sets of corresponding points. I am not sure if there is a specific paper you can cite.

---

<div class="post-metadata">

**Author:** ![Matteboo](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/matteboo/32/66548_2.png) [@Matteboo](https://discourse.slicer.org/u/Matteboo)\
**Post date:** [February 19, 2024, 4:27pm UTC](https://discourse.slicer.org/t/registration-of-two-objects/34353/7 "2024-02-19T16:27:34Z")

</div>

I used #elastix  
I prefer it because it’s very modulable but I don’t know the module that you used so they might be just as good.

---

<div class="post-metadata">

**Author:** ![labixin](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/labixin/32/1965_2.png) [@labixin](https://discourse.slicer.org/u/labixin)\
**Post date:** [February 20, 2024, 8:08am UTC](https://discourse.slicer.org/t/registration-of-two-objects/34353/8 "2024-02-20T08:08:12Z")

</div>

Thanks for your reply. I have used Elastix before to register pre- and post-CT images in my previous research work. But now in this task there are two labelmap volume on the same CT image. As shown in Figure 1, the ellipsoid is labeled in yellow and the markers are labeled in green. And I don’t know where to put the two labelmap volume in Elastix. The GUI is presented in Figure 2.

 ![labelmap_ask3](https://us1.discourse-cdn.com/flex002/uploads/slicer/original/3X/7/6/76de081a3a0240fcbe5388f7b388a28e7df6669e.jpeg)  
Figure 1

 ![elastix_ask3](https://us1.discourse-cdn.com/flex002/uploads/slicer/original/3X/4/d/4d4c050560383ae56224f23178848133601e809e.png)  
Figure 2

Hope for some advice. Your help is highly appreciated.

Best regards,

Crayon

---

<div class="post-metadata">

**Author:** ![labixin](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/labixin/32/1965_2.png) [@labixin](https://discourse.slicer.org/u/labixin)\
**Post date:** [February 20, 2024, 8:42am UTC](https://discourse.slicer.org/t/registration-of-two-objects/34353/9 "2024-02-20T08:42:11Z")

</div>

Thanks for your time. I wonder if the algorithm still be effective when the fiducials are not paired correspondingly. I have placed 8 manual landmarks on markers (the geometric center). However, I could only randomIy choose 8 fiducials on the surface of the ellipsoid. That is, I could not ensure the exact correspondence of the two fiducial lists. Will the registration method still be effective?

Hope for your reply. Your help is highly appreciated.

Best regards,

Crayon

---

<div class="post-metadata">

**Author:** ![Matteboo](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/matteboo/32/66548_2.png) [@Matteboo](https://discourse.slicer.org/u/Matteboo)\
**Post date:** [February 20, 2024, 10:14am UTC](https://discourse.slicer.org/t/registration-of-two-objects/34353/10 "2024-02-20T10:14:16Z")

</div>

You need to convert the labelmap to a volume  
To do this you can use “Mask Scalar volume”  
From memory, you can put the labelmap as “input volume” and “Mask Volume”  
Then the output is the same that your labelisation but as a volume
