Here do you have an example. Where findPoint is used either in an image and in a polydata.<div><br><div><br></div><div><br></div><div><div>#include &lt;vtkVersion.h&gt;</div><div>#include &lt;vtkSmartPointer.h&gt;</div><div>

#include &lt;vtkPolyData.h&gt;</div><div>#include &lt;vtkTriangleFilter.h&gt;</div><div>#include &lt;vtkIdTypeArray.h&gt;</div><div>#include &lt;vtkImageDataGeometryFilter.h&gt;</div><div>#include &lt;vtkImageData.h&gt;</div>

<div><br></div><div><br></div><div>int main(int, char *[])</div><div>{</div><div><span class="Apple-tab-span" style="white-space:pre">        </span>//Create an image data</div><div><span class="Apple-tab-span" style="white-space:pre">        </span>vtkSmartPointer&lt;vtkImageData&gt; imageData = vtkSmartPointer&lt;vtkImageData&gt;::New();</div>

<div><span class="Apple-tab-span" style="white-space:pre">        </span>imageData-&gt;SetDimensions(5,5,1);</div><div><span class="Apple-tab-span" style="white-space:pre">        </span>imageData-&gt;SetSpacing(1.0, 1.0, 1.0);</div><div>

<span class="Apple-tab-span" style="white-space:pre">        </span>imageData-&gt;SetOrigin(0.0, 0.0, 0.0);</div><div><br></div><div><span class="Apple-tab-span" style="white-space:pre">        </span>//Convert the image to a polydata</div>

<div><span class="Apple-tab-span" style="white-space:pre">        </span>vtkSmartPointer&lt;vtkImageDataGeometryFilter&gt; imageDataGeometryFilter = vtkSmartPointer&lt;vtkImageDataGeometryFilter&gt;::New();</div><div><span class="Apple-tab-span" style="white-space:pre">        </span>imageDataGeometryFilter-&gt;SetInputConnection(imageData-&gt;GetProducerPort());</div>

<div><span class="Apple-tab-span" style="white-space:pre">        </span>imageDataGeometryFilter-&gt;Update();</div><div><br></div><div><span class="Apple-tab-span" style="white-space:pre">        </span>vtkSmartPointer&lt;vtkTriangleFilter&gt; triangleFilter = vtkSmartPointer&lt;vtkTriangleFilter&gt;::New();</div>

<div><span class="Apple-tab-span" style="white-space:pre">        </span>triangleFilter-&gt;SetInputConnection(imageDataGeometryFilter-&gt;GetOutputPort());</div><div><span class="Apple-tab-span" style="white-space:pre">        </span>triangleFilter-&gt;Update();</div>

<div><br></div><div><span class="Apple-tab-span" style="white-space:pre">        </span>vtkSmartPointer&lt;vtkPolyData&gt; triang = triangleFilter-&gt;GetOutput();//polydata normal, cells</div><div><br></div><div><span class="Apple-tab-span" style="white-space:pre">        </span>triang-&gt;BuildLinks();</div>

<div><span class="Apple-tab-span" style="white-space:pre">        </span>triang-&gt;BuildCells();</div><div><br></div><div><span class="Apple-tab-span" style="white-space:pre">        </span>vtkIdType id = triang-&gt;FindPoint(0,0,0);</div>

<div><span class="Apple-tab-span" style="white-space:pre">        </span>std::cout &lt;&lt; id &lt;&lt; std::endl;</div><div><br></div><div><span class="Apple-tab-span" style="white-space:pre">        </span>vtkIdType id2 = imageData-&gt;FindPoint(0,0,0);</div>

<div><span class="Apple-tab-span" style="white-space:pre">        </span>std::cout &lt;&lt; id2 &lt;&lt; std::endl;</div><div> </div><div><span class="Apple-tab-span" style="white-space:pre">        </span>return EXIT_SUCCESS;</div><div>

<br></div><div>}</div><br><div class="gmail_quote">2012/8/21 Boehm, Lukas <span dir="ltr">&lt;<a href="mailto:Lukas.Boehm@cellent.de" target="_blank">Lukas.Boehm@cellent.de</a>&gt;</span><br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">

