Display model in slice viewer

You can only see the intersection of the polydata with a slice, so the polydata has to be a 3D surface (theoretically it could be possible to have a 2D surface that is exactly aligned with the slice viewer, but in practice perfect alignment is often impossible to achieve).
Fortunately, the Markups to model module in SlicerIGT extension does extactly that. It has several options for generating closed surface from a set of markups. It can do simple convex hull or smoothed contour with various options for making it more robust or accurate.

Simple quasi-planar surface generation:

Smooth 3D surface generation:

To generate the contours from your own module, you just need to add a vtkMRMLMarkupsToModelNode in your scene and set up its inputs and outputs. At minimum, call SetAndObserveMarkupsNodeID and SetAndObserveModelNodeID. See all methods and options at:
https://github.com/SlicerIGT/SlicerIGT/blob/master/MarkupsToModel/MRML/vtkMRMLMarkupsToModelNode.h

2 Likes