<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://www.na-mic.org/w/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Sankhesh</id>
	<title>NAMIC Wiki - User contributions [en]</title>
	<link rel="self" type="application/atom+xml" href="https://www.na-mic.org/w/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Sankhesh"/>
	<link rel="alternate" type="text/html" href="https://www.na-mic.org/wiki/Special:Contributions/Sankhesh"/>
	<updated>2026-06-08T11:43:00Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.33.0</generator>
	<entry>
		<id>https://www.na-mic.org/w/index.php?title=Project_Week_25/Next_Generation_GPU_Volume_Rendering&amp;diff=96765</id>
		<title>Project Week 25/Next Generation GPU Volume Rendering</title>
		<link rel="alternate" type="text/html" href="https://www.na-mic.org/w/index.php?title=Project_Week_25/Next_Generation_GPU_Volume_Rendering&amp;diff=96765"/>
		<updated>2017-06-28T17:16:34Z</updated>

		<summary type="html">&lt;p&gt;Sankhesh: /* Addendum */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__NOTOC__&lt;br /&gt;
&lt;br /&gt;
 Back to [[Project_Week_25#Projects|Projects List]]&lt;br /&gt;
&lt;br /&gt;
==Key Investigators==&lt;br /&gt;
* [http://nist.mni.mcgill.ca/?page_id=369 Simon Drouin] (Montreal Neurological Institute, Canada)&lt;br /&gt;
* [http://www.spl.harvard.edu/pages/People/pieper Steve Pieper ] (Isomics Inc., USA)&lt;br /&gt;
* [http://perk.cs.queensu.ca/users/lasso Andras Lasso] (Queen's University, Canada)&lt;br /&gt;
* [http://www.sintef.no/en/all-employees/employee/?empId=541 Ole Vegard Solberg] (SINTEF, Norway)&lt;br /&gt;
* [https://www.kitware.com/alvaro-sanchez/ Alvaro Sanchez] (Kitware Inc., USA &amp;lt;i&amp;gt;Remote attendance&amp;lt;/i&amp;gt;)&lt;br /&gt;
* [https://www.kitware.com/sankhesh-jhaveri/ Sankhesh Jhaveri] (Kitware Inc., USA &amp;lt;i&amp;gt;Remote attendance&amp;lt;/i&amp;gt;)&lt;br /&gt;
&lt;br /&gt;
==Project Description==&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! style=&amp;quot;text-align: left; width:27%&amp;quot; |   Objective&lt;br /&gt;
! style=&amp;quot;text-align: left; width:27%&amp;quot; |   Approach and Plan&lt;br /&gt;
! style=&amp;quot;text-align: left; width:27%&amp;quot; |   Progress and Next Steps&lt;br /&gt;
|- style=&amp;quot;vertical-align:top;&amp;quot;&lt;br /&gt;
|&lt;br /&gt;
&amp;lt;!-- Objective bullet points --&amp;gt;&lt;br /&gt;
Develop a specification for the next generation of GPU volume processing and rendering in VTK and Slicer&lt;br /&gt;
&lt;br /&gt;
The specification should support&lt;br /&gt;
&lt;br /&gt;
* Multiple input volumes for ray-casting and slice-based volume rendering&lt;br /&gt;
* GPU-based volume slicing and compositing&lt;br /&gt;
* Programmable volume rendering shader&lt;br /&gt;
* Smart management of volumes in GPU memory&lt;br /&gt;
* Possibility to run simple processing operations on the volume (e.g. Non-linear transforms)&lt;br /&gt;
* Consider possible complications&lt;br /&gt;
** GPU features not available / software only fallback&lt;br /&gt;
** Volumes too big to for GPU memory&lt;br /&gt;
|&lt;br /&gt;
&amp;lt;!-- Approach and Plan bullet points --&amp;gt;&lt;br /&gt;
Compare the architectures of different existing projects where parts of the required functionality has been implemented:&lt;br /&gt;
&lt;br /&gt;
* [http://ibisneuronav.org Ibis Neuronav]/PRISM (Multi-volume ray-casting with programmable shaders in VTK)&lt;br /&gt;
* Steve Pieper's volume processing on the GPU with [https://github.com/pieper/CommonGL OpenGL in VTK and GLSL] and with [http://afruehstueck.github.io/TF.html WebGL (with Anna Fruehstueck)] and [https://www.youtube.com/watch?v=wMkuwzA7RDo WebGL2] (see videos below)&lt;br /&gt;
* [https://www.custusx.org/ CustusX ] (GPU volume slicing and compositing with multi-window context sharing)&lt;br /&gt;
 &lt;br /&gt;
Determine a sensible way to integrate all those contribution in VTK.&lt;br /&gt;
|&lt;br /&gt;
&amp;lt;!-- Progress and Next steps (fill out at the end of project week) --&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==Illustrations==&lt;br /&gt;
https://www.dropbox.com/s/bqg1fyd42z6lawn/prism-demo-simon-drouin-imic-2016.mp4?dl=0&lt;br /&gt;
&lt;br /&gt;
3D Image Filters in WebGL2&lt;br /&gt;
&amp;lt;embedvideo service=&amp;quot;youtube&amp;quot;&amp;gt;https://www.youtube.com/watch?v=wMkuwzA7RDo&amp;amp;modestbranding=1&amp;amp;rel=0&amp;lt;/embedvideo&amp;gt;&lt;br /&gt;
Multivolume rendering and nonlinear transforms in WebGL2&lt;br /&gt;
&amp;lt;embedvideo service=&amp;quot;youtube&amp;quot;&amp;gt;https://www.youtube.com/watch?v=ML9_JWAz1kY&amp;amp;modestbranding=1&amp;amp;rel=0&amp;lt;/embedvideo&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Background and References==&lt;br /&gt;
&amp;lt;!-- Use this space for information that may help people better understand your project, like links to papers, source code, or data --&amp;gt;&lt;br /&gt;
[https://docs.google.com/document/d/1-4Up_Shq6oFTGhwXIF5DuiXUYsdIMlAC1oK7eNHWP_o/edit#heading=h.ut6owd65r1fu Some notes about sharing GLSL code between desktop OpenGL and WebGL]&lt;br /&gt;
&lt;br /&gt;
Schott M, Pascal Grosset AV, Martin T, Pegoraro V, Smith ST, Hansen CD. Depth of Field Effects for Interactive Direct Volume Rendering. Comput Graph Forum. 2011 Jun;30(3):941-50. &lt;br /&gt;
&lt;br /&gt;
Volumetric shadows and light scattering:&lt;br /&gt;
&lt;br /&gt;
Kniss J, Premoze S, Hansen C, Shirley P, McPherson A. A model for volume lighting and modeling. IEEE Trans Vis Comput Graph. 2003;9(2):150–62. &lt;br /&gt;
&lt;br /&gt;
Ambiant occlusion (this one should be possible to do with ray casting, but not as efficient):&lt;br /&gt;
&lt;br /&gt;
Hernell F, Ljung P, Ynnerman A. Local Ambient Occlusion in Direct Volume Rendering. IEEE Trans Vis Comput Graph. 2010 Jul;16(4):548–59. &lt;br /&gt;
&lt;br /&gt;
=== Planning hangout June 13 ===&lt;br /&gt;
(Simon, Jc, Alvaro, Sankhesh, Steve, Hina)&lt;br /&gt;
&lt;br /&gt;
Recent features in VTK Volume Rendering (in master, blog post coming)&lt;br /&gt;
* Volume peeling - translucent geometry with volumes in GPU ray cast mapper &lt;br /&gt;
* Render to texture &lt;br /&gt;
* 2D lookup tables (value and gradient magnitude)&lt;br /&gt;
Work in progress&lt;br /&gt;
* Overlapping volumes - multiple inputs to mapper&lt;br /&gt;
* vtk charts to work with 2D transfer functions&lt;br /&gt;
&lt;br /&gt;
Slicer to migrate to latest version once cmake hierarchy is sorted out (Jc)&lt;br /&gt;
&lt;br /&gt;
Questions / discussion points:&lt;br /&gt;
* Ray cast vs view aligned plane-based algorithms&lt;br /&gt;
** depth of focus, shadows, diffuse lighting...&lt;br /&gt;
** How to integrate multiple features&lt;br /&gt;
* Nonlinear transformation&lt;br /&gt;
* Custom shaders&lt;br /&gt;
* Dynamic shader generation in python&lt;br /&gt;
* multiple components&lt;br /&gt;
** RGBA&lt;br /&gt;
** Independent components?&lt;br /&gt;
* 2D lookup tables&lt;br /&gt;
* Volumes that live on the GPU&lt;br /&gt;
** sharing across contexts&lt;br /&gt;
** use as input textures and render targets&lt;br /&gt;
** tiling?&lt;br /&gt;
** streaming?&lt;br /&gt;
* Large volumes?&lt;br /&gt;
* Mesa backend?&lt;br /&gt;
** Offscreen support for OpenGL2 backend should work in VTK now&lt;br /&gt;
&lt;br /&gt;
=== Hangout at Project Week ===&lt;br /&gt;
&lt;br /&gt;
* Attendees: Alvaro, Sankhesh, Aashish, Andras, Steve, Jc, Simon, Ole&lt;br /&gt;
&lt;br /&gt;
* Open Questions:&lt;br /&gt;
** What is best to accomplish at Project Week?&lt;br /&gt;
** What architecture is best for the future and how can we get there?&lt;br /&gt;
&lt;br /&gt;
* Alvero announced that volume peeling supports the OpenGL render pass, which could support custom shaders&lt;br /&gt;
** two calls: Prereplace and Postreplace (as in vtkPolyDataMapper)&lt;br /&gt;
** newer OpenGL2 version is much more flexible than the older version in OpenGL1&lt;br /&gt;
** allows user to replace parts of the rending process&lt;br /&gt;
&lt;br /&gt;
* Need to be able to change &lt;br /&gt;
** per-sample ray accumulating value&lt;br /&gt;
** compositing function&lt;br /&gt;
** initialization of ray path parameters&lt;br /&gt;
** control over when ray terminates&lt;br /&gt;
** uniforms&lt;br /&gt;
** textures&lt;br /&gt;
&lt;br /&gt;
* RenderPath vs RenderTags example?&lt;br /&gt;
** Pattern is used in the vtk volume rendering mapper&lt;br /&gt;
** existing implementation serves as a working example for customization&lt;br /&gt;
** may need to define new spots to inject code (TBD)&lt;br /&gt;
&lt;br /&gt;
Debugging&lt;br /&gt;
** Pattern to add unique identifiers to shader variables&lt;br /&gt;
** There are vtk hooks to help debug&lt;br /&gt;
** Access to compiler errors, and full shader scene&lt;br /&gt;
** Can use an apitrace program (linux and mac) to track opengl state&lt;br /&gt;
&lt;br /&gt;
How to make it easier to customize?&lt;br /&gt;
** e.g. coloring samples by depth for 4D US&lt;br /&gt;
** high level API?&lt;br /&gt;
** set of worked out examples for common use cases&lt;br /&gt;
&lt;br /&gt;
Next steps&lt;br /&gt;
* At project week:&lt;br /&gt;
** collect examples of things that should be simple&lt;br /&gt;
** provide feedback and suggestions to vtk developer&lt;br /&gt;
* At Kitware:&lt;br /&gt;
** propose a high level API for feedback&lt;br /&gt;
** multiple overlapping volumes&lt;br /&gt;
** look at sharing volumes across mappers (class to represent a volume in memory)&lt;br /&gt;
** shared GL context (see CustusX for worked out example of a &amp;quot;hacked in&amp;quot; way to support this)&lt;br /&gt;
&lt;br /&gt;
Long-Term&lt;br /&gt;
* Be able to create volume processing pipelines that connect CPU and GPU processing seemlessly&lt;br /&gt;
* Investigate the capabilities of vtk-m&lt;br /&gt;
&lt;br /&gt;
===== Addendum =====&lt;br /&gt;
* [https://blog.kitware.com/vtk-8-0-0/ VTK 8.0.0 release notes]&lt;br /&gt;
* [http://m.vtk.org/ VTK-M]&lt;/div&gt;</summary>
		<author><name>Sankhesh</name></author>
		
	</entry>
	<entry>
		<id>https://www.na-mic.org/w/index.php?title=Project_Week_25/Next_Generation_GPU_Volume_Rendering&amp;diff=96764</id>
		<title>Project Week 25/Next Generation GPU Volume Rendering</title>
		<link rel="alternate" type="text/html" href="https://www.na-mic.org/w/index.php?title=Project_Week_25/Next_Generation_GPU_Volume_Rendering&amp;diff=96764"/>
		<updated>2017-06-28T17:15:54Z</updated>

		<summary type="html">&lt;p&gt;Sankhesh: /* Hangout at Project Week */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__NOTOC__&lt;br /&gt;
&lt;br /&gt;
 Back to [[Project_Week_25#Projects|Projects List]]&lt;br /&gt;
&lt;br /&gt;
==Key Investigators==&lt;br /&gt;
* [http://nist.mni.mcgill.ca/?page_id=369 Simon Drouin] (Montreal Neurological Institute, Canada)&lt;br /&gt;
* [http://www.spl.harvard.edu/pages/People/pieper Steve Pieper ] (Isomics Inc., USA)&lt;br /&gt;
* [http://perk.cs.queensu.ca/users/lasso Andras Lasso] (Queen's University, Canada)&lt;br /&gt;
* [http://www.sintef.no/en/all-employees/employee/?empId=541 Ole Vegard Solberg] (SINTEF, Norway)&lt;br /&gt;
* [https://www.kitware.com/alvaro-sanchez/ Alvaro Sanchez] (Kitware Inc., USA &amp;lt;i&amp;gt;Remote attendance&amp;lt;/i&amp;gt;)&lt;br /&gt;
* [https://www.kitware.com/sankhesh-jhaveri/ Sankhesh Jhaveri] (Kitware Inc., USA &amp;lt;i&amp;gt;Remote attendance&amp;lt;/i&amp;gt;)&lt;br /&gt;
&lt;br /&gt;
==Project Description==&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! style=&amp;quot;text-align: left; width:27%&amp;quot; |   Objective&lt;br /&gt;
! style=&amp;quot;text-align: left; width:27%&amp;quot; |   Approach and Plan&lt;br /&gt;
! style=&amp;quot;text-align: left; width:27%&amp;quot; |   Progress and Next Steps&lt;br /&gt;
|- style=&amp;quot;vertical-align:top;&amp;quot;&lt;br /&gt;
|&lt;br /&gt;
&amp;lt;!-- Objective bullet points --&amp;gt;&lt;br /&gt;
Develop a specification for the next generation of GPU volume processing and rendering in VTK and Slicer&lt;br /&gt;
&lt;br /&gt;
The specification should support&lt;br /&gt;
&lt;br /&gt;
* Multiple input volumes for ray-casting and slice-based volume rendering&lt;br /&gt;
* GPU-based volume slicing and compositing&lt;br /&gt;
* Programmable volume rendering shader&lt;br /&gt;
* Smart management of volumes in GPU memory&lt;br /&gt;
* Possibility to run simple processing operations on the volume (e.g. Non-linear transforms)&lt;br /&gt;
* Consider possible complications&lt;br /&gt;
** GPU features not available / software only fallback&lt;br /&gt;
** Volumes too big to for GPU memory&lt;br /&gt;
|&lt;br /&gt;
&amp;lt;!-- Approach and Plan bullet points --&amp;gt;&lt;br /&gt;
Compare the architectures of different existing projects where parts of the required functionality has been implemented:&lt;br /&gt;
&lt;br /&gt;
* [http://ibisneuronav.org Ibis Neuronav]/PRISM (Multi-volume ray-casting with programmable shaders in VTK)&lt;br /&gt;
* Steve Pieper's volume processing on the GPU with [https://github.com/pieper/CommonGL OpenGL in VTK and GLSL] and with [http://afruehstueck.github.io/TF.html WebGL (with Anna Fruehstueck)] and [https://www.youtube.com/watch?v=wMkuwzA7RDo WebGL2] (see videos below)&lt;br /&gt;
* [https://www.custusx.org/ CustusX ] (GPU volume slicing and compositing with multi-window context sharing)&lt;br /&gt;
 &lt;br /&gt;
Determine a sensible way to integrate all those contribution in VTK.&lt;br /&gt;
|&lt;br /&gt;
&amp;lt;!-- Progress and Next steps (fill out at the end of project week) --&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==Illustrations==&lt;br /&gt;
https://www.dropbox.com/s/bqg1fyd42z6lawn/prism-demo-simon-drouin-imic-2016.mp4?dl=0&lt;br /&gt;
&lt;br /&gt;
3D Image Filters in WebGL2&lt;br /&gt;
&amp;lt;embedvideo service=&amp;quot;youtube&amp;quot;&amp;gt;https://www.youtube.com/watch?v=wMkuwzA7RDo&amp;amp;modestbranding=1&amp;amp;rel=0&amp;lt;/embedvideo&amp;gt;&lt;br /&gt;
Multivolume rendering and nonlinear transforms in WebGL2&lt;br /&gt;
&amp;lt;embedvideo service=&amp;quot;youtube&amp;quot;&amp;gt;https://www.youtube.com/watch?v=ML9_JWAz1kY&amp;amp;modestbranding=1&amp;amp;rel=0&amp;lt;/embedvideo&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Background and References==&lt;br /&gt;
&amp;lt;!-- Use this space for information that may help people better understand your project, like links to papers, source code, or data --&amp;gt;&lt;br /&gt;
[https://docs.google.com/document/d/1-4Up_Shq6oFTGhwXIF5DuiXUYsdIMlAC1oK7eNHWP_o/edit#heading=h.ut6owd65r1fu Some notes about sharing GLSL code between desktop OpenGL and WebGL]&lt;br /&gt;
&lt;br /&gt;
Schott M, Pascal Grosset AV, Martin T, Pegoraro V, Smith ST, Hansen CD. Depth of Field Effects for Interactive Direct Volume Rendering. Comput Graph Forum. 2011 Jun;30(3):941-50. &lt;br /&gt;
&lt;br /&gt;
Volumetric shadows and light scattering:&lt;br /&gt;
&lt;br /&gt;
Kniss J, Premoze S, Hansen C, Shirley P, McPherson A. A model for volume lighting and modeling. IEEE Trans Vis Comput Graph. 2003;9(2):150–62. &lt;br /&gt;
&lt;br /&gt;
Ambiant occlusion (this one should be possible to do with ray casting, but not as efficient):&lt;br /&gt;
&lt;br /&gt;
Hernell F, Ljung P, Ynnerman A. Local Ambient Occlusion in Direct Volume Rendering. IEEE Trans Vis Comput Graph. 2010 Jul;16(4):548–59. &lt;br /&gt;
&lt;br /&gt;
=== Planning hangout June 13 ===&lt;br /&gt;
(Simon, Jc, Alvaro, Sankhesh, Steve, Hina)&lt;br /&gt;
&lt;br /&gt;
Recent features in VTK Volume Rendering (in master, blog post coming)&lt;br /&gt;
* Volume peeling - translucent geometry with volumes in GPU ray cast mapper &lt;br /&gt;
* Render to texture &lt;br /&gt;
* 2D lookup tables (value and gradient magnitude)&lt;br /&gt;
Work in progress&lt;br /&gt;
* Overlapping volumes - multiple inputs to mapper&lt;br /&gt;
* vtk charts to work with 2D transfer functions&lt;br /&gt;
&lt;br /&gt;
Slicer to migrate to latest version once cmake hierarchy is sorted out (Jc)&lt;br /&gt;
&lt;br /&gt;
Questions / discussion points:&lt;br /&gt;
* Ray cast vs view aligned plane-based algorithms&lt;br /&gt;
** depth of focus, shadows, diffuse lighting...&lt;br /&gt;
** How to integrate multiple features&lt;br /&gt;
* Nonlinear transformation&lt;br /&gt;
* Custom shaders&lt;br /&gt;
* Dynamic shader generation in python&lt;br /&gt;
* multiple components&lt;br /&gt;
** RGBA&lt;br /&gt;
** Independent components?&lt;br /&gt;
* 2D lookup tables&lt;br /&gt;
* Volumes that live on the GPU&lt;br /&gt;
** sharing across contexts&lt;br /&gt;
** use as input textures and render targets&lt;br /&gt;
** tiling?&lt;br /&gt;
** streaming?&lt;br /&gt;
* Large volumes?&lt;br /&gt;
* Mesa backend?&lt;br /&gt;
** Offscreen support for OpenGL2 backend should work in VTK now&lt;br /&gt;
&lt;br /&gt;
=== Hangout at Project Week ===&lt;br /&gt;
&lt;br /&gt;
* Attendees: Alvaro, Sankhesh, Aashish, Andras, Steve, Jc, Simon, Ole&lt;br /&gt;
&lt;br /&gt;
* Open Questions:&lt;br /&gt;
** What is best to accomplish at Project Week?&lt;br /&gt;
** What architecture is best for the future and how can we get there?&lt;br /&gt;
&lt;br /&gt;
* Alvero announced that volume peeling supports the OpenGL render pass, which could support custom shaders&lt;br /&gt;
** two calls: Prereplace and Postreplace (as in vtkPolyDataMapper)&lt;br /&gt;
** newer OpenGL2 version is much more flexible than the older version in OpenGL1&lt;br /&gt;
** allows user to replace parts of the rending process&lt;br /&gt;
&lt;br /&gt;
* Need to be able to change &lt;br /&gt;
** per-sample ray accumulating value&lt;br /&gt;
** compositing function&lt;br /&gt;
** initialization of ray path parameters&lt;br /&gt;
** control over when ray terminates&lt;br /&gt;
** uniforms&lt;br /&gt;
** textures&lt;br /&gt;
&lt;br /&gt;
* RenderPath vs RenderTags example?&lt;br /&gt;
** Pattern is used in the vtk volume rendering mapper&lt;br /&gt;
** existing implementation serves as a working example for customization&lt;br /&gt;
** may need to define new spots to inject code (TBD)&lt;br /&gt;
&lt;br /&gt;
Debugging&lt;br /&gt;
** Pattern to add unique identifiers to shader variables&lt;br /&gt;
** There are vtk hooks to help debug&lt;br /&gt;
** Access to compiler errors, and full shader scene&lt;br /&gt;
** Can use an apitrace program (linux and mac) to track opengl state&lt;br /&gt;
&lt;br /&gt;
How to make it easier to customize?&lt;br /&gt;
** e.g. coloring samples by depth for 4D US&lt;br /&gt;
** high level API?&lt;br /&gt;
** set of worked out examples for common use cases&lt;br /&gt;
&lt;br /&gt;
Next steps&lt;br /&gt;
* At project week:&lt;br /&gt;
** collect examples of things that should be simple&lt;br /&gt;
** provide feedback and suggestions to vtk developer&lt;br /&gt;
* At Kitware:&lt;br /&gt;
** propose a high level API for feedback&lt;br /&gt;
** multiple overlapping volumes&lt;br /&gt;
** look at sharing volumes across mappers (class to represent a volume in memory)&lt;br /&gt;
** shared GL context (see CustusX for worked out example of a &amp;quot;hacked in&amp;quot; way to support this)&lt;br /&gt;
&lt;br /&gt;
Long-Term&lt;br /&gt;
* Be able to create volume processing pipelines that connect CPU and GPU processing seemlessly&lt;br /&gt;
* Investigate the capabilities of vtk-m&lt;br /&gt;
&lt;br /&gt;
===== Addendum =====&lt;br /&gt;
* [https://blog.kitware.com/vtk-8-0-0/ VTK 8.0.0 release notes]&lt;br /&gt;
* [http://m.vtk.org/ VTK-m]&lt;/div&gt;</summary>
		<author><name>Sankhesh</name></author>
		
	</entry>
	<entry>
		<id>https://www.na-mic.org/w/index.php?title=Project_Week_25/Next_Generation_GPU_Volume_Rendering&amp;diff=96763</id>
		<title>Project Week 25/Next Generation GPU Volume Rendering</title>
		<link rel="alternate" type="text/html" href="https://www.na-mic.org/w/index.php?title=Project_Week_25/Next_Generation_GPU_Volume_Rendering&amp;diff=96763"/>
		<updated>2017-06-28T17:07:04Z</updated>

		<summary type="html">&lt;p&gt;Sankhesh: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__NOTOC__&lt;br /&gt;
&lt;br /&gt;
 Back to [[Project_Week_25#Projects|Projects List]]&lt;br /&gt;
&lt;br /&gt;
==Key Investigators==&lt;br /&gt;
* [http://nist.mni.mcgill.ca/?page_id=369 Simon Drouin] (Montreal Neurological Institute, Canada)&lt;br /&gt;
* [http://www.spl.harvard.edu/pages/People/pieper Steve Pieper ] (Isomics Inc., USA)&lt;br /&gt;
* [http://perk.cs.queensu.ca/users/lasso Andras Lasso] (Queen's University, Canada)&lt;br /&gt;
* [http://www.sintef.no/en/all-employees/employee/?empId=541 Ole Vegard Solberg] (SINTEF, Norway)&lt;br /&gt;
* [https://www.kitware.com/alvaro-sanchez/ Alvaro Sanchez] (Kitware Inc., USA &amp;lt;i&amp;gt;Remote attendance&amp;lt;/i&amp;gt;)&lt;br /&gt;
* [https://www.kitware.com/sankhesh-jhaveri/ Sankhesh Jhaveri] (Kitware Inc., USA &amp;lt;i&amp;gt;Remote attendance&amp;lt;/i&amp;gt;)&lt;br /&gt;
&lt;br /&gt;
==Project Description==&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! style=&amp;quot;text-align: left; width:27%&amp;quot; |   Objective&lt;br /&gt;
! style=&amp;quot;text-align: left; width:27%&amp;quot; |   Approach and Plan&lt;br /&gt;
! style=&amp;quot;text-align: left; width:27%&amp;quot; |   Progress and Next Steps&lt;br /&gt;
|- style=&amp;quot;vertical-align:top;&amp;quot;&lt;br /&gt;
|&lt;br /&gt;
&amp;lt;!-- Objective bullet points --&amp;gt;&lt;br /&gt;
Develop a specification for the next generation of GPU volume processing and rendering in VTK and Slicer&lt;br /&gt;
&lt;br /&gt;
The specification should support&lt;br /&gt;
&lt;br /&gt;
* Multiple input volumes for ray-casting and slice-based volume rendering&lt;br /&gt;
* GPU-based volume slicing and compositing&lt;br /&gt;
* Programmable volume rendering shader&lt;br /&gt;
* Smart management of volumes in GPU memory&lt;br /&gt;
* Possibility to run simple processing operations on the volume (e.g. Non-linear transforms)&lt;br /&gt;
* Consider possible complications&lt;br /&gt;
** GPU features not available / software only fallback&lt;br /&gt;
** Volumes too big to for GPU memory&lt;br /&gt;
|&lt;br /&gt;
&amp;lt;!-- Approach and Plan bullet points --&amp;gt;&lt;br /&gt;
Compare the architectures of different existing projects where parts of the required functionality has been implemented:&lt;br /&gt;
&lt;br /&gt;
* [http://ibisneuronav.org Ibis Neuronav]/PRISM (Multi-volume ray-casting with programmable shaders in VTK)&lt;br /&gt;
* Steve Pieper's volume processing on the GPU with [https://github.com/pieper/CommonGL OpenGL in VTK and GLSL] and with [http://afruehstueck.github.io/TF.html WebGL (with Anna Fruehstueck)] and [https://www.youtube.com/watch?v=wMkuwzA7RDo WebGL2] (see videos below)&lt;br /&gt;
* [https://www.custusx.org/ CustusX ] (GPU volume slicing and compositing with multi-window context sharing)&lt;br /&gt;
 &lt;br /&gt;
Determine a sensible way to integrate all those contribution in VTK.&lt;br /&gt;
|&lt;br /&gt;
&amp;lt;!-- Progress and Next steps (fill out at the end of project week) --&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==Illustrations==&lt;br /&gt;
https://www.dropbox.com/s/bqg1fyd42z6lawn/prism-demo-simon-drouin-imic-2016.mp4?dl=0&lt;br /&gt;
&lt;br /&gt;
3D Image Filters in WebGL2&lt;br /&gt;
&amp;lt;embedvideo service=&amp;quot;youtube&amp;quot;&amp;gt;https://www.youtube.com/watch?v=wMkuwzA7RDo&amp;amp;modestbranding=1&amp;amp;rel=0&amp;lt;/embedvideo&amp;gt;&lt;br /&gt;
Multivolume rendering and nonlinear transforms in WebGL2&lt;br /&gt;
&amp;lt;embedvideo service=&amp;quot;youtube&amp;quot;&amp;gt;https://www.youtube.com/watch?v=ML9_JWAz1kY&amp;amp;modestbranding=1&amp;amp;rel=0&amp;lt;/embedvideo&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Background and References==&lt;br /&gt;
&amp;lt;!-- Use this space for information that may help people better understand your project, like links to papers, source code, or data --&amp;gt;&lt;br /&gt;
[https://docs.google.com/document/d/1-4Up_Shq6oFTGhwXIF5DuiXUYsdIMlAC1oK7eNHWP_o/edit#heading=h.ut6owd65r1fu Some notes about sharing GLSL code between desktop OpenGL and WebGL]&lt;br /&gt;
&lt;br /&gt;
Schott M, Pascal Grosset AV, Martin T, Pegoraro V, Smith ST, Hansen CD. Depth of Field Effects for Interactive Direct Volume Rendering. Comput Graph Forum. 2011 Jun;30(3):941-50. &lt;br /&gt;
&lt;br /&gt;
Volumetric shadows and light scattering:&lt;br /&gt;
&lt;br /&gt;
Kniss J, Premoze S, Hansen C, Shirley P, McPherson A. A model for volume lighting and modeling. IEEE Trans Vis Comput Graph. 2003;9(2):150–62. &lt;br /&gt;
&lt;br /&gt;
Ambiant occlusion (this one should be possible to do with ray casting, but not as efficient):&lt;br /&gt;
&lt;br /&gt;
Hernell F, Ljung P, Ynnerman A. Local Ambient Occlusion in Direct Volume Rendering. IEEE Trans Vis Comput Graph. 2010 Jul;16(4):548–59. &lt;br /&gt;
&lt;br /&gt;
=== Planning hangout June 13 ===&lt;br /&gt;
(Simon, Jc, Alvaro, Sankhesh, Steve, Hina)&lt;br /&gt;
&lt;br /&gt;
Recent features in VTK Volume Rendering (in master, blog post coming)&lt;br /&gt;
* Volume peeling - translucent geometry with volumes in GPU ray cast mapper &lt;br /&gt;
* Render to texture &lt;br /&gt;
* 2D lookup tables (value and gradient magnitude)&lt;br /&gt;
Work in progress&lt;br /&gt;
* Overlapping volumes - multiple inputs to mapper&lt;br /&gt;
* vtk charts to work with 2D transfer functions&lt;br /&gt;
&lt;br /&gt;
Slicer to migrate to latest version once cmake hierarchy is sorted out (Jc)&lt;br /&gt;
&lt;br /&gt;
Questions / discussion points:&lt;br /&gt;
* Ray cast vs view aligned plane-based algorithms&lt;br /&gt;
** depth of focus, shadows, diffuse lighting...&lt;br /&gt;
** How to integrate multiple features&lt;br /&gt;
* Nonlinear transformation&lt;br /&gt;
* Custom shaders&lt;br /&gt;
* Dynamic shader generation in python&lt;br /&gt;
* multiple components&lt;br /&gt;
** RGBA&lt;br /&gt;
** Independent components?&lt;br /&gt;
* 2D lookup tables&lt;br /&gt;
* Volumes that live on the GPU&lt;br /&gt;
** sharing across contexts&lt;br /&gt;
** use as input textures and render targets&lt;br /&gt;
** tiling?&lt;br /&gt;
** streaming?&lt;br /&gt;
* Large volumes?&lt;br /&gt;
* Mesa backend?&lt;br /&gt;
** Offscreen support for OpenGL2 backend should work in VTK now&lt;br /&gt;
&lt;br /&gt;
=== Hangout at Project Week ===&lt;br /&gt;
&lt;br /&gt;
* Attendees: Alvaro, Sankhesh, Aashish, Andras, Steve, Jc, Simon, Ole&lt;br /&gt;
&lt;br /&gt;
* Open Questions:&lt;br /&gt;
** What is best to accomplish at Project Week?&lt;br /&gt;
** What architecture is best for the future and how can we get there?&lt;br /&gt;
&lt;br /&gt;
* Alvero announced that volume peeling supports the OpenGL render pass, which could support custom shaders&lt;br /&gt;
** two calls: Prereplace and Postreplace (as in vtkPolyDataMapper)&lt;br /&gt;
** newer OpenGL2 version is much more flexible than the older version in OpenGL1&lt;br /&gt;
** allows user to replace parts of the rending process&lt;br /&gt;
&lt;br /&gt;
* Need to be able to change &lt;br /&gt;
** per-sample ray accumulating value&lt;br /&gt;
** compositing function&lt;br /&gt;
** initialization of ray path parameters&lt;br /&gt;
** control over when ray terminates&lt;br /&gt;
** uniforms&lt;br /&gt;
** textures&lt;br /&gt;
&lt;br /&gt;
* RenderPath vs RenderTags example?&lt;br /&gt;
** Pattern is used in the vtk volume rendering mapper&lt;br /&gt;
** existing implementation serves as a working example for customization&lt;br /&gt;
** may need to define new spots to inject code (TBD)&lt;br /&gt;
&lt;br /&gt;
Debugging&lt;br /&gt;
** Pattern to add unique identifiers to shader variables&lt;br /&gt;
** There are vtk hooks to help debug&lt;br /&gt;
** Access to compiler errors, and full shader scene&lt;br /&gt;
** Can use an apitrace program (linux and mac) to track opengl state&lt;br /&gt;
&lt;br /&gt;
How to make it easier to customize?&lt;br /&gt;
** e.g. coloring samples by depth for 4D US&lt;br /&gt;
** high level API?&lt;br /&gt;
** set of worked out examples for common use cases&lt;br /&gt;
&lt;br /&gt;
Next steps&lt;br /&gt;
* At project week:&lt;br /&gt;
** collect examples of things that should be simple&lt;br /&gt;
** provide feedback and suggestions to vtk developer&lt;br /&gt;
* At Kitware:&lt;br /&gt;
** propose a high level API for feedback&lt;br /&gt;
** multiple overlapping volumes&lt;br /&gt;
** look at sharing volumes across mappers (class to represent a volume in memory)&lt;br /&gt;
** shared GL context (see CustusX for worked out example of a &amp;quot;hacked in&amp;quot; way to support this)&lt;br /&gt;
&lt;br /&gt;
Long-Term&lt;br /&gt;
* Be able to create volume processing pipelines that connect CPU and GPU processing seemlessly&lt;br /&gt;
* Investigate the capabilities of vtk-m&lt;/div&gt;</summary>
		<author><name>Sankhesh</name></author>
		
	</entry>
</feed>