# How to extract the points from vtkPoints with vtkLineWidget2?

**URL:** https://discourse.vtk.org/t/how-to-extract-the-points-from-vtkpoints-with-vtklinewidget2/3449
**Category:** Support
**Created:** [June 2, 2020, 9:59am UTC](https://discourse.vtk.org/t/how-to-extract-the-points-from-vtkpoints-with-vtklinewidget2/3449 "2020-06-02T09:59:37Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![Kim\_William](https://discourse.vtk.org/user_avatar/discourse.vtk.org/kim_william/32/373_2.png) [@Kim\_William](https://discourse.vtk.org/u/Kim_William)
#### Post date: [June 2, 2020, 9:59am UTC](https://discourse.vtk.org/t/how-to-extract-the-points-from-vtkpoints-with-vtklinewidget2/3449/1 "2020-06-02T09:59:38Z")

</div>

Hi all 🙂

I am using vtkLineWidget2 attached to vtkRenderWindow.  
 ![pcd](https://discourse.vtk.org/uploads/default/original/2X/3/3f40e5f2de3929ae82cc0dd0b53c31f6e44f5517.png)

Is it possible to extract the points near(or along the vtkLineWidget2) the vtkLineWidget2?

I would like to render the profile to the vtkChartXY by using the extract points.

Now, I have a problem with the algorithm that extracts the points, so it doesn’t work well.

 ![plot](https://discourse.vtk.org/uploads/default/original/2X/b/baf618aca1d8795d2ea7f9c9bc8faea67b60a426.png)

Could you please advise me?

Thank you !

---

<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: [June 2, 2020, 7:36pm UTC](https://discourse.vtk.org/t/how-to-extract-the-points-from-vtkpoints-with-vtklinewidget2/3449/2 "2020-06-02T19:36:49Z")

</div>

You can sample an image along a line using [vtkProbeFilter](https://vtk.org/doc/nightly/html/classvtkProbeFilter.html).
