Load segment from matrix of integers

Hi all,

I have been exporting and importing segmentation masks as .stl files or other formats that describe the segmented volume as a surface mesh made of triangular elements.

I was wondering if it is possible to load segmentation masks described as a 3d matrix of ones and zeros, in which each element represents a voxel of the image volume (1 = included in the mask, 0 = not included).

Any help with this would be appreciated! Thanks!


I think this example does exactly what you asked: https://www.slicer.org/wiki/Documentation/Nightly/ScriptRepository#Create_a_segmentation_from_a_labelmap_volume_and_display_in_3D