I want to export my segmentation to label map for deep learning. The deep learning tool requires every segmentation in the same label map file and I do need to keep all the label value for each segmentation the same across all the label map files I feed into the tool. However, I failed to find the information for the segmentation’s label value, nor did I find how to appoint a label value to a specific segmentation. Is there a built in function for that in 3d slicer?
This is a very common need and there are se erap ways to achieve it.
The most important is to use standard terminology for segments when you create the segmentation. If you use Auto3DSeg or TotalSegmentator then it is already done.
You can then either choose a color table when you export the segmentation (that maps terminology to label value); or use slicerio Python package to get segments as a numpy array from a .seg.nrrd file.