adding render actors to model node

Dear all,

I am new to slicer and I am having some issues creating model nodes. I have some code to render splines and surfaces which I render by creating mappers, actors and then adding the actors to render window. Is there a way how I can simply add those actors to a model node so I can access them from the data module?

I greatly appreciate any help.

Since Slicer can have multiple threeD view instances that should have the same mapping from model nodes to vtk actors/mappers/widgets we have a layer called displayable managers. This documentation is a bit old but it describes the basic operations. The API docs are here. Most of these are in C++ but there is also a scripted version.

1 Like

You can render a vtkPolyData by calling slicer.modules.models.logic().AddModel(polydata). See complete examples in the script repository.

1 Like