# Segments imported as stl files failing to mask properly

**URL:** <https://discourse.slicer.org/t/segments-imported-as-stl-files-failing-to-mask-properly/5780>\
**Category:** Support\
**Created:** [February 14, 2019, 2:08pm UTC](https://discourse.slicer.org/t/segments-imported-as-stl-files-failing-to-mask-properly/5780 "2019-02-14T14:08:14Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![miniBin](https://avatars.discourse-cdn.com/v4/letter/m/e79b87/32.png) [@miniBin](https://discourse.slicer.org/u/miniBin)\
**Post date:** [February 14, 2019, 2:08pm UTC](https://discourse.slicer.org/t/segments-imported-as-stl-files-failing-to-mask-properly/5780/1 "2019-02-14T14:08:14Z")

</div>

Hello Slicer Community.

I imported an stl file and converted it to a segment as described in this forum: [Difficulty with editing new segments imported as stl files](https://discourse.slicer.org/t/difficulty-with-editing-new-segments-imported-as-stl-files/5756)

However when I try to mask a transform using this segment it does not work as expected.

Green segment (sharp edges) to use as mask:  
 ![one](https://us1.discourse-cdn.com/flex002/uploads/slicer/original/3X/c/7/c7d72b0a669a7b7aed663d24092e969d80c5f9eb.jpeg)

Masking result (pixelated and blocky and not desired):  
 ![two](https://us1.discourse-cdn.com/flex002/uploads/slicer/original/3X/3/2/320b692ddc0a8f87a58e8d05428f462f95f4ee3d.png)

Help would be appreciated and thank you for your support.

---

<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:** [February 14, 2019, 2:45pm UTC](https://discourse.slicer.org/t/segments-imported-as-stl-files-failing-to-mask-properly/5780/2 "2019-02-14T14:45:26Z")

</div>

Hi @miniBin - The pictures help, but it’s still hard to diagnose what’s going on. Could you post data and a short script that would allow people to reproduce the issue you are facing? I suspect that the underlying cause is related to interpolation of transforms.

---

<div class="post-metadata">

**Author:** ![miniBin](https://avatars.discourse-cdn.com/v4/letter/m/e79b87/32.png) [@miniBin](https://discourse.slicer.org/u/miniBin)\
**Post date:** [February 14, 2019, 2:53pm UTC](https://discourse.slicer.org/t/segments-imported-as-stl-files-failing-to-mask-properly/5780/3 "2019-02-14T14:53:00Z")

</div>

What is the best way to transfer the data? Also I apologize but I do not know how to create the script?

---

<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:** [February 14, 2019, 3:11pm UTC](https://discourse.slicer.org/t/segments-imported-as-stl-files-failing-to-mask-properly/5780/4 "2019-02-14T15:11:00Z")

</div>

You can use google drive / dropbox / onedrive etc to share the data.

By script I meant a python script, but if you aren’t using one, then a step-by-step description of what you are doing, what you expect to happen, and what happens instead. (Speaking from experience, the process of creating such a script often leads to the solution, but if not then it will help us help you).

---

<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:** [February 14, 2019, 3:25pm UTC](https://discourse.slicer.org/t/segments-imported-as-stl-files-failing-to-mask-properly/5780/5 "2019-02-14T15:25:48Z")

</div>

The issue is probably still the resolution. If you do masking, then it’s not just the mask that determines the result but also the original image, which stays the same resolution regardless what you do with the segmentation.

I’d suggest using Crop Volumes module to resample the image as well. If you turn off interpolation for the volume in the slice view (an icon next to the volume selector in the drop-down menu of the slice view), then you will see the actual resolution.

---

<div class="post-metadata">

**Author:** ![miniBin](https://avatars.discourse-cdn.com/v4/letter/m/e79b87/32.png) [@miniBin](https://discourse.slicer.org/u/miniBin)\
**Post date:** [February 14, 2019, 3:28pm UTC](https://discourse.slicer.org/t/segments-imported-as-stl-files-failing-to-mask-properly/5780/6 "2019-02-14T15:28:09Z")

</div>

@pieper: Thank you for your response.

Here is the google drive link: [https://drive.google.com/drive/folders/1ZM\_7Nf89sZSo\_d9\_NHUrV0OGbwfdmlzk?usp=sharing](https://drive.google.com/drive/folders/1ZM_7Nf89sZSo_d9_NHUrV0OGbwfdmlzk?usp=sharing)

I have provided all stls and transforms. Also there are two videos where I document step by step.

Thank you all for your continued effort and support.

@cpinter: I tried using crop volumes earlier and the problem still occurred. I can try to turn off interpolation. Is there no way to mask out this object then?

---

<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:** [February 19, 2019, 5:59pm UTC](https://discourse.slicer.org/t/segments-imported-as-stl-files-failing-to-mask-properly/5780/7 "2019-02-19T17:59:15Z")

</div>

Hi @miniBin - when I go to that link I get an empty folder that says “drop files here”. Are you sure it’s the right link?

Best,  
Steve

---

<div class="post-metadata">

**Author:** ![miniBin](https://avatars.discourse-cdn.com/v4/letter/m/e79b87/32.png) [@miniBin](https://discourse.slicer.org/u/miniBin)\
**Post date:** [February 19, 2019, 10:37pm UTC](https://discourse.slicer.org/t/segments-imported-as-stl-files-failing-to-mask-properly/5780/8 "2019-02-19T22:37:29Z")

</div>

My apologies, see if the link works now.
