Asking for more mask save format

Hi all,

May i ask why does 3D slicer only support output the segmentation results as these 4: .seg.nrrd; .seg.nhdr; .nrrd; .nhdr.

Is it possible, without using plugins, to save the segmentation results separately into .nii.gz?

Best,

Harry

You could convert the segmentation to a labelmap, which is a type of volume node and so can be exported as nii.gz.

There are a number of threads on this. Some written by me… I would love a .seg.nii.gz. That would be recognized by Slicer as a segmentation similar to .seg.nrrd. Admin has his rationale. Best to write a pastabele script that converts to labelmap and then saves as nii.gz.

I see. Thanks for sharing. It works on my side. Now I can see extra 2 options:“mask” & “colorTable” when i save. :smiley:

May i ask what’s the reason? Currently it’s a bit tedious, especially for people unfamiliar with 3D slicer.

I need to go into “Segmentation”, select the correct segmentation, right click to “Export visible segments to binary labelmap”, click “save”, pick the right thing to save, and edit the file format to the right one.

While other tools, like ITK-SNAP, allows many direct output options, e.g. NiFTI.

Of course slicer can do more than ITK-SNAP functional-wise, but it’s kinda of confusing for why not implementing more output options.

My understanding NIFTI format has very little header (a few hundred bytes), and cannot accommodate all the metadata about the segments that is necessary to restore the segmentation accurate from the file.

They output labelmaps, not segmentation. If you are comfortable with labelmaps and do not want all the nice features a segmentation object provides (such as overlap, or restricting your segmentation to a specific segment etc), you are perfectly fine to save them as nii.gz, just right click choose export as labelmap, and then save nii.gz.You might even turn this into single action.

But you may want to read this first: Image Segmentation — 3D Slicer documentation

Hi Murat,

I see. I understand that it might be an issue with restoration, but I’m asking for a better UI design: as in, what if there is an export button allowing users to export mask into different format (which we can tell users that it might affect restoration)?

I’m raising this question here for discussion. What do you think?

I am not sure what more you are asking, it is a single right click to export a segmentation as a labelmap and another right click to save that labelmap as nii.gz. That’s already fairly simple. You can write a custom script to assign a custom keystroke if you want it to be even simpler (any AI can do it for you).

It is far more simple not to let people save precious data in a lossy format than, allow them but then explain that they may loose data. That’s probably why developers don’t support nii.gz as a save option.