Binary image from segmentation

Hi all,

I have a segmentation and I want to select some slices (planes) that I want to convert to 2D binary images (lets say the xy plane at z=0) for example.

I found the question asked here where the advice was to Export as LabelMap and save it as nrrd file but when I do so, i don’t see anything basically the labelMap is empty or it looks empty to me.

in a similar topic here the question "how to visualize the labelMap if we save it as a nrrd file was not answered

I would prefer using python to automate it but i wouldn’t mind using the GUI as well

can someone help with this issue please?

As mentioned in the thread you linked, Slicer doesn’t allow exporting 2D slices. The most you can do is to use tiff format instead of NRRD. in that case, this will be a multi-frame TIFF (that is a single file, with all the slices inside).

If you are going to do this selectively (i.e., only export a few selected Slicer), you can possibly use the Screencapture module to save what’s visible in the 2D viewers as PNG or JPG. But then you will lose geometry information.

Unless your segmentations/labelmaps fill a large portion of the volume, most of the resultant file will be empty (0s).