Dear David;<div><br></div><div>In our lab, we started to evaluate the vtkKWEGPUVolumeRayCastMapper but the sample application we consider for that purpose was originally implemented using the vtkFixedPointVolumeRayCastMapper. Consequently, we are facing some difficulties to switch to vtkKWEGPUVolumeRayCastMapper since these two classes of  mappers do not share the same interface. Methods like...</div>
<div><br></div><div><div>&#39;GetRayCastImage&#39;</div><div>&#39;GetScalarOpacityTable&#39;</div><div>&#39;PerVolumeInitialization&#39;</div><div>&#39;PerSubVolumeInitialization&#39;</div><div>&#39;PerImageInitialization&#39;</div>
<div>&#39;DisplayRenderedImage&#39;</div><div>&#39;RenderSubVolume&#39;</div><div>&#39;OldSampleDistance&#39;</div><div>&#39;AbortRender&#39;</div></div><div><br></div><div>...are NOT common among the other volume mappers. </div>
<div><br></div><div>Any tips or advices? </div><div><br></div><div>Best Regards</div><div><br></div><div>Fauze</div><div><br></div><div><br></div><div>PS.: Have Kitware considered the possibility of having a new mapper like the vtkFixedPointVolumeRayCastMapper but implemented on top of the GPU Ray Casting support provided by VTKEdge?</div>
<meta charset="utf-8"><div><br></div><div><br></div><div><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;"><div><div class="h5">&gt; On Fri, Jan 22, 2010 at 5:33 PM, David Gobbi &lt;<a href="mailto:david.gobbi@gmail.com">david.gobbi@gmail.com</a>&gt; wrote:<br>

