Change color box within 3D view

Hi,

The issue already been asked but still I’m trying to struggle with this.

The idea is to modify the color of the cube from 3D view when the view is created within SlicerCAT.
To solve this I need to understand how to get this cube as VTK or MRML object. Who is responsible for creating it?

For example I can see that vtkMRMLViewNode has BoxVisible attribute. To modify visibility one simply triggers this attribute:

viewNode = slicer.app.layoutManager().threeDWidget(0).mrmlViewNode()
viewNode.SetBoxVisible(1)

Can’t understand how it works… Who is observer or who manages it from VTK side?

All view content is displayed using displayable managers.

The purple box is displayed by vtkMRMLViewDisplayableManager. The color is hardcoded, so you need to add an API to change it. Probably the cleanest solution would be to add a BoxColor property to vtkMRMLViewNode.

1 Like

Thank you,

Completely forgot that such things are controlled by displayable managers.

The PR is ready