How to import a labelmap directly for model generation?

Hello Slicer Community!
I’m a very new user, I’m interested in using the Model Maker module to generate a 3D mesh for a biomechanical finite element analysis. I have 5 materials and around 100 3D parts and they’re supposed to be sharing interfaces.

I currently have a series of 2D arrays (matlab or python) specifying material/part indexes (one array for each slice). I assume this is what’s called the label map.

Question 1: I’m having trouble figuring out how to import the label map data as I understand that it’s normally produced from the segmentation step (which was already done outside slicer in my case as I already have the label data). I’ve tried to search for the proper file format to import but was not successful.

Bonus Question 2: How would the model maker handle labels that only show up in 1 slice only? Does it ignore or will it throw an error?

Bonus Question 3: If the volumes are in contact how would the model maker handle shared interfaces? I need the mesh to be conforming (interface nodes between materials must be shared)

Thank you very much!

Slicer can understand DICOM and most research file formats, but I would recommend NRRD file format, as it is very simple and Slicer stores segmentation in this file format by default anyway.

You don’t need Model maker module anymore. If you load a surface mesh or labelmap into a segmentation node that you can get any representation out of it. See more details here: https://slicer.readthedocs.io/en/latest/user_guide/image_segmentation.html

SegmentMesher extension’s Cleaver2 mesher generates such multi-material meshes.

1 Like

Hello Andras,
Thank you very much for the answer!
Cleaver sounds like a good option, but from reading the documentation it seems that I can’t input more than 8 volumes? My geometry includes 5 materials but in the range of 50-100 or so parts/volumes.

Do you know if slicer offers an alternative for this sort of geometry?
Thank you!

There is no limitation on the number of volumes. Use SegmentMesher extension (which uses Cleaver2). Maybe you have found some old Cleaver extension documentation, but limitation of that is not applicable anymore.

1 Like

Hi Andras,
Thanks again for the clarification! I have downloaded SegmentMesher and plan to use it in the next few days on simplified datasets.

One question about the extension, I am correct in assuming that the label map should be labelled with the specific volume index I want? I can either label with volume index or material index (X materials, but X*10 volumes!)

And I checked the doc that specified a maximum limit, you are correct that it was old documentation (Slicer 4.3 to be exact.)

Thanks again!

Few ten volumes should not be a problem. Few hundred is not a problem for segmentations module, hopefully it is not an issue for the mesher either. Just try things and let us know if something does not work as expected.