Displaying VTK actor in a slice view

I created an actor using polydata,but when I use right mouse to zoom image, the actor cannot follow image zoom. How can I do?
image
image

You need to add an observer to the slice node and update the actor position based on XYToRAS matrix.

However, I would not recommend this kind of low-level access, because it would require you to do lots of bookkeeping. It is much easier to put your polydata into a vtkMRMLNode and let Slicer do visualization, including all the zooming, panning, visibility, color, etc. in all the views.

You can use even higher level features: Regions are typically segmented using Segment Editor module. You can also draw contours by dropping markup fiducials on the viewer and connect them using MarkupsToModel extension. We’ll add contour widgets to Slicer core within a few months, which might be also usable for this.

1 Like