Activate/deactivate "show3d" in Segmentation Editor via command line

Hello !
I am trying to dispaly a segmentation in the 3D view using the python interactor but i cant find the command to activate/deactivate the equivalent of “show 3D” in segmentation Editor.
image

for now i’ve tried :
segmentation = slicer.util.getNode(‘TC4_RH_ctg_mask.nii.gz’)
segmentationDisplayNode = segmentation.GetDisplayNode()
segmentationDisplayNode.SetSliceIntersectionVisibility(True)
segmentationDisplayNode.SetVisibility(True)

but it does not change the 3d display of the segment.
Thanks in advance :slight_smile:

Nicolas

The missing ingredient is CreateClosedSurfaceRepresentation()

See Script repository — 3D Slicer documentation

Amazing thanks ! it works perfectely fine :slight_smile:
Nicolas