Unable to create LabelMaps for ModelMaker

Hello!

My team and I are currently working in a segmentation project, and have been actively using Slicer. However, we are currently facing some challenges and hope we can get some help from the community.

Specifically, we are trying to generate some vtk volumes from a .nii.gz storing the segmentations done by a DL models. This file contains integer values for each label. In order to generate the vtk model, we have decided to use the ModelMaker module.

Due to the big number of data we are dealing with, we’ve been using linux terminal to automatize the proccess. However, when doing so, models are not being generated. After debugging the process, we realized that our images are not being understood as LabelMaps and, therefore, ModelMaker can’t work with our images. To solve this issue, we have renamed our files as {name}_Label.nii.gz. Although this approach seems to work when using the user’s interface, models are yet not generated when working from terminal.

Is there a way we can transform our original volumes into labelmaps from linux terminal??

Maybe there is a simpler method to generate our models that we are missing out.

Thanks a lot for your help!!

You can use slicer.util.loadLabelVolume() to load as a label volume. If you are still having trouble you can post your exact script and the command line you execute to run it and we can probably give more targeted advice.