How to set Closed Surface representation as default segmentation for RTSTRUCT?

I am using the SlicerRT extension to view RTSTRUCT contours in 3D Slicer, and I’m finding the Closed Surface representation to be more useful than Planar Contour. How do I set Closed Surface as the default representation when importing contours into Slicer?

Also, what are useful Python scripts for changing the default slice fill and 3D view opacities in the segmentations module?

Thanks!

Closed surface representation is indeed useful for visualization, therefore it is automatically computed. You can change the source representation to closed surface by clicking on “Make source” button in Segmentations module, but it would just unnecessarily change the loaded data.

In theory, something like this should work:

defaultSegmentationDisplayNode = slicer.vtkMRMLSegmentationDisplayNode()
defaultSegmentationDisplayNode.SetOpacity2DFill(0.1)
slicer.mrmlScene.AddDefaultNode(defaultSegmentationDisplayNode)

Unfortunately, SlicerRT’s DICOM importer does not use information in the default display node (it instantiates the display node directly instead of creating via the scene). Please submit a bug report to GitHub - SlicerRt/SlicerRT: Open-source toolkit for radiation therapy research, an extension of 3D Slicer. Features include DICOM-RT import/export, dose volume histogram, dose accumulation, external beam planning (TPS), structure comparison and morphology, isodose line/surface generation, etc.

Until it is fixed, you can add an observer to the scene so that you get notification when a new node is added and if a segmentation display node gets created then you can adjust its properties.