<div lang="DE" link="blue" vlink="purple"><div><p class="MsoNormal"><span lang="EN-US" style="font-size:11.0pt;font-family:&quot;Arial&quot;,&quot;sans-serif&quot;;color:#1f497d">Thank you both for your answers!<u></u><u></u></span></p>

<p class="MsoNormal"><span lang="EN-US" style="font-size:11.0pt;font-family:&quot;Arial&quot;,&quot;sans-serif&quot;;color:#1f497d"><u></u> <u></u></span></p><p class="MsoNormal"><span lang="EN-US" style="font-size:11.0pt;font-family:&quot;Arial&quot;,&quot;sans-serif&quot;;color:#1f497d">FindPoint works perfect with vtkPolyData, but now I think I can’t use vtkPolyData. Instead I probably have to use vtkImageData. <u></u><u></u></span></p>

<p class="MsoNormal"><span lang="EN-US" style="font-size:11.0pt;font-family:&quot;Arial&quot;,&quot;sans-serif&quot;;color:#1f497d"><u></u> <u></u></span></p><p class="MsoNormal"><span lang="EN-US" style="font-size:11.0pt;font-family:&quot;Arial&quot;,&quot;sans-serif&quot;;color:#1f497d">My VTK pipeline looks like this:<u></u><u></u></span></p>

<p class="MsoNormal"><span lang="EN-US" style="font-size:11.0pt;font-family:&quot;Arial&quot;,&quot;sans-serif&quot;;color:#1f497d"><u></u> <u></u></span></p><p><u></u><span lang="EN-US" style="font-size:11.0pt;font-family:&quot;Arial&quot;,&quot;sans-serif&quot;;color:#1f497d"><span>1.)<span style="font:7.0pt &quot;Times New Roman&quot;">   </span></span></span><u></u><span lang="EN-US" style="font-size:11.0pt;font-family:&quot;Arial&quot;,&quot;sans-serif&quot;;color:#1f497d">Create vtkImageData with all points<u></u><u></u></span></p>

<p><u></u><span lang="EN-US" style="font-size:11.0pt;font-family:&quot;Arial&quot;,&quot;sans-serif&quot;;color:#1f497d"><span>2.)<span style="font:7.0pt &quot;Times New Roman&quot;">   </span></span></span><u></u><span lang="EN-US" style="font-size:11.0pt;font-family:&quot;Arial&quot;,&quot;sans-serif&quot;;color:#1f497d">Use vtkMarchingSquares filter to get vtkPolyData representing some iso lines<u></u><u></u></span></p>

<p><u></u><span lang="EN-US" style="font-size:11.0pt;font-family:&quot;Arial&quot;,&quot;sans-serif&quot;;color:#1f497d"><span>3.)<span style="font:7.0pt &quot;Times New Roman&quot;">   </span></span></span><u></u><span lang="EN-US" style="font-size:11.0pt;font-family:&quot;Arial&quot;,&quot;sans-serif&quot;;color:#1f497d">Some unimportant clipping stuff…<u></u><u></u></span></p>

<p class="MsoNormal"><span lang="EN-US" style="font-size:11.0pt;font-family:&quot;Arial&quot;,&quot;sans-serif&quot;;color:#1f497d"><u></u> <u></u></span></p><p class="MsoNormal"><span lang="EN-US" style="font-size:11.0pt;font-family:&quot;Arial&quot;,&quot;sans-serif&quot;;color:#1f497d">If I use the vtkPolyData object from vtkMarchingSquares I get values which make sense. But it seems like marching squares removes all points where no iso lines are drawn. I only find ids of points which are on the iso lines. <u></u><u></u></span></p>

<p class="MsoNormal"><span lang="EN-US" style="font-size:11.0pt;font-family:&quot;Arial&quot;,&quot;sans-serif&quot;;color:#1f497d"><u></u> <u></u></span></p><p class="MsoNormal"><span lang="EN-US" style="font-size:11.0pt;font-family:&quot;Arial&quot;,&quot;sans-serif&quot;;color:#1f497d">So my idea was to use vtkImageData. But not even the simpliest example works with vtkImageData and FindPoint:<u></u><u></u></span></p>

