Hi all,
I’m trying to interpolate a .vti volume on a .vtp mesh using vtkPointInterpolator but I get “Segmentation fault (core dumped)” when I’m updating the vtkPointInterpolator filter. Here is my code:
Hi David,
thanks for your advice but I got the same error. Here you can find the data: surfacemesh.vtp and volume.vti surfacemesh.vtp (20.3 KB) volume.vti (239.7 KB)
Good to hear that it works. It seems that the vtkStaticPointLocator cannot be used on vtkImageData, and that’s why a different locator must be used.
Note that if you are using VTK 9 and need extra speed, the vtkImageProbeFilter is specifically designed to efficiently interpolate points from an image (and it’s SMP, too, like vtkPointInterpolator).
@dgobbi thank you, this helped me to solve similar problem.
I’m interpolating custom object inherited from vtkDataSet and I’m wondering is it possible to somehow tell the interpolator that it should look for the points in some order?
My dataset has some partly predictable structure and I would like to experiment with perfomance (the dataset may take pretty much of memory).
Is it vtkPointLocator I should try to look at and probably inherit from it? Or vtkDataSet::GetPoint()/GetCell() are the only methods I should improve?
Hi Kerim, if your data set has cells in addition to points, then try using vtkProbeFilter to do the interpolation. If it’s necessary to use vtkPointInterpolator instead of vtkProbeFilter, then a custom vtkPointLocator subclass is probably the best way to go (the locators have a lot of interface methods, so it might require a lot of work).
I’m facing some problems when using vtkProbeFilter even though it works fine in most cases but sometimes there is an incorrect result.
I’m trying to debug and I set the breakpoint in MyDataset::FindCell() method but the program never goes there. I don’t understand why but according to the documentation it should.
What maybe the reason of that?
vtkNew<vtkProbeFilter> interpolator;
interpolator->SetFindCellStrategy(nullptr);
interpolator->SetCellLocatorPrototype(nullptr);
interpolator->SetSourceData(raisedGrid); // this is my dataset
interpolator->SetInputData(imageData); // I want to interpolate my dataset `raisedGrid` on `vtkImageData`
interpolator->Update();
I have looked to the source code of vtkProbeFilter and understood that when it somehow works with vtkImageData it doesn’t use vtkDataSet::FindCell() but instead it implements some more effective logic.