Segment not showing up on the segment editor

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?

Below is the script I used, which is based on this forum.

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")
1 Like

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

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

1 Like

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!