# Alter number of points which makes up VTK curve

**URL:** <https://discourse.slicer.org/t/alter-number-of-points-which-makes-up-vtk-curve/12273>\
**Category:** Development\
**Created:** [June 29, 2020, 3:54pm UTC](https://discourse.slicer.org/t/alter-number-of-points-which-makes-up-vtk-curve/12273 "2020-06-29T15:54:43Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![mjg](https://avatars.discourse-cdn.com/v4/letter/m/6de8d8/32.png) [@mjg](https://discourse.slicer.org/u/mjg)\
**Post date:** [June 29, 2020, 3:54pm UTC](https://discourse.slicer.org/t/alter-number-of-points-which-makes-up-vtk-curve/12273/1 "2020-06-29T15:54:43Z")

</div>

Hello,

Is there some way to take an existing Slicer VTK curve node, say it is defined by 4 initial points I have placed, and increase the number of points along the curve to be a number such as 100, such that the curve shape remains the same, but now there are 100 points defining the shape?

If there is no built-in VTK method for such functionalities, is there a method by which I could find the curve equation and then add points manually along the curve?

Thank you!

---

<div class="post-metadata">

**Author:** ![muratmaga](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/muratmaga/32/3622_2.png) [@muratmaga](https://discourse.slicer.org/u/muratmaga)\
**Post date:** [June 29, 2020, 4:15pm UTC](https://discourse.slicer.org/t/alter-number-of-points-which-makes-up-vtk-curve/12273/2 "2020-06-29T16:15:43Z")

</div>

Resample curves within the Markups tool does exactly that. Perhaps @smrolfe can point out to the specific code.

---

<div class="post-metadata">

**Author:** ![smrolfe](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/smrolfe/32/3659_2.png) [@smrolfe](https://discourse.slicer.org/u/smrolfe)\
**Post date:** [June 29, 2020, 5:00pm UTC](https://discourse.slicer.org/t/alter-number-of-points-which-makes-up-vtk-curve/12273/3 "2020-06-29T17:00:13Z")

</div>

Yes, you can find the code to do this, with the option to constrain to a surface,  
in the onApplyCurveResamplingPushButton call back here:

> <https://github.com/Slicer/Slicer/blob/c36f2d0a4e585c84f91546e3710cc9ef9444201b/Modules/Loadable/Markups/qSlicerMarkupsModuleWidget.cxx#L2571>

---

<div class="post-metadata">

**Author:** ![mjg](https://avatars.discourse-cdn.com/v4/letter/m/6de8d8/32.png) [@mjg](https://discourse.slicer.org/u/mjg)\
**Post date:** [June 29, 2020, 6:29pm UTC](https://discourse.slicer.org/t/alter-number-of-points-which-makes-up-vtk-curve/12273/6 "2020-06-29T18:29:59Z")

</div>

@muratmaga @smrolfe Thank you for the help!