&gt;&gt;<br>
&gt;&gt; I just starting working with VTKEdge myself... but I&#39;m pretty sure<br>
&gt;&gt; that you wouldn&#39;t have to re-write much code.  The interface to the<br>
&gt;&gt; VTKEdge volume rendering classes is pretty much identical to the VTK<br>
&gt;&gt; ones.  Also, all they require is OpenGL 2.0, so you don&#39;t have to<br>
&gt;&gt; install any third-party GPU packages (when you compile VTKEdge it will<br>
&gt;&gt; ask for CUDA, but CUDA is not required for volume rendering so just<br>
&gt;&gt; turn CUDA off).<br>
&gt;&gt;<br>
&gt;&gt; So it&#39;s not quite &quot;just&quot; a new backend, but your application should<br>
&gt;&gt; only need minimal modifications.<br>
&gt;&gt;<br>
&gt;&gt;   David<br>
&gt;&gt;<br>
&gt;&gt;<br>
&gt;&gt; On Fri, Jan 22, 2010 at 3:08 PM, Fauze Polpeta &lt;<a href="mailto:fauze.polpeta@gmail.com">fauze.polpeta@gmail.com</a>&gt;<br>
&gt;&gt; wrote:<br>
&gt;&gt; &gt; Right David...I will try the two alternatives you mentioned:<br>
&gt;&gt; &gt; 1) Texture volume rendering<br>
&gt;&gt; &gt; 2) VTKEdge<br>
&gt;&gt; &gt; One last question: In order to achieve GPU-based ray casting I just have<br>
&gt;&gt; &gt; to<br>
&gt;&gt; &gt; configure and &quot;embed&quot; VTKEdge into my project or have to re-write my<br>
&gt;&gt; &gt; volume<br>
&gt;&gt; &gt; rendering application? In orther words, for GPU-based ray casting<br>
&gt;&gt; &gt; VTKEdge is<br>
&gt;&gt; &gt; saw as a GPU backend interface library, or/and as a new set of<br>
&gt;&gt; &gt; abstractions/filters to be deployed by the programmer?<br>
&gt;&gt; &gt; Thank you so much<br>
&gt;&gt; &gt; My Best Regards<br>
&gt;&gt; &gt; Fauze<br>
&gt;&gt; &gt;<br>
&gt;&gt; &gt; On Fri, Jan 22, 2010 at 7:47 PM, David Gobbi &lt;<a href="mailto:david.gobbi@gmail.com">david.gobbi@gmail.com</a>&gt;<br>
&gt;&gt; &gt; wrote:<br>
&gt;&gt; &gt;&gt;<br>
&gt;&gt; &gt;&gt; Hi Fauze,<br>
&gt;&gt; &gt;&gt;<br>
&gt;&gt; &gt;&gt; I&#39;ve written surgical tracking application with volume rendering, and<br>
&gt;&gt; &gt;&gt; I&#39;ve always used texture volume rendering in preference to ray casting<br>
&gt;&gt; &gt;&gt; in order to avoid the issues that you describe, since the LOD approach<br>
&gt;&gt; &gt;&gt; doesn&#39;t work very well when the tools are in constant motion.  For our<br>
&gt;&gt; &gt;&gt; next generation of surgical applications, we intend to use VTKEdge for<br>
&gt;&gt; &gt;&gt; doing GPU-based ray casting.<br>
&gt;&gt; &gt;&gt;<br>
&gt;&gt; &gt;&gt; Mixing pure OpenGL with VTK isn&#39;t a good idea, since you can&#39;t really<br>
&gt;&gt; &gt;&gt; know what the OpenGL state will be.  Also, if you&#39;re instruments ever<br>
&gt;&gt; &gt;&gt; intersect the volume (as I&#39;m sure they would) you will get an<br>
&gt;&gt; &gt;&gt; incorrect rendering unless you allow VTK to properly intermix the<br>
&gt;&gt; &gt;&gt; polygon rendering with the the volume.<br>
&gt;&gt; &gt;&gt;<br>
&gt;&gt; &gt;&gt; In short: if you really need to use ray casting, try out VTKEdge.  I<br>
&gt;&gt; &gt;&gt; don&#39;t think it&#39;s a good idea to try to write your own polydata/volume<br>
&gt;&gt; &gt;&gt; intermixing code.<br>
&gt;&gt; &gt;&gt;<br>
&gt;&gt; &gt;&gt;    David<br>
&gt;&gt; &gt;&gt;<br>
&gt;&gt; &gt;&gt;<br>
&gt;&gt; &gt;&gt;<br>
&gt;&gt; &gt;&gt; On Fri, Jan 22, 2010 at 2:32 PM, Fauze Polpeta<br>
&gt;&gt; &gt;&gt; &lt;<a href="mailto:fauze.polpeta@gmail.com">fauze.polpeta@gmail.com</a>&gt;<br>
&gt;&gt; &gt;&gt; wrote:<br>
&gt;&gt; &gt;&gt; &gt; Thanks for your support David and sorry for the cross-post...I was<br>
&gt;&gt; &gt;&gt; &gt; wondering<br>
&gt;&gt; &gt;&gt; &gt; if one could image some core-based solution.<br>
&gt;&gt; &gt;&gt; &gt; In our case a medical application is being prototyped and the<br>
&gt;&gt; &gt;&gt; &gt; ray-cast<br>
&gt;&gt; &gt;&gt; &gt; volume was preferred for volumetric reconstruction. The point is that<br>
&gt;&gt; &gt;&gt; &gt; our<br>
&gt;&gt; &gt;&gt; &gt; application is connected to a device that tracks surgical instruments<br>
&gt;&gt; &gt;&gt; &gt; that<br>
&gt;&gt; &gt;&gt; &gt; are represented by polydata. So, theoretically, we can&#39;t abdicate of<br>
&gt;&gt; &gt;&gt; &gt; the<br>
&gt;&gt; &gt;&gt; &gt; ray-casting while moving these tools during a given surgical<br>
&gt;&gt; &gt;&gt; &gt; procedure.<br>
&gt;&gt; &gt;&gt; &gt; This<br>
&gt;&gt; &gt;&gt; &gt; is the reason I mentioned if it is possible to bypass the pipeline<br>
&gt;&gt; &gt;&gt; &gt; processing in order to render this polydata using pure OpenGL<br>
&gt;&gt; &gt;&gt; &gt; commands.<br>
&gt;&gt; &gt;&gt; &gt; Thanks again<br>
&gt;&gt; &gt;&gt; &gt; Regards<br>
&gt;&gt; &gt;&gt; &gt; Fauze<br>
&gt;&gt; &gt;&gt; &gt;<br>
&gt;&gt; &gt;&gt; &gt;<br>
&gt;&gt; &gt;&gt; &gt; On Fri, Jan 22, 2010 at 7:04 PM, David Gobbi &lt;<a href="mailto:david.gobbi@gmail.com">david.gobbi@gmail.com</a>&gt;<br>
&gt;&gt; &gt;&gt; &gt; wrote:<br>
&gt;&gt; &gt;&gt; &gt;&gt;<br>
&gt;&gt; &gt;&gt; &gt;&gt; Hi Fauze,<br>
&gt;&gt; &gt;&gt; &gt;&gt;<br>
&gt;&gt; &gt;&gt; &gt;&gt; Please don&#39;t cross-post to the vtk-developers list, since that list<br>
&gt;&gt; &gt;&gt; &gt;&gt; is<br>
&gt;&gt; &gt;&gt; &gt;&gt; only for developer issues.<br>
&gt;&gt; &gt;&gt; &gt;&gt;<br>
&gt;&gt; &gt;&gt; &gt;&gt; Mixing polygonal objects with software ray-cast volume rendering is<br>
&gt;&gt; &gt;&gt; &gt;&gt; an<br>
&gt;&gt; &gt;&gt; &gt;&gt; expensive process, it involves reading a partially rendered scene<br>
&gt;&gt; &gt;&gt; &gt;&gt; from<br>
&gt;&gt; &gt;&gt; &gt;&gt; the video card back to main memory and re-doing the volume rendering<br>
&gt;&gt; &gt;&gt; &gt;&gt; using the information in the depth buffer.  Every time the object<br>
&gt;&gt; &gt;&gt; &gt;&gt; moves, the ray-cast has to be redone.<br>
&gt;&gt; &gt;&gt; &gt;&gt;<br>
&gt;&gt; &gt;&gt; &gt;&gt; If you need fast volume rendering intermixed with polydata, you<br>
&gt;&gt; &gt;&gt; &gt;&gt; should<br>
&gt;&gt; &gt;&gt; &gt;&gt; use vtkVolumeTextureMapper3D or vtkVolumeTextureMapper2D.  These<br>
&gt;&gt; &gt;&gt; &gt;&gt; volume mappers do all of the polydata/volume intermixing right on<br>
&gt;&gt; &gt;&gt; &gt;&gt; the<br>
&gt;&gt; &gt;&gt; &gt;&gt; graphics cards.<br>
&gt;&gt; &gt;&gt; &gt;&gt;<br>
&gt;&gt; &gt;&gt; &gt;&gt; What I often do is use a vtkLODProp3D so that I can use the texture<br>
&gt;&gt; &gt;&gt; &gt;&gt; volume rendering when I&#39;m dragging things, but have it automatically<br>
&gt;&gt; &gt;&gt; &gt;&gt; switch to ray-casting when I stop dragging the mouse.<br>
&gt;&gt; &gt;&gt; &gt;&gt;<br>
&gt;&gt; &gt;&gt; &gt;&gt;  David<br>
&gt;&gt; &gt;&gt; &gt;&gt;<br>
&gt;&gt; &gt;&gt; &gt;&gt;<br>
&gt;&gt; &gt;&gt; &gt;&gt; On Fri, Jan 22, 2010 at 1:33 PM, Fauze Polpeta<br>
&gt;&gt; &gt;&gt; &gt;&gt; &lt;<a href="mailto:fauze.polpeta@gmail.com">fauze.polpeta@gmail.com</a>&gt;<br>
&gt;&gt; &gt;&gt; &gt;&gt; wrote:<br>
&gt;&gt; &gt;&gt; &gt;&gt; &gt; Dear VTK Users;<br>
&gt;&gt; &gt;&gt; &gt;&gt; &gt; I have worked on a project that requires a Polygonal Object ( or<br>
&gt;&gt; &gt;&gt; &gt;&gt; &gt; at<br>
&gt;&gt; &gt;&gt; &gt;&gt; &gt; least a<br>
&gt;&gt; &gt;&gt; &gt;&gt; &gt; simple Line ) to be moved on the fly on a volume rendered scene<br>
&gt;&gt; &gt;&gt; &gt;&gt; &gt; built<br>
&gt;&gt; &gt;&gt; &gt;&gt; &gt; on<br>
&gt;&gt; &gt;&gt; &gt;&gt; &gt; top<br>
&gt;&gt; &gt;&gt; &gt;&gt; &gt; of a vtkVolumeRayCastMapper abstraction.<br>
&gt;&gt; &gt;&gt; &gt;&gt; &gt; This goal was successfully reached but we have faced a drastic<br>
&gt;&gt; &gt;&gt; &gt;&gt; &gt; performance<br>
&gt;&gt; &gt;&gt; &gt;&gt; &gt; degradation when moving the polygonal object into/across the<br>
&gt;&gt; &gt;&gt; &gt;&gt; &gt; volume<br>
&gt;&gt; &gt;&gt; &gt;&gt; &gt; scene.<br>
&gt;&gt; &gt;&gt; &gt;&gt; &gt; We have assumed this is a consequence of the VTK&#39;s pipeline<br>
&gt;&gt; &gt;&gt; &gt;&gt; &gt;  processing<br>
&gt;&gt; &gt;&gt; &gt;&gt; &gt; model. If anyone confirm that, we would like to ask any help in<br>
&gt;&gt; &gt;&gt; &gt;&gt; &gt; the<br>
&gt;&gt; &gt;&gt; &gt;&gt; &gt; sense of<br>
&gt;&gt; &gt;&gt; &gt;&gt; &gt; pointing any strategy for achieving any (minimal) performance<br>
&gt;&gt; &gt;&gt; &gt;&gt; &gt; improvement.<br>
&gt;&gt; &gt;&gt; &gt;&gt; &gt; Perhaps, getting the OpenGL Context and rendering our polygonal<br>
&gt;&gt; &gt;&gt; &gt;&gt; &gt; object<br>
&gt;&gt; &gt;&gt; &gt;&gt; &gt; using<br>
&gt;&gt; &gt;&gt; &gt;&gt; &gt; OpenGL commands; thus skipping the VTK&#39;s pipeline processing. Is<br>
&gt;&gt; &gt;&gt; &gt;&gt; &gt; this<br>
&gt;&gt; &gt;&gt; &gt;&gt; &gt; feasible?<br>
&gt;&gt; &gt;&gt; &gt;&gt; &gt; Thanks in advance for any help.<br>
&gt;&gt; &gt;&gt; &gt;&gt; &gt; Regards,<br>
&gt;&gt; &gt;&gt; &gt;&gt; &gt; Fauze<br>
&gt;&gt; &gt;&gt; &gt;&gt; &gt; _______________________________________________<br>
&gt;&gt; &gt;&gt; &gt;&gt; &gt; Powered by <a href="http://www.kitware.com" target="_blank">www.kitware.com</a><br>
&gt;&gt; &gt;&gt; &gt;&gt; &gt;<br>
&gt;&gt; &gt;&gt; &gt;&gt; &gt; Visit other Kitware open-source projects at<br>
&gt;&gt; &gt;&gt; &gt;&gt; &gt; <a href="http://www.kitware.com/opensource/opensource.html" target="_blank">http://www.kitware.com/opensource/opensource.html</a><br>
&gt;&gt; &gt;&gt; &gt;&gt; &gt;<br>
&gt;&gt; &gt;&gt; &gt;&gt; &gt; Please keep messages on-topic and check the VTK FAQ at:<br>
&gt;&gt; &gt;&gt; &gt;&gt; &gt; <a href="http://www.vtk.org/Wiki/VTK_FAQ" target="_blank">http://www.vtk.org/Wiki/VTK_FAQ</a><br>
&gt;&gt; &gt;&gt; &gt;&gt; &gt;<br>
&gt;&gt; &gt;&gt; &gt;&gt; &gt; Follow this link to subscribe/unsubscribe:<br>
&gt;&gt; &gt;&gt; &gt;&gt; &gt; <a href="http://www.vtk.org/mailman/listinfo/vtkusers" target="_blank">http://www.vtk.org/mailman/listinfo/vtkusers</a><br>
&gt;&gt; &gt;&gt; &gt;&gt; &gt;<br>
&gt;&gt; &gt;&gt; &gt;&gt; &gt;<br>
&gt;&gt; &gt;&gt; &gt;<br>
&gt;&gt; &gt;&gt; &gt;<br>
&gt;&gt; &gt;<br>
&gt;&gt; &gt;<br>
&gt;&gt; _______________________________________________<br>
&gt;&gt; Powered by <a href="http://www.kitware.com" target="_blank">www.kitware.com</a><br>
&gt;&gt;<br>
&gt;&gt; Visit other Kitware open-source projects at<br>
&gt;&gt; <a href="http://www.kitware.com/opensource/opensource.html" target="_blank">http://www.kitware.com/opensource/opensource.html</a><br>
&gt;&gt;<br>
&gt;&gt; Please keep messages on-topic and check the VTK FAQ at:<br>
&gt;&gt; <a href="http://www.vtk.org/Wiki/VTK_FAQ" target="_blank">http://www.vtk.org/Wiki/VTK_FAQ</a><br>
&gt;&gt;<br>
&gt;&gt; Follow this link to subscribe/unsubscribe:<br>
&gt;&gt; <a href="http://www.vtk.org/mailman/listinfo/vtkusers" target="_blank">http://www.vtk.org/mailman/listinfo/vtkusers</a><br>
&gt;<br>
&gt;<br>
&gt;<br>
&gt; --<br>
&gt; William J. Schroeder, PhD<br>
&gt; Kitware, Inc.<br>
&gt; 28 Corporate Drive<br>
&gt; Clifton Park, NY 12065<br>
&gt; <a href="mailto:will.schroeder@kitware.com">will.schroeder@kitware.com</a><br>
&gt; <a href="http://www.kitware.com" target="_blank">http://www.kitware.com</a><br>
&gt; (518) 881-4902<br>
&gt;<br>
</div></div></blockquote></div><br></div>