<p class="MsoNormal"><span lang="EN-US" style="font-size:11.0pt;font-family:&quot;Arial&quot;,&quot;sans-serif&quot;;color:#1f497d"><u></u> <u></u></span></p><p class="MsoNormal" style="background:white"><span lang="EN-US" style="font-size:10.0pt;font-family:Consolas;color:blue">double</span><span lang="EN-US" style="font-size:10.0pt;font-family:Consolas">[] pos = imageData.GetPoint(200);<u></u><u></u></span></p>

<pre style="background:white"><span lang="EN-US" style="font-family:Consolas;color:green">// pos contains 18.0, -29.0, 0.0 which seems to be correct</span><span lang="EN-US" style="font-family:Consolas"><u></u><u></u></span></pre>

<p class="MsoNormal" style="background:white"><span lang="EN-US" style="font-size:10.0pt;font-family:Consolas;color:blue">int</span><span lang="EN-US" style="font-size:10.0pt;font-family:Consolas"> id = imageData.FindPoint(pos[0], pos[1], pos[2]);<u></u><u></u></span></p>

<p class="MsoNormal"><span lang="EN-US" style="font-size:11.0pt;font-family:&quot;Arial&quot;,&quot;sans-serif&quot;;color:#1f497d"><u></u> <u></u></span></p><p class="MsoNormal"><span lang="EN-US" style="font-size:11.0pt;font-family:&quot;Arial&quot;,&quot;sans-serif&quot;;color:#1f497d">I would expect ‘id’ to have the value 200. But it always has the value -1. The documentation says that a return value &lt; 0 means that the point can’t be found (maybe it’s outside of the vtkImageData object). Could somebody please tell me why FindPoint always returns -1?<u></u><u></u></span></p>

<p class="MsoNormal"><span lang="EN-US" style="font-size:11.0pt;font-family:&quot;Arial&quot;,&quot;sans-serif&quot;;color:#1f497d"><u></u> <u></u></span></p><p class="MsoNormal"><span lang="EN-US" style="font-size:11.0pt;font-family:&quot;Arial&quot;,&quot;sans-serif&quot;;color:#1f497d">Thank you,<u></u><u></u></span></p>

<p class="MsoNormal"><span lang="EN-US" style="font-size:11.0pt;font-family:&quot;Arial&quot;,&quot;sans-serif&quot;;color:#1f497d">Lukas<u></u><u></u></span></p><p class="MsoNormal"><span lang="EN-US" style="font-size:11.0pt;font-family:&quot;Arial&quot;,&quot;sans-serif&quot;;color:#1f497d"><u></u> <u></u></span></p>

<p class="MsoNormal"><b><span lang="EN-US" style="font-size:10.0pt;font-family:&quot;Tahoma&quot;,&quot;sans-serif&quot;">From:</span></b><span lang="EN-US" style="font-size:10.0pt;font-family:&quot;Tahoma&quot;,&quot;sans-serif&quot;"> Gonzalo Amadio [mailto:<a href="mailto:gonzaloamadio@gmail.com" target="_blank">gonzaloamadio@gmail.com</a>] <br>

<b>Sent:</b> Dienstag, 21. August 2012 15:48<br><b>To:</b> Kevin H. Hobbs<br><b>Cc:</b> Boehm, Lukas; <a href="mailto:vtkusers@vtk.org" target="_blank">vtkusers@vtk.org</a><br><b>Subject:</b> Re: [vtkusers] Find point by coordiante<u></u><u></u></span></p>

<div><div class="h5"><p class="MsoNormal"><u></u> <u></u></p><p class="MsoNormal" style="margin-bottom:12.0pt">I think this will work!..<br><br><a href="http://www.vtk.org/doc/release/5.6/html/a00430.html#fb20db494bf2e8c0aff4ff2fcf7d6a22" target="_blank">http://www.vtk.org/doc/release/5.6/html/a00430.html#fb20db494bf2e8c0aff4ff2fcf7d6a22</a><br>

