[vtkusers] vtkKdTree BuildLocatorFromPoints trouble
jtaclas at bidmc.harvard.edu
jtaclas at bidmc.harvard.edu
Tue Oct 23 12:12:30 EDT 2007
I am having some trouble with vtkKdTree. I read data in as structured points, turn it into a surface with vtkMarchingContourFilter, and would like to find the nearest point of this surface to a specified point in space. To do this, do I need to get the point data from the contour filter and use BuildLocatorFromPoints, or would I just set the contour filter output as the data set and use BuildLocator; I ask because the manual pages online suggest that vtkIdType vtkKdTree::FindClosestPoint requires the locator be from BuildLocatorFromPoints. If this is the case, should the following work (or better phrased, why doesn't it)?
vtkKdTree * example = vtkKdTree::New();
example->BuildLocatorFromPoints(contour->GetOutput()->GetPoints());
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20071023/d986a436/attachment.htm>
More information about the vtkusers
mailing list