# STL models comparison

**URL:** <https://discourse.slicer.org/t/stl-models-comparison/11806>\
**Category:** Support\
**Tags:** registration, quantitative\
**Created:** [May 31, 2020, 3:03pm UTC](https://discourse.slicer.org/t/stl-models-comparison/11806 "2020-05-31T15:03:46Z")\
**Posts on this page:** 14\
**Page:** 1

<div class="post-metadata">

**Author:** ![danila](https://avatars.discourse-cdn.com/v4/letter/d/0ea827/32.png) [@danila](https://discourse.slicer.org/u/danila)\
**Post date:** [May 31, 2020, 3:03pm UTC](https://discourse.slicer.org/t/stl-models-comparison/11806/1 "2020-05-31T15:03:46Z")

</div>

Operating system: macOS Catalina v10.15  
Slicer version: 4.10.2  
Expected behavior: How to compare and analyse two STL models of the same patients at T1 and T2.  
Actual behavior: I have done a CBCT superimposition using a voxel based registration.

---

<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:** [June 1, 2020, 9:29am UTC](https://discourse.slicer.org/t/stl-models-comparison/11806/2 "2020-06-01T09:29:19Z")

</div>

First of all, I recommend using a recent preview version, because 4.10.2 is very old, and we’re approaching 5.0 so the previews are quite stable, and contain many improvements since 4.10.2.

I think to compare models, especially if you have the corresponding volumetric images (the T1 and T2 MRIs), the best is if you convert the models to segmentations, and use the Segment Comparison module. This is a generic answer to a generic question, so if you describe your needs in more detail, then we can help you better.

A few things that would help a lot:

- Where do these STLs coming from? If they are segmentations, then you could do the segmentations in Slicer where we have great tools now for that, so you don’t need to convert-export-import-convert (resulting in data loss)
- Are the data spatially registered? Do you need to register them after importing in Slicer?

---

<div class="post-metadata">

**Author:** ![danila](https://avatars.discourse-cdn.com/v4/letter/d/0ea827/32.png) [@danila](https://discourse.slicer.org/u/danila)\
**Post date:** [June 1, 2020, 10:15am UTC](https://discourse.slicer.org/t/stl-models-comparison/11806/3 "2020-06-01T10:15:32Z")

</div>

Thank you for your answer.

1. I converted two cone beam CTs from DICOM files to GIPL with ITK SNAP
2. I performed segmentation of the anterior skull base with ITK SNAP of scans T1 and T2
3. I loaded on 3D slicer: T1 scan, t2 scan, segmentation of the skull base of T1, segmentation of the skull base on T2. I then used the CMF Registration module and chose the Voxel (non growing registration) function. I set the options and applied by obtaining an Output Registered Seg and an Output Registered Scan.

At this point I would like to quantify through a colormap the changes obtained at the level of the maxillary bones. Do I have to proceed by segmenting my Output Registered Scan and then converting the segmentations into 3D surface models?

Also how can I spatially record stl files after importing them into slicer? Is there a tutorial?

Kind regards

> First of all, I recommend using a recent preview version, because 4.10.2 is very old, and we’re approaching 5.0 so the previews are quite stable, and contain many improvements since 4.10.2.
> 
> I think to compare models, especially if you have the corresponding volumetric images (the T1 and T2 MRIs), the best is if you convert the models to segmentations, and use the Segment Comparison module. This is a generic answer to a generic question, so if you describe your needs in more detail, then we can help you better.
> 
> A few things that would help a lot:
> 
> - Where do these STLs coming from? If they are segmentations, then you could do the segmentations in Slicer where we have great tools now for that, so you don’t need to convert-export-import-convert (resulting in data loss)
> - Are the data spatially registered? Do you need to register them after importing in Slicer?
> 
> –  
> _Previous Replies_  
> Operating system: macOS Catalina v10.15  
> Slicer version: 4.10.2  
> Expected behavior: How to compare and analyse two STL models of the same patients at T1 and T2.  
> Actual behavior: I have done a CBCT superimposition using a voxel based registration.
> 
> * * *
> 
> [Visit Topic](https://discourse.slicer.org/t/stl-models-comparison/11806/2) or reply to this email to respond.  
> To stop receiving emails about this topic, category, or all discussions, [click here to unsubscribe](https://discourse.slicer.org/email/unsubscribe/bfe6c64fbbd640aad0c0343588de34de86ff74c83768d146b559ef1e4337cbeb).

_ **PRIVACY:** In ottemperanza con il nuovo Regolamento Europeo GDPR n. 679/2016, le informazioni_  
_contenute in questo messaggio sono riservate. Il loro utilizzo è consentito esclusivamente al_  
_destinatario del messaggio, per le finalità indicate nel messaggio stesso. Qualora Lei non fosse la_  
_persona a cui il presente messaggio è destinato, La invitiamo ad eliminarlo dal Suo Sistema ed a_  
_distruggere le varie copie o stampe, dandocene gentilmente immediata comunicazione anche_  
_inviando un messaggio di ritorno all’indirizzo e-mail del mittente. Ogni utilizzo improprio è_  
_contrario ai principi del nuovo Regolamento Europeo GDPR n. 679/2016._  
_Si avvisa che il presente messaggio ed eventuali risposte potrebbero essere letti da soggetti_  
_appartenenti all’Amministrazione differente dal mittente._  
_L’Università degli Studi Magna Graecia di Catanzaro opera in conformità al nuovo Regolamento_  
_Europeo GDPR n. 679/2016. Per qualsiasi informazione a riguardo si prega di contattare l’indirizzo_  
_e-mail: [dirgen@unicz.it](mailto:dirgen@unicz.it)_

---

<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:** [June 1, 2020, 12:34pm UTC](https://discourse.slicer.org/t/stl-models-comparison/11806/4 "2020-06-01T12:34:51Z")

</div>

Thanks for the detailed explanation!

Your workflow seems to be more complicated than necessary, and in the process data may be lost. Conversion of DICOM to non-DICOM data incurs loss in data, most importantly (based on what I found about the format you use) the spatial information that is key. Also, the Segment Editor module offers more advanced tools and can provide higher accuracy than ITK-SNAP (we have put in immense efforts into this in the past few years), and can be used as an integrated workflow as it’s in Slicer. What I’d recommend instead:

1. Load your DICOM data in Slicer
2. Do the registration first. I recommend the SlicerElastix extension
3. Segment both images using Segment Editor
4. Evaluate the segmentations

There is no need to handle any STL file, nor do conversions. The segmentations infrastructure in Slicer will take care of this.  
I didn’t understand some of your questions, so let us know when you are at the last step and tell us how you want to do the comparison.

---

<div class="post-metadata">

**Author:** ![danila](https://avatars.discourse-cdn.com/v4/letter/d/0ea827/32.png) [@danila](https://discourse.slicer.org/u/danila)\
**Post date:** [June 2, 2020, 9:11am UTC](https://discourse.slicer.org/t/stl-models-comparison/11806/6 "2020-06-02T09:11:45Z")

</div>

I was probably not clear on explaining my problems.

My goal is to measure the linear and volumetric change of a jaw before and after an orthognathic surgery (therefore comparing the pre and post CBCT).

Following the tutorial I found on the DCBIA team website, I made the segmentation of the anterior skull base at t0 and t1 with the ITK-SNAP software.

![Screenshot 2020-06-01 at 10.17.19.png](https://mail.google.com/mail/u/0?ui=2&ik=97051730c2&attid=0.1&permmsgid=msg-a:r-3726477025870366709&th=17273d9276a2d85e&view=fimg&sz=s0-l75-ft&attbid=ANGjdJ8mTLURwpSBWdiuMxFDLjrB1l2vBSOTfASeLkykjL3NjDgTNq6QI_OeoYM6_4h2HWfvWcJBFF1gdaNug2lUxhChC3y1P15QqJI9GBQiXW7I5GIkg_QFMoRN23U&disp=emb&realattid=ii_kaxkc3wo0)

Then I do the landmarks approximation about the two scans with Slicer and subsequently the recording performed on voxel relating to the skull base (using: basaline scan - T1; basaline segmentation - segmentation of anterior skull base at T1; follow-up scan - T2landmarks; follow-up segmentation - segmentation of skull base at T2landmarks).

![Screenshot 2020-06-01 at 15.17.41.png](https://mail.google.com/mail/u/0?ui=2&ik=97051730c2&attid=0.2&permmsgid=msg-a:r-3726477025870366709&th=17273d9276a2d85e&view=fimg&sz=s0-l75-ft&attbid=ANGjdJ8XF6a3BGNi5j40A-FtMHtOS6yh6bj6qc4MqmoxoAKP0OFUGABdMAyRYRWMEsTWEGU1LNMkPOnogxAumc_eiDgIi-H_6eoVn8UWULBWaxKKftniFedYYHPYzOk&disp=emb&realattid=ii_kaxkgl061)

After the registration I have segmented the first mandible on the t1 scan and the second mandible on the t2 scan obtained from the voxel recording. Then I transformed the segmentations of the two mandible into 3D surface models. I uploaded the two models on Slicer and I apply the module “model to model distance”.

![Screenshot 2020-06-01 at 15.54.00.png](https://mail.google.com/mail/u/0?ui=2&ik=97051730c2&attid=0.3&permmsgid=msg-a:r-3726477025870366709&th=17273d9276a2d85e&view=fimg&sz=s0-l75-ft&attbid=ANGjdJ-COlouSwMjG-gfoj_bJ1IP9zrzhJmtc5XoOylZU_Es4qrU1kA5pFrI8qJ9L8uBSs0vhAojUusWDpJFbLDODZsKDlUHpkYqlfGdAyFyHaC0EVx8vwrefQLvCn0&disp=emb&realattid=ii_kaxkkufu2)

I use the module “Shape Analysis Viewer” to obtain a color map.

![Screenshot.png](https://mail.google.com/mail/u/0?ui=2&ik=97051730c2&attid=0.4&permmsgid=msg-a:r-3726477025870366709&th=17273d9276a2d85e&view=fimg&sz=s0-l75-ft&attbid=ANGjdJ9Nw4ZiRLYVjWcLBdmw899g-puwpaPwJ8-7mE8OOIjA9W-nFMyK1GzqW8oL44J9Mk65wfY8cQVUHByHXwS5QRMudGcIVGrIuZlHyx8L8C8XNFJaF1k5s81R7Fg&disp=emb&realattid=ii_kaxkmhef3)

Now I would like to take a statistic analysis about this, but I don’t know how I can do. Can you help me?

The flow that I have use is correct?

---

<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:** [June 2, 2020, 10:01am UTC](https://discourse.slicer.org/t/stl-models-comparison/11806/7 "2020-06-02T10:01:45Z")

</div>

I cannot see any images, only their empty frames. Is it only me?

---

<div class="post-metadata">

**Author:** ![pieper](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/pieper/32/8_2.png) [@pieper](https://discourse.slicer.org/u/pieper)\
**Post date:** [June 2, 2020, 11:19am UTC](https://discourse.slicer.org/t/stl-models-comparison/11806/8 "2020-06-02T11:19:15Z")

</div>

Right - I see just frames too.

---

<div class="post-metadata">

**Author:** ![danila](https://avatars.discourse-cdn.com/v4/letter/d/0ea827/32.png) [@danila](https://discourse.slicer.org/u/danila)\
**Post date:** [June 2, 2020, 12:15pm UTC](https://discourse.slicer.org/t/stl-models-comparison/11806/9 "2020-06-02T12:15:40Z")

</div>

Sorry for the mistake, below I written the whole tesxt with the imagines again.

My goal is to measure the linear and volumetric change of a jaw before and after an orthognathic surgery (therefore comparing the pre and post CBCT).

Following the tutorial I found on the DCBIA team website, I made the segmentation of the anterior skull base at t0 and t1 with the ITK-SNAP software.

 ![immagine 1](https://us1.discourse-cdn.com/flex002/uploads/slicer/original/3X/3/a/3aad3db73a45cd7102c0a680cc2a28f92a356af2.png)

Then I do the landmarks approximation about the two scans with Slicer and subsequently the recording performed on voxel relating to the skull base (using: basaline scan - T1; basaline segmentation - segmentation of anterior skull base at T1; follow-up scan - T2landmarks; follow-up segmentation - segmentation of skull base at T2landmarks).

 ![immagine 2](https://us1.discourse-cdn.com/flex002/uploads/slicer/original/3X/e/6/e6e2dd86a1c38f3217b6d4398fd2f053a11ba19f.jpeg)

After the registration I have segmented the first mandible on the t1 scan and the second mandible on the t2 scan obtained from the voxel recording. Then I transformed the segmentations of the two mandible into 3D surface models. I uploaded the two models on Slicer and I apply the module “model to model distance”.

 ![immagine 4](https://us1.discourse-cdn.com/flex002/uploads/slicer/original/3X/5/e/5e208f1dc2dd32060dd82b6f403f47ca380431cc.png)

I use the module “Shape Analysis Viewer” to obtain a color map.

 ![immagine 5](https://us1.discourse-cdn.com/flex002/uploads/slicer/original/3X/0/9/0966700bebbc214e1a13d7d9bb49ec5dfefbb5de.png)

Now I would like to take a statistic analysis about this, but I don’t know how I can do. Can you help me?

The flow that I have use is correct?

Thanks again for the support. Hoping that now you can view the images.

---

<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:** [June 2, 2020, 12:53pm UTC](https://discourse.slicer.org/t/stl-models-comparison/11806/10 "2020-06-02T12:53:08Z")

</div>

Thanks! At this point this is a question on how to get a histogram for a shape analysis, but I don’t have experience with that specific extension.

My recommendation, however, about using Slicer for segmentation still stands, because your fragmented workflow leaves more than necessary room for inaccuracies.

---

<div class="post-metadata">

**Author:** ![danila](https://avatars.discourse-cdn.com/v4/letter/d/0ea827/32.png) [@danila](https://discourse.slicer.org/u/danila)\
**Post date:** [June 2, 2020, 2:22pm UTC](https://discourse.slicer.org/t/stl-models-comparison/11806/11 "2020-06-02T14:22:44Z")

</div>

Thanks for the information.  
I have another questions, what kind of informations Can I obtain from the color map and how can I get them?

---

<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:** [June 2, 2020, 2:57pm UTC](https://discourse.slicer.org/t/stl-models-comparison/11806/12 "2020-06-02T14:57:01Z")

</div>

In broad terms, the workflow appears correct. But the devil is always in the detail. I also second that trying to do everything Slicer.

You can’t run statistics on a single specimen with two time points. If your goal is to show that after the surgery mandible is more ‘normal’ looking, you at least need a sample of normal mandibles to calculate that statistic.

With a single sample and two time points, the simplest is to highlight the differences as color maps, and interpret them in light of the surgery conducted.

---

<div class="post-metadata">

**Author:** ![danila](https://avatars.discourse-cdn.com/v4/letter/d/0ea827/32.png) [@danila](https://discourse.slicer.org/u/danila)\
**Post date:** [June 2, 2020, 4:26pm UTC](https://discourse.slicer.org/t/stl-models-comparison/11806/13 "2020-06-02T16:26:02Z")

</div>

Thanks for the answer.  
I have a single sample and two time points available, so I would like to obtain distance measurements in millimeter terms through the color map. How can I get them? could you explain to me how to set the correct range?

Thanks a lot

---

<div class="post-metadata">

**Author:** ![smrolfe](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/smrolfe/32/3659_2.png) [@smrolfe](https://discourse.slicer.org/u/smrolfe)\
**Post date:** [June 2, 2020, 4:40pm UTC](https://discourse.slicer.org/t/stl-models-comparison/11806/14 "2020-06-02T16:40:30Z")

</div>

The [ModelToModelDistance](https://www.slicer.org/wiki/Documentation/Nightly/Extensions/ModelToModelDistance) extension will compute a point by point Hausdorff distance between two models. The distance array can be visualized as a heat map on the output model.

---

<div class="post-metadata">

**Author:** ![danila](https://avatars.discourse-cdn.com/v4/letter/d/0ea827/32.png) [@danila](https://discourse.slicer.org/u/danila)\
**Post date:** [June 2, 2020, 5:58pm UTC](https://discourse.slicer.org/t/stl-models-comparison/11806/15 "2020-06-02T17:58:44Z")

</div>

I used modeltomodel, but what is the error that i do?

[![](https://img.youtube.com/vi/mjA7bDvBU3s/hqdefault.jpg "Modeltomodel") ](https://www.youtube.com/watch?v=mjA7bDvBU3s)
