# Segmentation Mask not overlayed on top of the original data

**URL:** <https://discourse.slicer.org/t/segmentation-mask-not-overlayed-on-top-of-the-original-data/18733>\
**Category:** Support\
**Tags:** segmentation\
**Created:** [July 14, 2021, 4:09pm UTC](https://discourse.slicer.org/t/segmentation-mask-not-overlayed-on-top-of-the-original-data/18733 "2021-07-14T16:09:17Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![ZakiaKhatun](https://avatars.discourse-cdn.com/v4/letter/z/df705f/32.png) [@ZakiaKhatun](https://discourse.slicer.org/u/ZakiaKhatun)\
**Post date:** [July 14, 2021, 4:09pm UTC](https://discourse.slicer.org/t/segmentation-mask-not-overlayed-on-top-of-the-original-data/18733/1 "2021-07-14T16:09:17Z")

</div>

Hello everyone,  
I have a CT scan of the knee and an STL file (as segmentation mask) separately. When I load the STL file, it does not overlay on top of my CT data. From the image below, you can see that the 3D object in yellow color (knee segmentation) is not on top of the CT.  
Could you kindly tell me how to see the segmentation on top of the original CT data (somewhat similar shown in the attached expected image)? Thank you!

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

 ![Expectation.PNG](https://us1.discourse-cdn.com/flex002/uploads/slicer/original/3X/2/2/22d1676a23c1c715c8acb765e879e2580b01807f.jpeg)

---

<div class="post-metadata">

**Author:** ![ZakiaKhatun](https://avatars.discourse-cdn.com/v4/letter/z/df705f/32.png) [@ZakiaKhatun](https://discourse.slicer.org/u/ZakiaKhatun)\
**Post date:** [July 15, 2021, 7:59am UTC](https://discourse.slicer.org/t/segmentation-mask-not-overlayed-on-top-of-the-original-data/18733/2 "2021-07-15T07:59:41Z")

</div>

Additional Info: If it helps you to know, the first image (showing the STL file not aligned with the original data), this STL file was generated using other software (probably using the ‘Materialise Mimics’).  
In the 3D slicer, when I load it, the STL file does not overlap with the CT data. Any idea?

---

<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:** [July 15, 2021, 12:39pm UTC](https://discourse.slicer.org/t/segmentation-mask-not-overlayed-on-top-of-the-original-data/18733/3 "2021-07-15T12:39:04Z")

</div>

As discussed many times on this forum, the STL format has many shortcomings that lead to exactly this kind of ambiguity (it doesn’t encode the units or reference coordinate system in the file for example). That leaves you with the task of tracking down exactly which software was used to create the files and what assumptions were made. If that’s not convenient or possible your other option is to make guesses and change transform parameters until the data appears to line up as you expect.

---

<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:** [July 15, 2021, 4:55pm UTC](https://discourse.slicer.org/t/segmentation-mask-not-overlayed-on-top-of-the-original-data/18733/4 "2021-07-15T16:55:54Z")

</div>

One possibility is RAS/LPS coordinate system difference. You can try to load the STL file with setting coordinate system to RAS and LPS to see if that fixes the issue:

 ![image](https://us1.discourse-cdn.com/flex002/uploads/slicer/original/3X/f/b/fbb2ffa0641e5d4885f97d26096586d2e4c63dec.png)

---

<div class="post-metadata">

**Author:** ![ZakiaKhatun](https://avatars.discourse-cdn.com/v4/letter/z/df705f/32.png) [@ZakiaKhatun](https://discourse.slicer.org/u/ZakiaKhatun)\
**Post date:** [July 15, 2021, 6:15pm UTC](https://discourse.slicer.org/t/segmentation-mask-not-overlayed-on-top-of-the-original-data/18733/5 "2021-07-15T18:15:50Z")

</div>

Thank you very much for your answer. Yes, manual transformation is a choice I can think of.

---

<div class="post-metadata">

**Author:** ![ZakiaKhatun](https://avatars.discourse-cdn.com/v4/letter/z/df705f/32.png) [@ZakiaKhatun](https://discourse.slicer.org/u/ZakiaKhatun)\
**Post date:** [July 15, 2021, 6:18pm UTC](https://discourse.slicer.org/t/segmentation-mask-not-overlayed-on-top-of-the-original-data/18733/6 "2021-07-15T18:18:10Z")

</div>

Dear Andras Lasso,  
Thank you very much for responding. I have tried both but did not resolve my case. The STL file I am using was generated using “Materialise Mimics” software. But thanks!

---

<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:** [July 15, 2021, 6:22pm UTC](https://discourse.slicer.org/t/segmentation-mask-not-overlayed-on-top-of-the-original-data/18733/7 "2021-07-15T18:22:39Z")

</div>

Did you load the original DICOM image into Slicer or the one that you processed in Mimics?  
In Mimics you may have centered/reoriented the volume so the image is not aligned with the original image anymore. Probably the best is if you save the image again in Mimics and load that into Slicer.

---

<div class="post-metadata">

**Author:** ![ZakiaKhatun](https://avatars.discourse-cdn.com/v4/letter/z/df705f/32.png) [@ZakiaKhatun](https://discourse.slicer.org/u/ZakiaKhatun)\
**Post date:** [July 15, 2021, 6:25pm UTC](https://discourse.slicer.org/t/segmentation-mask-not-overlayed-on-top-of-the-original-data/18733/8 "2021-07-15T18:25:41Z")

</div>

Yes. At first I loaded my original DICOM data, then I chose “Add data” to add the STL file and it appears exactly like the first image I attached to my post.

---

<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:** [July 15, 2021, 7:28pm UTC](https://discourse.slicer.org/t/segmentation-mask-not-overlayed-on-top-of-the-original-data/18733/9 "2021-07-15T19:28:04Z")

</div>

Most likely Mimics moved the image (it is not in the original DICOM coordinate system anymore). Therefore, you need to export the image from Mimics (preferably in NRRD, MHA, or maybe DICOM format) and use that along with the exported segmentation.

Note that Slicer has many more and more sophisticated segmentation tools than Mimics, so you may consider doing the segmentation in Slicer. See [this page](https://slicer.readthedocs.io/en/latest/user_guide/image_segmentation.html) to get started.
