How to produce multi channel output #1746
Replies: 2 comments 2 replies
-
Yes, sure. NRRD - the file format that 3D Slicer uses for storing segmentation supports overlapping labels. If you save the results in this format then Slicer will load them correctly. You can also specify segment names, colors, standard terminology, etc. See specification of the file format here: https://slicer.readthedocs.io/en/latest/developer_guide/modules/segmentations.html#segmentation-labelmap-file-format-seg-nrrd You can use slicerio Python package to conveniently read/write NRRD files with additional segmentation metadata. |
Beta Was this translation helpful? Give feedback.
-
Hi @RuoyanMeng, As @lassoan suggested, you can use the NRRD file format to store the prediction. To do that, you may need to add a custom post-transform here. Creating a custom transform isn't difficult. Here are some examples: https://github.com/Project-MONAI/MONAILabel/blob/e31eaee03b4a3e480532de0e01a1d96feef799e1/sample-apps/radiology/lib/transforms/transforms.py Hope this helps, |
Beta Was this translation helpful? Give feedback.
-
Hi, I am working on liver segmentation (liver, tumor and vessel), and tried to use monai label and 3D Slicer as a tool for annotation and active learning. I introduced my own model following the instruction.
However, my model predicts 3 classes, and the resulting labels overlap with each other, so they need to be stored separately. For now, I managed to run inference successfully with one label extracted. I wonder if there is a way to return a 3-channel image with all 3 labels non-overlapped. Thank you so much!
Beta Was this translation helpful? Give feedback.
All reactions