Creating a new segmentation and applying works as expected (it remains visible), but if you type in the python console:
slicer.modules.segmenteditor.createNewWidgetRepresentation()
then, creating a new segmentation and applying, will cause the “Slice fill” and “Slice outline” to be set to zero (settings in the Segmentation module advanced area).
So, the steps to reproduce are (using Slicer latest stable release 4.11.20210226 revision 29738 built 2021-03-01):
- Load any 2D image
- Go to the Data module, right click the image node and select “Segment this…”
- Add a segment, click the Threshold effect and apply. It will work as expected
- Go to the Data module and delete the segmentation node
- In the python console type: slicer.modules.segmenteditor.createNewWidgetRepresentation()
- Right click the image node and select “Segment this…”
- Add a segment, click the Threshold effect and apply. The segmentation will be invisible. You can then check the segmentation advanced settings to notice that “Slice fill” and “Slice outline” are set to zero