# Segment not showing up on the segment editor

**URL:** <https://discourse.slicer.org/t/segment-not-showing-up-on-the-segment-editor/21885>\
**Category:** Development\
**Tags:** python\
**Created:** [February 10, 2022, 4:34am UTC](https://discourse.slicer.org/t/segment-not-showing-up-on-the-segment-editor/21885 "2022-02-10T04:34:51Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![hourglassnam](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/hourglassnam/32/11796_2.png) [@hourglassnam](https://discourse.slicer.org/u/hourglassnam)\
**Post date:** [February 10, 2022, 4:34am UTC](https://discourse.slicer.org/t/segment-not-showing-up-on-the-segment-editor/21885/1 "2022-02-10T04:34:51Z")

</div>

Hello~  
I have problems with the segmentation editor.  
Some of the segments disappear on the Segment Editor during the segmentation process.  
However, when I checked the Data list, all the segments were still there!  
And the segments eventually reappear when I reopen the file.  
It seems like the segments I created through python interactor are the ones with this problem.  
Can anybody explain why this might happen?

 ![image](https://us1.discourse-cdn.com/flex002/uploads/slicer/original/3X/e/a/eafaf580d63f0c9215e00c6325b6657daf1d7b2f.jpeg)

Below is the script I used, which is based on [this forum](https://discourse.slicer.org/t/loading-dicom-directory-into-scene-and-obtaining-master-volume-node/10837/2).

```python
s=getNode('vtkMRMLSegmentationNode1')
se=s.GetSegmentation()

#change name of existing segmentation
seg=se.GetSegment('Segment_1')
seg.SetColor([1.0,0.2,0.8])
seg.SetName("WG")

#create new segmentation with custom color
SegAL = slicer.vtkSegment()
SegAL.SetName("AL")
SegAL.SetColor([1.0,0.0,0.0])
se.AddSegment(SegAL,"AL")

```

---

<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:** [February 10, 2022, 8:31pm UTC](https://discourse.slicer.org/t/segment-not-showing-up-on-the-segment-editor/21885/2 "2022-02-10T20:31:47Z")

</div>

It works well for me in the latest Slicer Preview Release:

 ![image](https://us1.discourse-cdn.com/flex002/uploads/slicer/original/3X/a/d/adaefda65b51b82bfcfc25726088ed91ff644792.png)

Let us know if you run into any issues when using the latest Slicer Preview Release.

---

<div class="post-metadata">

**Author:** ![hourglassnam](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/hourglassnam/32/11796_2.png) [@hourglassnam](https://discourse.slicer.org/u/hourglassnam)\
**Post date:** [February 14, 2022, 9:09am UTC](https://discourse.slicer.org/t/segment-not-showing-up-on-the-segment-editor/21885/3 "2022-02-14T09:09:44Z")

</div>

Thank you so much for your reply!  
I have not yet tried the latest Slicer Release, but the same issue has not happened with other files!  
So I am assuming that there was something wrong with my tiff file.  
I will try the new Slicer release as soon as possible and see if the same issue happens again.  
Thank you again for checking the code!
