In the latest preview and stable release, it is now possible to apply clipping to the visualization of models, segmentations, and volume rendering using slice view planes or markup planes or ROI boxes.
Clipping options can be accessed in the Clipping section of the models, segmentations, or volume rendering sections of the markups modules:
Multiple clipping functions can be combined by specifying Markups Plane/ROI nodes, Slice nodes, or other clipping nodes as inputs. Each clipping function can be inverted or enabled/disabled individually.
Models and Segmentations
The clipping widget also contains options for visualizing end caps when clipping model and segmentation nodes.
This feature can be enabled/disabled using the “Cap visibility” option, as well as the opacity of the capped area. The outline around the clipped regions can also be visualized by enabling the “Outline visibility” option.
Volume Rendering
When applying clipping to volume rendering visualizations, it is also possible to specify a blur effect to the edges of the clipped region in order to reduce hash artifacts caused by binary masking of the volume.
For Developers
The new clipping visualization options can be controlled through the Slicer API:
modelNode = getNode("Model")
planeNode = getNode("P")
clipNode = slicer.mrmlScene.AddNewNodeByClass("vtkMRMLClipNode") # Add clip node
clipNode.AddAndObserveClippingNodeID(planeNode.GetID()) # Assign clip function(s)
clipNode.SetClippingNodeState(planeNode, slicer.vtkMRMLClipNode.ClipNegativeSpace) # Set inside/outside
modelDisplayNode = modelNode.GetDisplayNode()
modelDisplayNode.SetAndObserveClipNodeID(clipNode.GetID()) # Attach clip node to a display node. Can be used in multiple display nodes.
modelDisplayNode.ClippingOn() # Enable clipping
modelDisplayNode.ClippingCapSurfaceOn() # Enable end-capping visualization
modelDisplayNode.ClippingOutlineOn() # Enable end-capping outline
The input to the clipping node can be any sort of vtkMRMLTransformableNode that implements the GetImplicitFunctionWorld() function. Currently this includes vtkMRMLMarkupsPlaneNode, vtkMRMLMarkupsROINode, vtkMRMLSliceNode, vtkMRMLClipNode, and vtkMRMLModelNode (though performance is poor for model nodes).
Acknowledgements
Development was funded in part by a Children’s Hospital of Philadelphia (CHOP) Cardiac Center Innovation Grant, a CHOP Cardiac Center Research Grant, a CHOP Frontier Grant, NIH R01 HL153166 and T32GM008562.