Markus,<br><br>It sounds like an application for a ray tracing program, but not one with a standard camera model. Instead, you would cast rays from the tumor center out into the organs and skin using some uniform sampling of the unit sphere. You can mark the rays that intersect the organs and then check which of the skin triangles intersect one or more &quot;organ&quot; rays.<br>
<br>Alas, I don&#39;t know of any class in VTK that does this for you, but you should be able to code something up manually quite easily. The vtkTriangle class has a method IntersectWithLine() that should prove useful if you decide to iterate over all triangles for all the rays you cast. For better performance, you could use vtkCellLocator or vtkOBBTree. It also has an IntersectsWithLine() method that gives you a list of triangles (vtkCells, really) that the line intersects. You could have two vtkOBBTrees, one for the organs and one for the skin. If IntersectsWithLine() called on the vtkOBBTree with the organ data returns a non-empty list of triangles, then all the skin triangles the ray intersects are occluded, and you can mark them as such.<br>
<br>Good luck with your project,<br>Cory<br><br><div class="gmail_quote">On Tue, Dec 2, 2008 at 12:02 PM, Engel Markus <span dir="ltr">&lt;<a href="mailto:m.engel@dkfz-heidelberg.de">m.engel@dkfz-heidelberg.de</a>&gt;</span> wrote:<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="DE">

<div>

<p><span style="font-size: 11pt; color: rgb(31, 73, 125);" lang="EN-US">Hi Cory!</span></p>

<p><span style="font-size: 11pt; color: rgb(31, 73, 125);" lang="EN-US">&nbsp;</span></p>

<p><span style="font-size: 11pt; color: rgb(31, 73, 125);" lang="EN-US">I'm sorry. I should have described the goal in more
detail. </span></p>

<p><span style="font-size: 11pt; color: rgb(31, 73, 125);" lang="EN-US">&nbsp;</span></p>

<p><span style="font-size: 11pt; color: rgb(31, 73, 125);" lang="EN-US">The program I'm writing is supposed to compute the optimal
trajectory&nbsp; to insert a needle to a &nbsp;tumor. This is going to be part
of the planning for an operation using percutaneous &nbsp;radiofrequency
ablation.</span></p>

<p><span style="font-size: 11pt; color: rgb(31, 73, 125);" lang="EN-US">When the needle has hit the center of the tumor its tip is
heated and thus burns the tumor.</span></p>

<p><span style="font-size: 11pt; color: rgb(31, 73, 125);" lang="EN-US">&nbsp;</span></p>

<p><span style="font-size: 11pt; color: rgb(31, 73, 125);" lang="EN-US">The first step of the program is to determine the so called
100%zones. Only in these zones I can insert the needle safely, because
otherwise I could hit a bone, vessel or another organ.</span></p>

<p><span style="font-size: 11pt; color: rgb(31, 73, 125);" lang="EN-US">That's why, as a first step, I have to find all triangles
of the skin that are totally visible, respectively &nbsp;not occluded , when
looking from the tumors "point of view".</span></p>

<p><span style="font-size: 11pt; color: rgb(31, 73, 125);" lang="EN-US">After this step I'd like to have two &nbsp;lists of
triangles. One containing all visible triangles and the other containing all
the occluded triangles.</span></p>

<p><span style="font-size: 11pt; color: rgb(31, 73, 125);" lang="EN-US">&nbsp;</span></p>

<p><span style="font-size: 11pt; color: rgb(31, 73, 125);" lang="EN-US">I hope this helps understanding my problem.</span></p>

<p><span style="font-size: 11pt; color: rgb(31, 73, 125);" lang="EN-US">&nbsp;</span></p>

<p><span style="font-size: 11pt; color: rgb(31, 73, 125);" lang="EN-US">Greets </span></p>

<p><span style="font-size: 11pt; color: rgb(31, 73, 125);" lang="EN-US">&nbsp;</span></p>

<p><span style="font-size: 11pt; color: rgb(31, 73, 125);" lang="EN-US">Markus</span></p>

<p><span style="font-size: 11pt; color: rgb(31, 73, 125);" lang="EN-US">&nbsp;</span></p>

<p><span style="font-size: 11pt; color: rgb(31, 73, 125);" lang="EN-US">&nbsp;</span></p>

<div style="border-style: solid none none; border-color: rgb(181, 196, 223) -moz-use-text-color -moz-use-text-color; border-width: 1pt medium medium; padding: 3pt 0cm 0cm;">

