Manually add seeds when using vtkSeedWidget?


When using the vtkSeedWidget, is there a method to manually add a seedpoint from within code?
I have gone through the documentation, and only find the GetSeed() & DeleteSeed() methods.

Is there any way to add a seedpoint with WorldPosition and/or DisplayPosition coordinates provided as an argument?

Any help would be much appreciated.

We wasted about $500k and 6-8 years trying to make vtkSeedWidget work in 3D Slicer, but it had so many API limitations/inconveniences like what you describe, performance bottlenecks (each handle was a separate VTK actor), overcomplicated state management (state is quite randomly split between widget and representation) and lacked so many basic features (synchronization of state across multiple views, proper label display, flexibly configurable mouse and keyboard actions, constraining placement on selected or all visible surfaces, etc) that we gave up on it and implemented VTK widgets almost from scratch and we could address all the limitations.

If you need to develop medical applications then I would recommend to not redevelop point list widgets from scratch but use “Markups” feature in 3D Slicer or have a look at what MITK can do. If you do generic engineering/scientific visualization then have a look at what ParaView can do. If you work in a different application domain then check out if there are VTK-based applications that have point list widget.

@cmengich You should be able to add seeds following the logic in vtkSeedWidget::AddPointAction. Specifically the following lines:

    int currentHandleNumber = rep->CreateHandle(e);
    vtkHandleWidget* currentHandle = self->CreateNewHandle();
    rep->SetSeedDisplayPosition(currentHandleNumber, e);
1 Like

@lassoan Thanks for the feedback. I understand what you mean, and will definitely look into it.

@sankhesh Managed to implement that. Thank you.