Exporting segmentations as seperate files

Hello folks,

I have delineated several organs / bones inside a filed, on Slicer3D they are shown as different segmentations, however I wanted to export each segmentation one by one.

Maybe there is already a solution, but I haven’t found a sophisticated way to conquer this task. Can anyone help me?

in Short:
Inside a project file: brain, liver, lung as segmentations

what I would like to have: save each segmentation as niftii

cheers

This is not a functionality that we would add to the user interface, you can easily implement it in Python.

I would recommend to perform this conversion as a preprocessing/normalization step of your data processing workflow. You can use this code snippet in any Python environment (not just in Slicer) to parse a segmentation (.seg.nrrd) file and extract one or more segments as numpy array, write to file, etc. Using this script allows you to archive your segmentation data with all metadata (segment names, DICOM terminology, display properties, etc. in a project-independent way) in seg.nrrd file and create training data for your network fully automatically, in any format you need for your specific project.

You can of course easily do the conversion in Slicer, too by exporting selected segment to labelmap volume and then saving the volume to file.