<p><b><span style="font-size: 10pt;">Von:</span></b><span style="font-size: 10pt;"> <a href="mailto:cquammen@gmail.com" target="_blank">cquammen@gmail.com</a>
[mailto:<a href="mailto:cquammen@gmail.com" target="_blank">cquammen@gmail.com</a>] <b>Im Auftrag von </b>Cory Quammen<br>
<b>Gesendet:</b> Dienstag, 2. Dezember 2008 14:28<br>
<b>An:</b> Engel Markus<br>
<b>Cc:</b> <a href="mailto:vtkusers@vtk.org" target="_blank">vtkusers@vtk.org</a><br>
<b>Betreff:</b> Re: [vtkusers] Occlusion</span></p>

</div><div><div></div><div class="Wj3C7c">

<p>&nbsp;</p>

<p style="margin-bottom: 12pt;">Hi Markus,<br>
<br>
I don&#39;t have a VTK-based solution for you based on your problem description,
but I am curious why you want to eliminate triangles of the vtkPolyData
representing the skin. What is the ultimate goal you are trying to accomplish?
Are you worried about performance? If so, you probably shouldn&#39;t. Modern GPUs
can render triangles very quickly, especially with features like early z
culling. Are you trying to eliminate them from the scene? If they are occluded
from your view point, you won&#39;t see them.<br>
<br>
Just curious,<br>
Cory</p>

<div>

<p>On Tue, Dec 2, 2008 at 7:37 AM, Engel Markus &lt;<a href="mailto:m.engel@dkfz-heidelberg.de" target="_blank">m.engel@dkfz-heidelberg.de</a>&gt;
wrote:</p>

<div>

<div>

<p><span lang="EN-US">Hi!</span></p>

<p><span lang="EN-US">&nbsp;</span></p>

<p><span lang="EN-US">I&#39;m currently looking for a possibility to check whether a
certain triangle of my vtkPolyData is visible or occluded by another PolyData.</span></p>

<p><span lang="EN-US">&nbsp;</span></p>

<p><span lang="EN-US">I&#39;m writing a program that eliminates triangles of the
PolyData, representing the patients skin, that are not visible from the
barycenter of a tumor, </span></p>

<p><span lang="EN-US">because they are occluded by other organs. All organs, the
tumor and the skin are vtkPolyDatas.</span></p>

<p><span lang="EN-US">So I basically need to check if there is an Object, in this
case a PolyData, between a point and a tringle.</span></p>

<p><span lang="EN-US">&nbsp;</span></p>

<p><span lang="EN-US">As the program is going to be based on VTK, I&#39;m searching
for a native VTK solution. </span></p>

<p><span lang="EN-US">I already stumbled upon &nbsp;the OpenGL
&nbsp;occlusion_query, however I afraid it won&#39;t be easy to integrate this into
the existing rendering-pipeline. That&#39;s another reason for looking for some
VTK-stuff.</span></p>

<p><span lang="EN-US">&nbsp;</span></p>

<p><span lang="EN-US">Thanks a lot!</span></p>

<p><span lang="EN-US">&nbsp;</span></p>

<p><span lang="EN-US">Markus</span></p>

<p><span lang="EN-US">&nbsp;</span></p>

<p><span style="color: black;" lang="EN-US">&nbsp;</span></p>

<p>&nbsp;</p>

</div>

</div>

<p style="margin-bottom: 12pt;"><br>
_______________________________________________<br>
This is the private VTK discussion list.<br>
Please keep messages on-topic. Check the FAQ at: <a href="http://www.vtk.org/Wiki/VTK_FAQ" target="_blank">http://www.vtk.org/Wiki/VTK_FAQ</a><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></p>

</div>

<p><br>
<br clear="all">
<br>
-- <br>
Cory Quammen<br>
Center for Computer Integrated Systems for Microscopy and Manipulation (CISMM)<br>
Department of Computer Science<br>
University of North Carolina at Chapel Hill<br>
<a href="http://www.cs.unc.edu/%7Ecquammen" target="_blank">http://www.cs.unc.edu/~cquammen</a></p>

</div></div></div>

</div>


</blockquote></div><br><br clear="all"><br>-- <br>Cory Quammen<br>Center for Computer Integrated Systems for Microscopy and Manipulation (CISMM)<br>Department of Computer Science<br>University of North Carolina at Chapel Hill<br>
<a href="http://www.cs.unc.edu/~cquammen">http://www.cs.unc.edu/~cquammen</a><br>