[vtkusers] vtkPointInterpolator2D not interpolating
kenichiro yoshimi
rccm.kyoshimi at gmail.com
Tue Feb 27 19:41:23 EST 2018
Hello,
I translated the linked python into C++, however I can't replicate the
issue. Could you confirm the same problem occurs with my attached C++?
Regards
2018-02-25 22:02 GMT+09:00 gde23 <gdeee at web.de>:
> Hello,
>
> i am trying to interpolate the z-value of points which are stored as P(x, y,
> z) values in the format of vtkPolyData using VTK8.1.0 in c++.
>
> Therefore i translated following example
> <https://www.vtk.org/gitweb?p=VTK.git;a=blob;f=Filters/Points/Testing/Python/TestPointInterpolator2D2.py>
> from pyhton to c++ (i haven't tested it using python)
>
> vtkNew<vtkDEMReader> demReader;
> demReader->SetFileName("/home/path/to/data/Data/SainteHelens.dem");
> demReader->Update();
>
> double bds[6];
> demReader->GetOutput()->GetBounds(bds);
>
> // Create a plane of onto which to map the elevation data
> vtkNew<vtkPlaneSource> plane;
> plane->SetResolution(200, 200);
> plane->SetOrigin(bds[0],bds[2],bds[4]);
> plane->SetPoint1(bds[1],bds[2],bds[4]);
> plane->SetPoint2(bds[0],bds[3],bds[4]);
> plane->Update();
>
> // # Gaussian
> kernel-------------------------------------------------------
> vtkNew<vtkGaussianKernel> gaussianKernel;
> gaussianKernel->SetSharpness(2);
> gaussianKernel->SetRadius(200);
>
> vtkNew<vtkPointInterpolator2D> interp;
> interp->SetInputConnection(plane->GetOutputPort());
> interp->SetSourceConnection(demReader->GetOutputPort());
> interp->SetKernel(gaussianKernel);
> interp->SetNullPointsStrategyToClosestPoint();
> interp->InterpolateZOff();
> interp->Update();
>
> vtkSmartPointer<vtkPolyData> interpolated_poly_data =
> interp->GetPolyDataOutput();
>
> after that i visualize the interpolated_poly_data with the same pipeline i
> use to plot other stuff.
>
> However the output of the vtkPointInterpolator2D is always the same as what
> was set in SetInputConnection() or SetInputData() (in this example just a
> plane)
> The SetSourceConnection() / SetSourceData() that should be interpolated
> doesn't have any effect on the output at all.
>
> I also have played around with different types of kernels as well as
> different settings for
> NullPointsStrategy and InterpolateZ off/on.
>
> What am i missing or where is the error?
>
>
>
>
> --
> Sent from: http://vtk.1045678.n5.nabble.com/VTK-Users-f1224199.html
> _______________________________________________
> Powered by www.kitware.com
>
> Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html
>
> Please keep messages on-topic and check the VTK FAQ at: http://www.vtk.org/Wiki/VTK_FAQ
>
> Search the list archives at: http://markmail.org/search/?q=vtkusers
>
> Follow this link to subscribe/unsubscribe:
> https://vtk.org/mailman/listinfo/vtkusers
-------------- next part --------------
A non-text attachment was scrubbed...
Name: PointInterpolator2D.tar.gz
Type: application/x-gzip
Size: 1596 bytes
Desc: not available
URL: <https://vtk.org/pipermail/vtkusers/attachments/20180228/1a45c02f/attachment.bin>
More information about the vtkusers
mailing list