# Edit existing segmentation

**URL:** <https://discourse.slicer.org/t/edit-existing-segmentation/6917>\
**Category:** Support\
**Tags:** segmentation\
**Created:** [May 24, 2019, 10:05am UTC](https://discourse.slicer.org/t/edit-existing-segmentation/6917 "2019-05-24T10:05:32Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![Christineseven](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/christineseven/32/3819_2.png) [@Christineseven](https://discourse.slicer.org/u/Christineseven)\
**Post date:** [May 24, 2019, 10:05am UTC](https://discourse.slicer.org/t/edit-existing-segmentation/6917/1 "2019-05-24T10:05:32Z")

</div>

Hello. I would like to ask, in image segmentation, when we have already the predicted mask and we want to correct it.What is the way to remove parts of the mask or add some parts(painting) to the already masks? without paint them from the start,but use the predicted.So just work on the mask with add painting and deleting. Thanks!

---

<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:** [May 24, 2019, 1:38pm UTC](https://discourse.slicer.org/t/edit-existing-segmentation/6917/2 "2019-05-24T13:38:41Z")

</div>

You can use [Segment editor module](https://slicer.readthedocs.io/en/latest/user_guide/module_segmenteditor.html) for this. See tutorials [here](https://www.slicer.org/wiki/Documentation/Nightly/Training#Segmentation).

---

<div class="post-metadata">

**Author:** ![Christineseven](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/christineseven/32/3819_2.png) [@Christineseven](https://discourse.slicer.org/u/Christineseven)\
**Post date:** [May 24, 2019, 1:53pm UTC](https://discourse.slicer.org/t/edit-existing-segmentation/6917/3 "2019-05-24T13:53:44Z")

</div>

Thank you very much for your time:) I mean that we have an MRI image like this ![image](https://us1.discourse-cdn.com/flex002/uploads/slicer/original/3X/e/d/ed80aa5eda828a64e059efa406e5f162d8e97a6f.png)  
(this is a polysistic kydney)  
and the mask for the kydney, that our model has predicted. Now we want to open them in slicer and edit this mask(just cutting and adding parts to the mask to make it fit better) and retrain our model. But when I use the Segment editor module does not work in this mask! We can paint…but we dont want to paint the whole kydney everywhere to define the mask we want.Also we can erase where we painted, but not in the existed mask for the kydney that we have!!we can erase only if we draw somewhere! We want it to add for example some edges in the mask in some slices where needed,or remove!

---

<div class="post-metadata">

**Author:** ![Christineseven](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/christineseven/32/3819_2.png) [@Christineseven](https://discourse.slicer.org/u/Christineseven)\
**Post date:** [May 24, 2019, 2:15pm UTC](https://discourse.slicer.org/t/edit-existing-segmentation/6917/4 "2019-05-24T14:15:17Z")

</div>

so, is there a way to load the predicted masks as “masks” and not just series of slices, so that the slicer recognize that they are masks and let us modify them (in the way that it would let us if we have made the mask manualy in slicer)? The files are dicom.

---

<div class="post-metadata">

**Author:** ![cpinter](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/cpinter/32/7995_2.png) [@cpinter](https://discourse.slicer.org/u/cpinter)\
**Post date:** [May 24, 2019, 2:59pm UTC](https://discourse.slicer.org/t/edit-existing-segmentation/6917/5 "2019-05-24T14:59:26Z")

</div>

Segment Editor can edit data that has the type “segmentation” in Slicer. If you load a mask, then it’s most probably a volume node. First, you need to make sure it’s a labelmap. In the loading screen if you open the options part, there will be a checkbox for loading it as labelmap. Alternatively you can convert it to labelmap in the Volumes module. Then you need to import the labelmap as a segmentation. Right-click the labelmap in the Data module and choose “Convert labelmap to segmentation node”. Then if you go the Segment Editor you can edit it, but first you need to select the MRI as Master volume.

Is this data is 3D? The image you pasted above seems strange to me.

---

<div class="post-metadata">

**Author:** ![Christineseven](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/christineseven/32/3819_2.png) [@Christineseven](https://discourse.slicer.org/u/Christineseven)\
**Post date:** [May 28, 2019, 7:46am UTC](https://discourse.slicer.org/t/edit-existing-segmentation/6917/6 "2019-05-28T07:46:16Z")

</div>

Thank you for your time!!! I solved it like this, I uploaded the mask and the series(image MRI) and the problem was that it didnt recognize mask so I could not modify it. So these was the steps if someone is interested too  
load serie-load mask  
-go to volumes

- select mask
- convert to scalar volume
- go to editor and put master volume : series, merge volume : mask
- edit selected label mask
- apply while you are modifying  
-save mask

---

<div class="post-metadata">

**Author:** ![JoostJM](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/joostjm/32/1091_2.png) [@JoostJM](https://discourse.slicer.org/u/JoostJM)\
**Post date:** [May 28, 2019, 10:35am UTC](https://discourse.slicer.org/t/edit-existing-segmentation/6917/7 "2019-05-28T10:35:39Z")

</div>

@Christineseven,

If you have to do this for many patients, you can optionally also check out CaseIterator (in the extension manager under “utility”). I wrote this module to easily review a batch of cases, including reviewing (i.e. loading, adapting and saving under a new name) of segmentations. It automatically handles the conversion from labelmap to segmentation, and links it to you image (sets the mastervolume node).

If you have questions on how to use it, I’d be happy to help.

---

<div class="post-metadata">

**Author:** ![Tamires\_Zanao](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/tamires_zanao/32/10306_2.png) [@Tamires\_Zanao](https://discourse.slicer.org/u/Tamires_Zanao)\
**Post date:** [June 30, 2021, 12:31pm UTC](https://discourse.slicer.org/t/edit-existing-segmentation/6917/10 "2021-06-30T12:31:21Z")

</div>

Hi! I followed your instructions and could properly edit the mask, but how should I save it in order to use it as a mask? I tried saving the segmentation (in nifti and in nrrd), but it was probably in the wrong “format”. I couldn’t use it for freesurfer. Thanks a lot!

---

<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:** [July 2, 2021, 5:10am UTC](https://discourse.slicer.org/t/edit-existing-segmentation/6917/11 "2021-07-02T05:10:52Z")

</div>

This last question was also posted and got answered here:

> [@How to save brain structural edited masks (segment edited) in nifti for freesurfer use?](https://discourse.slicer.org/t/how-to-save-brain-structural-edited-masks-segment-edited-in-nifti-for-freesurfer-use/18429):
>
> Hi! I automatically generated structural brain masks with the purpose of using FreeSurfer. The masks need some editing, and I used Slicer Segment Editor for it (opened mask as label \> imported labelmap as segmentation \> add T1 as master volume \> edited masks). However, I couldn’t save it as a nifti, so I saved as nrrd and later converted it to nifti. It didn’t work. How can I save my edited mask (in nifti) in order to use them for freesurfer? Do I have to convert the labelmap in something else? …
