How to import a slicer segmentation into other tools like matlab?

Operating system: Mac OS
Slicer version: 4.8.1
Expected behavior: I saved my tumor segmentation as a nrrd file or seg.nrrd file and open them in other tools (MRIcron, matlab).


When I open the segmentation, I need to have a blank background to show the location of the tumor like:

Actual behavior: I found the location information was lost, the size of the matrix was the max diameter of the tumor, but without the blank background.

Segments are correctly positioned in physical space. By default, blank voxels are stripped to conserve memory (image origin is updated accordingly to ensure the correct position is maintained).

If you work with software that cannot take into account image origin, spacing, and axis directions and just rely on matching of voxel coordinates (or the software cannot handle overlapping segments stored in 4D volume), then you need to export the segmentation to a labelmap node:

  • Go to Segmentations module
  • In “Export/Import…” section click “Export” button
  • Save the newly created “Output node”

Note that mricron has fairly limited NRRD support, so you may be better off exporting as Nifti.