# I want to modify the nrrd file with the segmented Labelmaps

**URL:** <https://discourse.slicer.org/t/i-want-to-modify-the-nrrd-file-with-the-segmented-labelmaps/8079>\
**Category:** Support\
**Created:** [August 19, 2019, 1:50am UTC](https://discourse.slicer.org/t/i-want-to-modify-the-nrrd-file-with-the-segmented-labelmaps/8079 "2019-08-19T01:50:47Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![kscript](https://avatars.discourse-cdn.com/v4/letter/k/ec9cab/32.png) [@kscript](https://discourse.slicer.org/u/kscript)\
**Post date:** [August 19, 2019, 1:50am UTC](https://discourse.slicer.org/t/i-want-to-modify-the-nrrd-file-with-the-segmented-labelmaps/8079/1 "2019-08-19T01:50:47Z")

</div>

I want to save the segmented Labelmpas as nrrd and open this file again to add, delete or smooth the Labelmap.

I tried opening the saved nrrd file but couldn’t find the function I wanted.

Doesn’t the 3D Slicer provide that feature?

---

<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 19, 2019, 2:30am UTC](https://discourse.slicer.org/t/i-want-to-modify-the-nrrd-file-with-the-segmented-labelmaps/8079/2 "2019-08-19T02:30:15Z")

</div>

By default, Slicer saves segmentation as a 4D nrrd file that you can reload and continue to edit. Is this not what you would need?

If you need a 3D (merged) labelmap then you need to export the segmentation to a labelmap before saving it. When you load the merged labelmap, make sure to select “Labelmap” option in “Add data” and import it into segmentation for editing.

---

<div class="post-metadata">

**Author:** ![kscript](https://avatars.discourse-cdn.com/v4/letter/k/ec9cab/32.png) [@kscript](https://discourse.slicer.org/u/kscript)\
**Post date:** [August 19, 2019, 2:48am UTC](https://discourse.slicer.org/t/i-want-to-modify-the-nrrd-file-with-the-segmented-labelmaps/8079/3 "2019-08-19T02:48:43Z")

</div>

4D labelmaps are not available because I don’t know how to open them using vtk. But I decided to save the seg.nrrd file, reload it, modify it, and save it as an nrrd file using the method you mentioned.

---

<div class="post-metadata">

**Author:** ![aldoSanchez](https://avatars.discourse-cdn.com/v4/letter/a/5f9b8f/32.png) [@aldoSanchez](https://discourse.slicer.org/u/aldoSanchez)\
**Post date:** [December 16, 2020, 5:39pm UTC](https://discourse.slicer.org/t/i-want-to-modify-the-nrrd-file-with-the-segmented-labelmaps/8079/4 "2020-12-16T17:39:23Z")

</div>

how can I do this by code, I don’t find some code for labelmap
