As a newbie to Slicer Dev, I’m interested how view content is managed. We’re interested in having several standard views showing DICOM data but one view showing only some 3D models and other non-DICOM content.
Behind the scenes(!) how are different datasets and objects organised - at a high technical level?
We’re already working with @lassoan but it’s nice to have discussions in the public forums I think. Sorry if I’m clearly showing my ignorance here!
Hi John -
Welcome - we hope you find Slicer a good environment for your work - it’s powerful but it can be hard to learn all the features. Questions here are always welcome.
Regarding how data is organized, let me try a high level view and we can dig in the details as needed.
First, the MRML scene contains all the state that is saved and restored in a scene (e.g. a .mrb file, which under the hood is a .zip of all the serialized content and an xml-formatted .mrml scene file). The MRML scene consists of nodes, some of which are subclasses of vtkMRMLDisplayableNode, meaning they are meant to show up in a viewer. Each viewer has a unique ID (like ‘Red’ for the red slice view).
We have the concept of a DisplaybleManager which is responsible for mapping the data content of the DisplayableNodes to vtkActors/Mappers in particular Renderers (also mapping back from vtk widgets to changes in the nodes, e.g. for fiducials).
Each DisplayableNode has a list of DisplayNodes that hold the properties like color, transparency, etc. Each DisplayNode has a list of ViewNodeIDs which can be used to tell the DisplayableManager whether or not to show a particular DisplayableNode with a particuar set of DisplayNode properties.
This allows you to have, for example, one slice view with model outlines and another slice view with fiducial points. Or you can have a 3D view with volume rendering and another with surface models (or mix and match).
(Note there’s also a slightly different mechanism for handling foreground/background slice compositing in the slice views that relies on similar mechanisms).
Hope that helps,
I’d like to add that the slice views’ content is easiest to manage using the slice composite nodes. This is an example where all slices are set to show the same thing, but the idea is the same if you want to show different things, except that you need to get the slice composite node for the particular viewer using the slice widgets, like this.
3D visibility can be set as Steve described: turning on visibility for the display nodes, with the option to specify the actual view, like this.