[vtkusers] Getting new points after spline fitting

Giridhar Murali funwithgiri at gmail.com
Tue Sep 18 18:59:01 EDT 2012


Hey all,

I am new to VTK, and I need a little help from y'all.

I basically have an ordered set of 3D points stored as vtkPoints. I
basically want to filter the outliers, and fit the inliers into a smooth
curve.
I haven't figured out how to filter the outliers. But, I am fitting the
curves to a kochanek spline and am able to see the output displayed in the
renderer.
But, I am not sure how to get the new set of points back as vtkPoints for
processing.

This is what I have.

                        vtkSmartPointer<vtkPoints> points =
vtkSmartPointer<vtkPoints>::New();

                         /* Do something and populate the points */

                        vtkSmartPointer<vtkParametricSpline> kochanekspline
= vtkSmartPointer<vtkParametricSpline>::New();
                        vtkSmartPointer<vtkKochanekSpline> kxSpline =
vtkSmartPointer<vtkKochanekSpline>::New();
vtkSmartPointer<vtkKochanekSpline> kySpline =
vtkSmartPointer<vtkKochanekSpline>::New();
vtkSmartPointer<vtkKochanekSpline> kzSpline =
vtkSmartPointer<vtkKochanekSpline>::New();
kochanekspline->SetPoints(points);

vtkSmartPointer<vtkParametricFunctionSource> functionSource1 =
vtkSmartPointer<vtkParametricFunctionSource>::New();
functionSource1->SetParametricFunction(kochanekspline);
functionSource1->Update();

splineMapper->SetInputConnection(functionSource1->GetOutputPort());

I would like to get the new spline fitted bunch of points back into
'points' or some other similar collection. Any idea how I should go about
it?

Thanks in advance.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20120918/a17b39a8/attachment.htm>


More information about the vtkusers mailing list