# Manually add seeds when using vtkSeedWidget?

**URL:** https://discourse.vtk.org/t/manually-add-seeds-when-using-vtkseedwidget/8979
**Category:** Support
**Created:** [July 20, 2022, 12:44pm UTC](https://discourse.vtk.org/t/manually-add-seeds-when-using-vtkseedwidget/8979 "2022-07-20T12:44:50Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![cmengich](https://discourse.vtk.org/letter_avatar_proxy/v4/letter/c/3be4f8/32.png) [@cmengich](https://discourse.vtk.org/u/cmengich)
#### Post date: [July 20, 2022, 12:44pm UTC](https://discourse.vtk.org/t/manually-add-seeds-when-using-vtkseedwidget/8979/1 "2022-07-20T12:44:51Z")

</div>

Hello,

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.  
Thanks.

---

<div class="post-metadata">

### Author: ![lassoan](https://discourse.vtk.org/user_avatar/discourse.vtk.org/lassoan/32/50_2.png) [@lassoan](https://discourse.vtk.org/u/lassoan)
#### Post date: [July 20, 2022, 10:56pm UTC](https://discourse.vtk.org/t/manually-add-seeds-when-using-vtkseedwidget/8979/2 "2022-07-20T22:56:37Z")

</div>

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.

---

<div class="post-metadata">

### Author: ![sankhesh](https://discourse.vtk.org/user_avatar/discourse.vtk.org/sankhesh/32/73_2.png) [@sankhesh](https://discourse.vtk.org/u/sankhesh)
#### Post date: [July 21, 2022, 3:55am UTC](https://discourse.vtk.org/t/manually-add-seeds-when-using-vtkseedwidget/8979/3 "2022-07-21T03:55:32Z")

</div>

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

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

```

---

<div class="post-metadata">

### Author: ![cmengich](https://discourse.vtk.org/letter_avatar_proxy/v4/letter/c/3be4f8/32.png) [@cmengich](https://discourse.vtk.org/u/cmengich)
#### Post date: [July 21, 2022, 7:23am UTC](https://discourse.vtk.org/t/manually-add-seeds-when-using-vtkseedwidget/8979/4 "2022-07-21T07:23:42Z")

</div>

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

@sankhesh Managed to implement that. Thank you.
