Difference between revisions of "Documentation/Labs/OpenGLFilters"
(16 intermediate revisions by 3 users not shown) | |||
Line 1: | Line 1: | ||
− | |||
− | + | = Overview = | |
− | + | Here we summarize some efforts for enabling image processing (filtering/smoothing) in VTK/Slicer using OpenGL. | |
− | + | The reason behind this page is trying to coordinate the various projects regarding this subject. | |
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | = | + | = Meetings = |
== 9th June 2016 == | == 9th June 2016 == | ||
− | + | Attended by: Davide Punzo, Jean-Christophe Fillion-Robin, Ken Martin, Utkarsh Ayachit and Robert Maynard | |
+ | |||
+ | Based on an original idea of Steve Pieper | ||
− | In order to | + | |
− | * no | + | In order to implement efficient filtering, OpenGL solution seems the best that fits our needs: |
+ | * no requirement on external library (CUDA or OpenCL). | ||
* performance boosting is fairly good to allow almost interactive filtering up to volume of ~10^8 voxels. | * performance boosting is fairly good to allow almost interactive filtering up to volume of ~10^8 voxels. | ||
− | = Use Case = | + | [[File:2016.06.09 SlicerAstro CPU-vs-GPU Filtering.png]] |
− | + | <br><small>Source: [https://arxiv.org/abs/1609.03782 Finding faint HI structure in and around galaxies: scraping the barrel (Astronomy and Computing accepted)]</small> | |
+ | |||
+ | |||
+ | |||
+ | |||
+ | |||
+ | === Use Case === | ||
+ | |||
+ | Based on the Steve Pieper implementation of the classes: | ||
<pre> | <pre> | ||
Line 33: | Line 37: | ||
<pre> | <pre> | ||
− | https://github.com/Punzo/SlicerAstro/tree/master/ | + | https://github.com/Punzo/SlicerAstro/tree/master/AstroSmoothing/Logic |
− | https:// | + | https://arxiv.org/abs/1609.03782 |
</pre> | </pre> | ||
− | = Full integration in VTK = | + | === Full integration in VTK === |
− | For a full integration of the openGLfilters pipeline in VTK, it will be | + | For a full integration of the openGLfilters pipeline in VTK, it will be ideal to have a general purpose class: |
<pre> | <pre> | ||
Line 46: | Line 50: | ||
this class will have the duty to: | this class will have the duty to: | ||
− | * | + | * handle the I/O communication between the <code>vtkImageData</code> and the GPU Texture using fully the VTK shader infrastructure, since the shader infrastructure is already available in VTK (safe binding, automatic versioning, etc... http://www.vtk.org/Wiki/Shader_In_VTK). |
* child classes will handle different approach (e.g. multipass/iterative filtering). | * child classes will handle different approach (e.g. multipass/iterative filtering). | ||
− | = | + | Ken Martin provided this structure in VTK: [https://gitlab.kitware.com/ken-martin/vtk/commit/c3a6dfa9023d905151ee61eb83f58bef765d0e2e] |
+ | |||
+ | === Next steps === | ||
* Talk with Steve and getting his feedback. | * Talk with Steve and getting his feedback. | ||
− | * Ken will be very happy to contribute | + | * Ken will be very happy to contribute a base class <code>vtkOpenGLImageAlgorithm</code> |
+ | ** Timeline: in 2-3 weeks after his vacation | ||
+ | ** Most likely derived from <code>vtkImageAlgorithm</code>, the class will integrate feature from [https://github.com/Kitware/VTK/blob/master/Rendering/OpenGL/vtkGaussianBlurPass.h VTK/Rendering/OpenGL/vtkGaussianBlurPass.h] to facilitate the use of custom shaders to implement GPU based filters. | ||
+ | |||
+ | == Status == | ||
+ | * Ken wrote the base class for operation filtering on GPU [https://github.com/Kitware/VTK/blob/41fab4e9d7a7b55cd5c7368fee914a74b7bec751/Rendering/OpenGL2/vtkOpenGLImageAlgorithmHelper.h] | ||
+ | * and he gave also an example how to use it: [https://github.com/Kitware/VTK/blob/3530cb6e8a7992ba1c8dbf5652c2b9d0c21bf4cd/Imaging/OpenGL2/vtkOpenGLImageGradient.h] | ||
+ | * An application of the class for filtering can also be found here: [https://github.com/Punzo/SlicerAstro/tree/master/vtkOpenGLFilters] | ||
+ | |||
+ | = References = | ||
+ | |||
+ | * [[Developer_Meetings/20150609]] | ||
+ | * [[Developer_Meetings/20150901]] | ||
+ | * https://github.com/pieper/CommonGL/tree/master/GLFilters | ||
+ | * http://www.vtk.org/Wiki/Shader_In_VTK |
Latest revision as of 08:42, 14 September 2016
Home < Documentation < Labs < OpenGLFiltersContents
Overview
Here we summarize some efforts for enabling image processing (filtering/smoothing) in VTK/Slicer using OpenGL.
The reason behind this page is trying to coordinate the various projects regarding this subject.
Meetings
9th June 2016
Attended by: Davide Punzo, Jean-Christophe Fillion-Robin, Ken Martin, Utkarsh Ayachit and Robert Maynard
Based on an original idea of Steve Pieper
In order to implement efficient filtering, OpenGL solution seems the best that fits our needs:
- no requirement on external library (CUDA or OpenCL).
- performance boosting is fairly good to allow almost interactive filtering up to volume of ~10^8 voxels.
Source: Finding faint HI structure in and around galaxies: scraping the barrel (Astronomy and Computing accepted)
Use Case
Based on the Steve Pieper implementation of the classes:
vtkOpenGLTextureImage vtkOpenGLShaderComputation
here an Use case:
https://github.com/Punzo/SlicerAstro/tree/master/AstroSmoothing/Logic https://arxiv.org/abs/1609.03782
Full integration in VTK
For a full integration of the openGLfilters pipeline in VTK, it will be ideal to have a general purpose class:
VTKOpenGLImageAlgorithm
this class will have the duty to:
- handle the I/O communication between the
vtkImageData
and the GPU Texture using fully the VTK shader infrastructure, since the shader infrastructure is already available in VTK (safe binding, automatic versioning, etc... http://www.vtk.org/Wiki/Shader_In_VTK). - child classes will handle different approach (e.g. multipass/iterative filtering).
Ken Martin provided this structure in VTK: [1]
Next steps
- Talk with Steve and getting his feedback.
- Ken will be very happy to contribute a base class
vtkOpenGLImageAlgorithm
- Timeline: in 2-3 weeks after his vacation
- Most likely derived from
vtkImageAlgorithm
, the class will integrate feature from VTK/Rendering/OpenGL/vtkGaussianBlurPass.h to facilitate the use of custom shaders to implement GPU based filters.
Status
- Ken wrote the base class for operation filtering on GPU [2]
- and he gave also an example how to use it: [3]
- An application of the class for filtering can also be found here: [4]