# After ImportModelToSegmentationNode some segments are cubical

**URL:** <https://discourse.slicer.org/t/after-importmodeltosegmentationnode-some-segments-are-cubical/29684>\
**Category:** Support\
**Tags:** segmentation, python\
**Created:** [May 27, 2023, 3:44am UTC](https://discourse.slicer.org/t/after-importmodeltosegmentationnode-some-segments-are-cubical/29684 "2023-05-27T03:44:41Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![xxxiNAIxxx](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/xxxinaixxx/32/66143_2.png) [@xxxiNAIxxx](https://discourse.slicer.org/u/xxxiNAIxxx)\
**Post date:** [May 27, 2023, 3:44am UTC](https://discourse.slicer.org/t/after-importmodeltosegmentationnode-some-segments-are-cubical/29684/1 "2023-05-27T03:44:41Z")

</div>

Hi.  
I have a few stl files and want to create one multilabel for monai train. I write python-script and it works ([gist:544be2f1ef2ad63a44fd38d43ab54760 · GitHub](https://gist.github.com/xxxiNAIxxx/544be2f1ef2ad63a44fd38d43ab54760))  
In general, it loads all stl in cycle and imports to segmentation:

```python
def load_avalible_labels(labels_stl_path, segmentationNode):
    for label in labels_stl_path:
        modelNode = slicer.modules.models.logic().AddModel(label)
        slicer.modules.segmentations.logic().ImportModelToSegmentationNode(modelNode, segmentationNode)
        slicer.mrmlScene.RemoveNode(modelNode)

```

then fill, save and so on…

But! Some segments are “cubical”, some are normal:

 ![1](https://us1.discourse-cdn.com/flex002/uploads/slicer/original/3X/3/a/3af60aa878bd6ea5faa383c33431806fd82df213.jpeg)  
stl-files are same, I mean, if open all files in a slicer as model they are smooth.  
 ![2](https://us1.discourse-cdn.com/flex002/uploads/slicer/original/3X/6/3/6375a27d99fbd1898d55794bc903bf8d9e873c78.png)  
If I convert them manually (model\>segmentation node), segments are smooth too.

So… could someone help?

---

<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:** [May 28, 2023, 12:16pm UTC](https://discourse.slicer.org/t/after-importmodeltosegmentationnode-some-segments-are-cubical/29684/2 "2023-05-28T12:16:05Z")

</div>

If you start editing a segmentation then its source (a.k.a. master) representation is changed to “binary labelmap”. A binary labelmap is made up of voxels that you can see when you zoom in. If you find the default resolution insufficient the you can [increase it](https://slicer.readthedocs.io/en/latest/user_guide/modules/segmenteditor.html#segmentation-is-not-accurate-enough).

---

<div class="post-metadata">

**Author:** ![xxxiNAIxxx](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/xxxinaixxx/32/66143_2.png) [@xxxiNAIxxx](https://discourse.slicer.org/u/xxxiNAIxxx)\
**Post date:** [May 29, 2023, 8:11pm UTC](https://discourse.slicer.org/t/after-importmodeltosegmentationnode-some-segments-are-cubical/29684/3 "2023-05-29T20:11:59Z")

</div>

Thank you!  
Problem was in that
