<div dir="ltr">Unless I am missing something in your question, probing and locating cells are two different things. I would expect them to have different results. Probing interpolates, locators don't. From the documentation of the two classes...<div><br></div><div><div>vtkProbeFilter is a filter that computes point attributes (e.g., scalars,</div><div> * vectors, etc.) at specified point positions. The filter has two inputs:</div><div> * the Input and Source. The Input geometric structure is passed through the</div><div> * filter. The point attributes are computed at the Input point positions</div><div> * by interpolating into the source data. For example, we can compute data</div><div> * values on a plane (plane specified as Input) from a volume (Source).</div><div> * The cell data of the source data is copied to the output based on in</div><div> * which source cell each input point is. If an array of the same name exists</div><div> * both in source's point and cell data, only the one from the point data is</div><div> * probed.</div><div> *</div><div> * This filter can be used to resample data, or convert one dataset form into</div><div> * another. For example, an unstructured grid (vtkUnstructuredGrid) can be</div><div> * probed with a volume (three-dimensional vtkImageData), and then volume</div><div> * rendering techniques can be used to visualize the results. Another example:</div><div> * a line or curve can be used to probe data to produce x-y plots along</div><div> * that line or curve.</div></div><div><br></div><div>Versus</div><div><br></div><div><div> * vtkCellLocator is a spatial search object to quickly locate cells in 3D.</div><div> * vtkCellLocator uses a uniform-level octree subdivision, where each octant</div><div> * (an octant is also referred to as a bucket) carries an indication of</div><div> * whether it is empty or not, and each leaf octant carries a list of the</div><div> * cells inside of it. (An octant is not empty if it has one or more cells</div><div> * inside of it.)  Typical operations are intersection with a line to return</div><div> * candidate cells, or intersection with another vtkCellLocator to return</div><div> * candidate cells.</div></div><div><br></div><div><br></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Tue, May 9, 2017 at 2:48 AM, foufara via vtk-developers <span dir="ltr"><<a href="mailto:vtk-developers@vtk.org" target="_blank">vtk-developers@vtk.org</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hi it's me again ! :-)<br>
<br>
No one can help me on that ?<br>
<br>
Here is this time a Cxx example.<br>
<br>
To sum it up, vtkprobefilter and vtkcelllocator do not give the same results<br>
on this example and that does not seem right to me…<br>
<br>
I'll be debugging it to see what happens.<br>
But if you already have the explanation, please et me know !<br>
<br>
Thanks<br>
<br>
Raphael<br>
<br>
<br>
#include "vtkPoints.h"<br>
#include "vtkPolyData.h"<br>
#include "vtkUnstructuredGrid.h"<br>
#include "vtkDataSet.h"<br>
#include "vtkPointData.h"<br>
#include "vtkDataArray.h"<br>
#include "vtkDataSetReader.h"<br>
#include "vtkProbeFilter.h"<br>
#include "vtkPointLocator.h"<br>
#include "vtkCellLocator.h"<br>
#include "vtkIdList.h"<br>
#include "vtkPolyDataWriter.h"<br>
<br>
<br>
int main()<br>
{<br>
<br>
    std::cout << "DEBUGRAPHA : Debug1" << "\n "<<std::endl;<br>
<br>
<br>
<br>
    double point1[3] = {-312.,-1407.,37.};<br>
    double point2[3] = {-312.,-1407.,57.};<br>
<br>
    // 2 Points to probe with<br>
    vtkPoints* points = vtkPoints::New();<br>
    vtkIdType nextPoint1 = points->InsertNextPoint(<wbr>point1);<br>
    vtkIdType nextPoint2 = points->InsertNextPoint(<wbr>point2);<br>
    vtkPolyData* polydata = vtkPolyData::New();<br>
    polydata->SetPoints(points);<br>
<br>
    std::cout << "Points" <<std::endl;<br>
    std::cout &lt;&lt; &quot;Point 1 : &quot; &lt;&lt; point1[0] &lt;&lt;<br>
&quot; &quot; &lt;&lt; point1[1] &lt;&lt; &quot; &quot; &lt;&lt; point1[2]<br>
&lt;&lt; std::endl;<br>
    std::cout &lt;&lt; &quot;Point 2 : &quot; &lt;&lt; point2[0] &lt;&lt;<br>
&quot; &quot; &lt;&lt; point2[1] &lt;&lt; &quot; &quot; &lt;&lt; point2[2]<br>
&lt;&lt; std::endl;<br>
    std::cout &lt;&lt; &quot;\n&quot; &lt;&lt; std::endl;<br>
<br>
    //Writing the points to vtk file<br>
    vtkPolyDataWriter* writer1 = vtkPolyDataWriter::New();<br>
    writer1->SetInputData(<wbr>polydata);<br>
    writer1->SetFileName("<wbr>polydata.vtk");<br>
    writer1->Write();<br>
<br>
    // 3D Data to probe<br>
    vtkDataSetReader *reader = vtkDataSetReader::New();<br>
    reader->SetFileName("<wbr>extraction.vtk");<br>
    reader->Update();<br>
    vtkDataSet* data=reader->GetOutput();<br>
<br>
    // Probing<br>
    vtkProbeFilter* probe = vtkProbeFilter::New();<br>
    probe->SetInputData(polydata);<br>
    probe->SetSourceData(data);<br>
    probe->Update();<br>
    vtkDataSet* result=probe->GetOutput();<br>
<br>
    // Results probing<br>
    vtkPointData* pointData = result->GetPointData();<br>
    vtkDataArray* valid = pointData->GetArray("<wbr>vtkValidPointMask");<br>
    vtkDataArray* cellid = pointData->GetArray("ID");<br>
<br>
    std::cout << "Probing" <<std::endl;<br>
    std::cout &lt;&lt; &quot;Valid : &quot; &lt;&lt; valid->GetTuple1(0) <<<br>
" " << valid->GetTuple1(1) << std::endl;<br>
    std::cout << "ID : " << cellid->GetTuple1(0) << " " <<<br>
cellid->GetTuple1(1) << std::endl;<br>
    std::cout << "\n" << std::endl;<br>
<br>
<br>
    // CellLocator<br>
    vtkIdType cellids[2];<br>
    vtkCellLocator* locator=vtkCellLocator::New();<br>
    locator->SetDataSet(data);<br>
    locator->BuildLocator();<br>
    for (int i=0; i<polydata->GetNumberOfPoints(<wbr>); i++)<br>
    {<br>
        cellids[i]=locator->FindCell(<wbr>polydata->GetPoint(i));<br>
    }<br>
    std::cout << "CellLocator" <<std::endl;<br>
    std::cout << "ID : " << cellids[0] << " " << cellids[1] << std::endl;<br>
<br>
    return 0;<br>
}<br>
<br>
<br>
<br>
<br>
<br>
<br>
--<br>
View this message in context: <a href="http://vtk.1045678.n5.nabble.com/Is-vtkprobefilter-working-correctly-Here-is-an-example-to-test-tp5743104p5743147.html" rel="noreferrer" target="_blank">http://vtk.1045678.n5.nabble.<wbr>com/Is-vtkprobefilter-working-<wbr>correctly-Here-is-an-example-<wbr>to-test-tp5743104p5743147.html</a><br>
Sent from the VTK - Dev mailing list archive at Nabble.com.<br>
______________________________<wbr>_________________<br>
Powered by <a href="http://www.kitware.com" rel="noreferrer" target="_blank">www.kitware.com</a><br>
<br>
Visit other Kitware open-source projects at <a href="http://www.kitware.com/opensource/opensource.html" rel="noreferrer" target="_blank">http://www.kitware.com/<wbr>opensource/opensource.html</a><br>
<br>
Search the list archives at: <a href="http://markmail.org/search/?q=vtk-developers" rel="noreferrer" target="_blank">http://markmail.org/search/?q=<wbr>vtk-developers</a><br>
<br>
Follow this link to subscribe/unsubscribe:<br>
<a href="http://public.kitware.com/mailman/listinfo/vtk-developers" rel="noreferrer" target="_blank">http://public.kitware.com/<wbr>mailman/listinfo/vtk-<wbr>developers</a><br>
<br>
</blockquote></div><br><br clear="all"><div><br></div>-- <br><div class="gmail_signature" data-smartmail="gmail_signature"><div dir="ltr"><div>Ken Martin PhD<div>Distinguished Engineer<br><span style="font-size:12.8px">Kitware Inc.</span><br></div><div>28 Corporate Drive<br>Clifton Park NY 12065<br><div><br></div><div><span style="font-size:10pt;font-family:Tahoma,sans-serif">This communication,
including all attachments, contains confidential and legally privileged
information, and it is intended only for the use of the addressee.  Access to this email by anyone else is
unauthorized. If you are not the intended recipient, any disclosure, copying,
distribution or any action taken in reliance on it is prohibited and may be
unlawful. If you received this communication in error please notify us
immediately and destroy the original message. 
Thank you.</span></div></div></div></div></div>
</div>