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

**URL:** <https://discourse.slicer.org/t/how-to-import-a-slicer-segmentation-into-other-tools-like-matlab/3958>\
**Category:** Support\
**Tags:** segmentation, matlab\
**Created:** [August 31, 2018, 4:23pm UTC](https://discourse.slicer.org/t/how-to-import-a-slicer-segmentation-into-other-tools-like-matlab/3958 "2018-08-31T16:23:56Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Chongran\_Sun](https://avatars.discourse-cdn.com/v4/letter/c/ee59a6/32.png) [@Chongran\_Sun](https://discourse.slicer.org/u/Chongran_Sun)\
**Post date:** [August 31, 2018, 4:23pm UTC](https://discourse.slicer.org/t/how-to-import-a-slicer-segmentation-into-other-tools-like-matlab/3958/1 "2018-08-31T16:23:56Z")

</div>

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).

 ![image](https://us1.discourse-cdn.com/flex002/uploads/slicer/original/3X/3/e/3ebbfa5dae1c51baac93c9e1c5bfddd941a34f4b.png)  
When I open the segmentation, I need to have a blank background to show the location of the tumor like:  
 ![image](https://us1.discourse-cdn.com/flex002/uploads/slicer/original/3X/5/8/5850bd050d1a2b3103e73df9c1dbbff3085f5d8d.png)  
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.  
 ![image](https://us1.discourse-cdn.com/flex002/uploads/slicer/original/3X/2/0/2011a912494fcb8b7fb142c4dea02dbee2fe3ff2.jpeg)

---

<div class="post-metadata">

**Author:** ![lassoan](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/lassoan/32/13_2.png) [@lassoan](https://discourse.slicer.org/u/lassoan)\
**Post date:** [August 31, 2018, 4:33pm UTC](https://discourse.slicer.org/t/how-to-import-a-slicer-segmentation-into-other-tools-like-matlab/3958/2 "2018-08-31T16:33:56Z")

</div>

> [@Chongran\_Sun](#):
>
> I found the location information was lost

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”

---

<div class="post-metadata">

**Author:** ![ihnorton](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/ihnorton/32/9_2.png) [@ihnorton](https://discourse.slicer.org/u/ihnorton)\
**Post date:** [August 31, 2018, 5:08pm UTC](https://discourse.slicer.org/t/how-to-import-a-slicer-segmentation-into-other-tools-like-matlab/3958/3 "2018-08-31T17:08:53Z")

</div>

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