# vtkPointInterpolator kernels issues (vtk 8.2)

**URL:** https://discourse.vtk.org/t/vtkpointinterpolator-kernels-issues-vtk-8-2/3020
**Category:** Support
**Created:** [April 10, 2020, 11:13am UTC](https://discourse.vtk.org/t/vtkpointinterpolator-kernels-issues-vtk-8-2/3020 "2020-04-10T11:13:10Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![Valedy](https://discourse.vtk.org/letter_avatar_proxy/v4/letter/v/2acd7d/32.png) [@Valedy](https://discourse.vtk.org/u/Valedy)
#### Post date: [April 10, 2020, 11:13am UTC](https://discourse.vtk.org/t/vtkpointinterpolator-kernels-issues-vtk-8-2/3020/1 "2020-04-10T11:13:10Z")

</div>

Hello,

Sorry in advance if my english is not perfect. I try to make my explanation clear.

I’m using vtkPointInterpolator in my method. Whether I use Linear or Voronoi kernel I don’t have any problem. But when I use Gaussian or Shepard kernels I get a seg fault in the ptInterpolator method SetKernel. I looks like the Gaussian or Shepard kernel are not initialize/build correctly or something like that. Even if I want to print Class name, I cant with Gaussian nor Shepard.

## My code below :

vtkPointInterpolator \*ptInterpolator = vtkPointInterpolator::New();

```
//Select Kernel to use (selection might be improved with vtk safe down casting)
vtkLinearKernel* kernel = vtkLinearKernel::New();
if (m_kernelStr == "Voronoi")
{
    kernel->Delete();
    vtkProbabilisticVoronoiKernel* kernel = vtkProbabilisticVoronoiKernel::New(); 
}
else if (m_kernelStr == "Gaussian")
{
    kernel->Delete();
    vtkGaussianKernel *kernel = vtkGaussianKernel::New();
    kernel->SetRequiresInitialization(false);
    kernel->SetKernelFootprintToRadius();
    kernel->SetSharpness(m_sharpness);
    kernel->SetRadius(m_radius);
    kernel->SetNormalizeWeights(true);
}
else if (m_kernelStr == "Shepard")
{
    kernel->Delete();
    vtkShepardKernel *kernel = vtkShepardKernel::New();
    kernel->SetRequiresInitialization(false);
    kernel->SetKernelFootprintToRadius();
    kernel->SetRadius(m_radius);
    kernel->SetPowerParameter(m_order);
}
else {
    kernel->SetKernelFootprintToRadius();
    kernel->SetRadius(m_radius);
    kernel->SetNormalizeWeights(true);
}

//Perform interpolation
ptInterpolator->SetSourceData(volumeToBeInterpolated);
ptInterpolator->SetInputData(surfaceToBeInterpolateOn);
ptInterpolator->SetKernel(kernel);

std::cout << "kernel : " << kernel->GetClassName() << std::endl;
std::cout << "pt kernel : " << ptInterpolator->GetKernel()->GetClassName() << std::endl;
ptInterpolator->Update();

surfaceToBeInterpolateOn->ShallowCopy(ptInterpolator->GetPolyDataOutput());

kernel->Delete();
ptInterpolator->Delete();

```

* * *

I can’t attached input files as I’m a new user on the forum… But it should work for any vtkUnstructuredGrid for volumeToBeInterpolated variable and any vtkPolyData for surfaceToInterpolateOn.

If someone have any hints, it would be appreciated

Valentin
