After ImportModelToSegmentationNode some segments are cubical

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)
In general, it loads all stl in cycle and imports to segmentation:

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:


stl-files are same, I mean, if open all files in a slicer as model they are smooth.
2
If I convert them manually (model>segmentation node), segments are smooth too.

So… could someone help?

1 Like

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.

Thank you!
Problem was in that

1 Like