<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's I know until now are the celllocation by vtkCell::EvaluateLocation. But are crashing, and I think are thread problem since this method aren'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> double dummyCoords[3];<br> int mCoords[3] = { m_XPosition, m_YPosition, m_ZPosition };<br> int ret = m_ImageData->ComputeStructuredCoordinates(viewCordinates, mCoords, dummyCoords);<br> if(ret >0 )<br>
{<br> std::cout << "Point inside. Coords are: " << viewCordinates[0] << ", " << viewCordinates[1] << ", " << viewCordinates[2] << endl;<br>
} else {<br> std::cout << "Point outside of volume" << endl;<br> }<br><br>Well, the point are always outside of the volume. dummyCoords ( pcoords method parameter ) don'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"><<a href="mailto:dean.inglis@sympatico.ca">dean.inglis@sympatico.ca</a>></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;"> </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;"> </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;"> </span></font></p>
<p><font face="Times New Roman" size="3"><span style="font-size: 12pt;">vktIdType id = m_CurrentImageData->FindPoint(xyzCoords)</span></font></p>
<p><font face="Times New Roman" size="3"><span style="font-size: 12pt;">if(id > -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;"> </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;"> </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->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;"> </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;"> </span></font></p>
</div>
</div>
</blockquote></div><br></div>