How to check and custmize label value of the segmentation?

Hi everyone,

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?

Thanks!

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.

1 Like

Thank you very much, Lassoan.

I have adopted color table as you suggested. However, how do I know exactly which label is mapped to each segmentation.


You see in my training, I need to specify each segmentation’s label value in the nrrd file. Do you know where can I check this?

Thanks!