<br>The doc says &quot;find the closes point to the coordinates provided as arguiment&quot;<u></u><u></u></p><div><p class="MsoNormal">2012/8/21 Kevin H. Hobbs &lt;<a href="mailto:hobbsk@ohio.edu" target="_blank">hobbsk@ohio.edu</a>&gt;<u></u><u></u></p>

<div><p class="MsoNormal" style="margin-bottom:12.0pt">On 08/21/2012 09:18 AM, Boehm, Lukas wrote:<br>&gt; Hello,<br>&gt;<br>&gt;<br>&gt;<br>&gt; I’ve got a short question. I have a vtkPoints object and a coordinate<br>&gt; (x,y,z). Is there a way to get the id of the closest point to this<br>

&gt; coordinate? I didn’t find anything.<br>&gt;<u></u><u></u></p></div><p class="MsoNormal" style="margin-bottom:12.0pt">You need a point locator.<br><br><a href="http://www.vtk.org/doc/nightly/html/classvtkPointLocator.html" target="_blank">http://www.vtk.org/doc/nightly/html/classvtkPointLocator.html</a><br>

<br><br>_______________________________________________<br>Powered by <a href="http://www.kitware.com" target="_blank">www.kitware.com</a><br><br>Visit other Kitware open-source projects at <a href="http://www.kitware.com/opensource/opensource.html" target="_blank">http://www.kitware.com/opensource/opensource.html</a><br>

<br>Please keep messages on-topic and check the VTK FAQ at: <a href="http://www.vtk.org/Wiki/VTK_FAQ" target="_blank">http://www.vtk.org/Wiki/VTK_FAQ</a><br><br>Follow this link to subscribe/unsubscribe:<br><a href="http://www.vtk.org/mailman/listinfo/vtkusers" target="_blank">http://www.vtk.org/mailman/listinfo/vtkusers</a><u></u><u></u></p>

</div><p class="MsoNormal"><br><br clear="all"><u></u><u></u></p><div><p class="MsoNormal"><u></u> <u></u></p></div><p class="MsoNormal" style="margin-bottom:12.0pt">-- <br>--------<br>Gonzalo Amadio<u></u><u></u></p></div>

</div></div></div><br><p>_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _</p><p>cellent Aktiengesellschaft<br>Vorsitzender des Aufsichtsrates: Dr. Martin Setzer<br>Vertretungsberechtigter Vorstand: Andreas Schwegler<br>

Gerichtsstand: Amtsgericht Stuttgart, HRB 22791<br>Umsatzsteuer-ID: DE 226611517<br>Firmensitz: Stuttgart</p><p>Diese EMail sowie etwaige Anlagen sind ausschliesslich fuer den Adressaten bestimmt und koennen vertrauliche oder gesetzlich<br>

geschuetzte Informationen enthalten. Wenn Sie nicht der bestimmungsgemaesse Empfaenger sind, unterrichten Sie bitte den Absender <br>und vernichten Sie diese Mail. Anderen als dem bestimmungsgemaessen Adressaten ist es untersagt, diese EMail zu speichern, <br>

weiterzuleiten oder ihren Inhalt, auf welche Weise auch immer, zu verwenden. Wir verwenden aktuelle Virenschutzprogramme. <br>Fuer Schäden, die dem Empfaenger gleichwohl durch von uns zugesandte, mit Viren befallene EMails entstehen, schliessen wir jede Haftung aus.</p>

<p>The information contained in this e-mail or attachments is intended only for its addressee and may contain confidential and/or <br>privileged information. If you have received this e-mail in error, please notify the sender and delete the e-mail. If you are not the <br>

intended recipient, you are hereby notified, that saving, distribution or use of the content of this e-mail in any way is prohibited. <br>We use updated virus protection software. We do not accept any responsibility for damages caused anyhow by viruses transmitted via e-mail.<br>

_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _</p><br></blockquote></div><br><br clear="all"><div><br></div>-- <br>--------<br>Gonzalo Amadio<br><br>
</div></div>