Add vtkVectorText programmatically

I would like to engrave many text models onto a skin model, programmatically, based on a set of markup control point coordinates.

My current approach is to generate vtk.vtkVectorText models, set their location, and subtract the text and skin models. I have successfully loaded vtk model, but vtk.vtkVectorText doesn’t have a set center method (like some other vtk model types types) but rather position is set by a vtkActor. If I understand correctly, in Slicer vtkPolyDataActor and vtkPolyDataMapper are tied into Displayable Managers (Documentation/Nightly/Developers/DisplayableManagers - Slicer Wiki) but don’t see relevant methods to set position.

How can i set the position of a model vtkVectorText inside slicer, which would otherwise be controlled by vtkActor outside of the Slicer environment?

Did you look at this? New text engrave/emboss effect in Segment Editor

I have tried the effect but encountered the unclear text issue noted on the same discussion thread (I have not yet followed through with changing volume spacing to make the text clearer).

In terms of programmatic placement of position, the lines in the link below could then potentially be modified?

You could have a look at how the effect is implemented using VTK:

1 Like