<div dir="ltr">Hi Dean,<br><br>My point are defined in int XYZ, which Z are my slice, and XY the simple pixel coordinate. Are no interpolation here. This points are used to segment, works fine.<br>Bu I need to show this points on 3D. The only way that&#39;s I know until now are the celllocation by vtkCell::EvaluateLocation. But are crashing, and I think are thread problem since this method aren&#39;t thread safe. I tried with the thread safe method too, and are not working. Based on your sugestion, I tried the second option, which appears to be the correct to my case:<br>
<br>&nbsp;&nbsp;&nbsp; double dummyCoords[3];<br>&nbsp;&nbsp;&nbsp; int mCoords[3] = { m_XPosition, m_YPosition, m_ZPosition };<br>&nbsp;&nbsp;&nbsp; int ret = m_ImageData-&gt;ComputeStructuredCoordinates(viewCordinates, mCoords, dummyCoords);<br>&nbsp;&nbsp;&nbsp; if(ret &gt;0 )<br>
&nbsp;&nbsp;&nbsp; {<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; std::cout &lt;&lt; &quot;Point inside. Coords are: &quot; &lt;&lt; viewCordinates[0] &lt;&lt; &quot;, &quot; &lt;&lt; viewCordinates[1] &lt;&lt; &quot;, &quot; &lt;&lt; viewCordinates[2] &lt;&lt; endl;<br>
&nbsp;&nbsp;&nbsp; } else {<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; std::cout &lt;&lt; &quot;Point outside of volume&quot; &lt;&lt; endl;<br>&nbsp;&nbsp;&nbsp; }<br><br>Well, the point are always outside of the volume. dummyCoords ( pcoords method parameter ) don&#39;t needs to be calculated?<br>
<br>Regards,<br><br>Wagner Sales<br><div class="gmail_quote">2008/9/1 Dean Inglis <span dir="ltr">&lt;<a href="mailto:dean.inglis@sympatico.ca">dean.inglis@sympatico.ca</a>&gt;</span><br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">









<div link="blue" vlink="purple" lang="EN-CA">

<div>

<p><font face="Arial" size="2"><span style="font-size: 10pt; font-family: Arial;">Hi Wagner,</span></font></p>

<p><font face="Arial" size="2"><span style="font-size: 10pt; font-family: Arial;">&nbsp;</span></font></p>

<p><font face="Arial" size="2"><span style="font-size: 10pt; font-family: Arial;">how are </span></font>m_XPosition, m_YPosition, m_ZPosition defined?</p>

<p><font face="Arial" size="2"><span style="font-size: 10pt; font-family: Arial;">&nbsp;</span></font></p>

<p><font face="Arial" size="2"><span style="font-size: 10pt; font-family: Arial;">Given a 3D double precision 3D spatial point:</span></font></p>

<p><font face="Arial" size="2"><span style="font-size: 10pt; font-family: Arial;">&nbsp;</span></font></p>

<p><font face="Times New Roman" size="3"><span style="font-size: 12pt;">vktIdType id = m_CurrentImageData-&gt;FindPoint(xyzCoords)</span></font></p>

<p><font face="Times New Roman" size="3"><span style="font-size: 12pt;">if(id &gt; -1)</span></font></p>

<p><font face="Times New Roman" size="3"><span style="font-size: 12pt;">{</span></font></p>

<p><font face="Times New Roman" size="3"><span style="font-size: 12pt;">//do what you need to do with the point: it's valid!</span></font></p>

<p><font face="Times New Roman" size="3"><span style="font-size: 12pt;">}</span></font><font face="Arial" size="2"><span style="font-size: 10pt; font-family: Arial;"></span></font></p>

<p><font face="Arial" size="2"><span style="font-size: 10pt; font-family: Arial;">&nbsp;</span></font></p>

<p><font face="Arial" size="2"><span style="font-size: 10pt; font-family: Arial;">if you have integer ijk indices:</span></font></p>

<p><font face="Arial" size="2"><span style="font-size: 10pt; font-family: Arial;">&nbsp;</span></font></p>

<p><font face="Arial" size="2"><span style="font-size: 10pt; font-family: Arial;">double queryPoint[3];</span></font></p>

<p><font face="Arial" size="2"><span style="font-size: 10pt; font-family: Arial;">double dummyPcoords[3];</span></font></p>

<p><font face="Arial" size="2"><span style="font-size: 10pt; font-family: Arial;">if(</span></font>m_CurrentImageData-&gt;ComputeStructuredCoordinates(queryPoint,myijkindices,dummyPcoords)
== 1)</p>

<p><font face="Times New Roman" size="3"><span style="font-size: 12pt;">{</span></font></p>

<p><font face="Times New Roman" size="3"><span style="font-size: 12pt;">//the ijk indices refer to a point in the 3D image volume and you have
a valid 3D point</span></font></p>

<p><font face="Times New Roman" size="3"><span style="font-size: 12pt;">//otherwise, try with different ijk indices</span></font></p>

<p><font face="Times New Roman" size="3"><span style="font-size: 12pt;">}</span></font></p>

<p><font face="Times New Roman" size="3"><span style="font-size: 12pt;">&nbsp;</span></font></p>

<p><font face="Times New Roman" size="3"><span style="font-size: 12pt;">HTH</span></font></p>

<p><font face="Times New Roman" size="3"><span style="font-size: 12pt;">Dean</span></font></p>

<p><font face="Times New Roman" size="3"><span style="font-size: 12pt;">&nbsp;</span></font></p>

</div>

</div>


</blockquote></div><br></div>