RealTime Volume Graphics 05 Transfer Functions REALTIME VOLUME

  • Slides: 27
Download presentation
Real-Time Volume Graphics [05] Transfer Functions REAL-TIME VOLUME GRAPHICS Klaus Engel Siemens AG, Erlangen,

Real-Time Volume Graphics [05] Transfer Functions REAL-TIME VOLUME GRAPHICS Klaus Engel Siemens AG, Erlangen, Germany Eurographics 2006

Classification During Classification the user defines the „Look“ of the data. Which parts are

Classification During Classification the user defines the „Look“ of the data. Which parts are transparent? Which parts have which color? REAL-TIME VOLUME GRAPHICS Klaus Engel Siemens AG, Erlangen, Germany Eurographics 2006

Classification During Classification the user defines the „Look“ of the data. Which parts are

Classification During Classification the user defines the „Look“ of the data. Which parts are transparent? Which parts have which color? The user defines a Transferfunction. scalar S REAL-TIME VOLUME GRAPHICS Klaus Engel Siemens AG, Erlangen, Germany Transfer Function Emission RGB Absorption A Eurographics 2006

Classification Real-Time update of the transfer function necessary!!! REAL-TIME VOLUME GRAPHICS Klaus Engel Siemens

Classification Real-Time update of the transfer function necessary!!! REAL-TIME VOLUME GRAPHICS Klaus Engel Siemens AG, Erlangen, Germany Eurographics 2006

Classification REAL-TIME VOLUME GRAPHICS Klaus Engel Siemens AG, Erlangen, Germany Eurographics 2006

Classification REAL-TIME VOLUME GRAPHICS Klaus Engel Siemens AG, Erlangen, Germany Eurographics 2006

Pre- vs Post-Interpolative Classification POST-INTERPOLATIVE optical properties interpolation optical properties PRE-INTERPOLATIVE interpolation data value

Pre- vs Post-Interpolative Classification POST-INTERPOLATIVE optical properties interpolation optical properties PRE-INTERPOLATIVE interpolation data value REAL-TIME VOLUME GRAPHICS Klaus Engel Siemens AG, Erlangen, Germany data value Eurographics 2006

Pre-Classification: Color table is applied before interpolation. (pre-interpolative Transferfunction) Geometry. Transfer. Rasterization Processing. Function

Pre-Classification: Color table is applied before interpolation. (pre-interpolative Transferfunction) Geometry. Transfer. Rasterization Processing. Function Fragment Operations A color value is fetched from a table for each Voxel A RGBA Value is determined for each Voxel REAL-TIME VOLUME GRAPHICS Klaus Engel Siemens AG, Erlangen, Germany Eurographics 2006

Possible Implementations The naive Approach: Save Emission- and Absorptionterms directly in the Texture. Main

Possible Implementations The naive Approach: Save Emission- and Absorptionterms directly in the Texture. Main Memory RGBA REAL-TIME VOLUME GRAPHICS Klaus Engel Siemens AG, Erlangen, Germany AGP/PCIe scalar value S Graphics Memory RGBA Textur Eurographics 2006

Possible Implementations The naive Approach: Save Emission- and Absorptionterms directly in the Texture. Very

Possible Implementations The naive Approach: Save Emission- and Absorptionterms directly in the Texture. Very high memory consumption Main Memory (RGBA und scalar volumes) Graphics Memory (RGBA volume) Main Memory Graphics Memory AGP/PCIe High Load on memory bus scalar value must S be transferred. RGBA Volume Upload necessary on TF change RGBA Textur REAL-TIME VOLUME GRAPHICS Klaus Engel Siemens AG, Erlangen, Germany Eurographics 2006

Possible Implementations A better Approach: Apply color table during texture transfers from main memory

Possible Implementations A better Approach: Apply color table during texture transfers from main memory to graphics card (standard Open. GL feature) Main Memory REAL-TIME VOLUME GRAPHICS Klaus Engel Siemens AG, Erlangen, Germany AGP/PCIe scalar value S Graphics Memory scalar value S RGBA Texture Eurographics 2006

Possible Implementations A better Approach: Apply color table during texture transfers from main memory

Possible Implementations A better Approach: Apply color table during texture transfers from main memory to graphics card (standard Open. GL feature) High memory consumption Main Memory (only scalar volume) Graphics Memory (RGBA volume) AGP/PCIe Main Memory Graphics Memory Reduced load on memory bus Only scalar. Svolume is transferred. scalarthevalue Upload necessary on TF change REAL-TIME VOLUME GRAPHICS Klaus Engel Siemens AG, Erlangen, Germany RGBA Texture Eurographics 2006

Possible Implementations The best approach: Paletted Textures Store the scalar volume together with the

Possible Implementations The best approach: Paletted Textures Store the scalar volume together with the color table directly in graphics memory. Hardware-Support necessary! Main Memory Transferfunction REAL-TIME VOLUME GRAPHICS Klaus Engel Siemens AG, Erlangen, Germany AGP/PCIe scalar value S Graphics Memory Scalar Texture palette Eurographics 2006

Possible Implementations The best approach: Paletted Textures Store the scalar volume together with the

Possible Implementations The best approach: Paletted Textures Store the scalar volume together with the color table directly in graphics memory. Hardware-Support necessary! Low memory consumption Main Memory Low load on memory bus AGP /PCIe Main Memory (scalar volume can be deleted!) Graphics Memory (scalar volume + TF) Graphics Memory Scalar volume skalar valuemust S be transferred only once! Scalar Texture Only the color table must be re-uploaded on TF change Transferfunction REAL-TIME VOLUME GRAPHICS Klaus Engel Siemens AG, Erlangen, Germany Texture palette Eurographics 2006

Pre-Classification Summary Pre-Classification Application of the Transferfunction before Rasterization One RGBA Lookup for each

Pre-Classification Summary Pre-Classification Application of the Transferfunction before Rasterization One RGBA Lookup for each Voxel Different Implementations: Texture Transfer Texture Color Tables (paletted textures) Simple and Efficient Good for coloring segmented data REAL-TIME VOLUME GRAPHICS Klaus Engel Siemens AG, Erlangen, Germany Eurographics 2006

Post-Classification: The color table is applied after Interpolation (post-interpolative Transferfunction). Geometry Processing Transfer Fragment

Post-Classification: The color table is applied after Interpolation (post-interpolative Transferfunction). Geometry Processing Transfer Fragment Function. Operations Rasterization A color is fetched from the color table for each Fragment REAL-TIME VOLUME GRAPHICS Klaus Engel Siemens AG, Erlangen, Germany Eurographics 2006

Post-Classification Texture 0 = Scalar field R=G=B=A= Scalar field S RGBA Polygon = T(S)

Post-Classification Texture 0 = Scalar field R=G=B=A= Scalar field S RGBA Polygon = T(S) Texture 1 = Transferfunction [Emission RGB, Absorption A] REAL-TIME VOLUME GRAPHICS Klaus Engel Siemens AG, Erlangen, Germany R Eurographics 2006

CG Implementation //fragment program for post-classification //using 3 D textures float 4 main (float

CG Implementation //fragment program for post-classification //using 3 D textures float 4 main (float 3 tex. UV : TEXCOORD 0, uniform sampler 3 D volume_texture, uniform sampler 1 D transfer_function) : COLOR { float index = tex 3 D(volume_texture, tex. UV); float 4 result = tex 1 D(transfer_function, index); return result; } REAL-TIME VOLUME GRAPHICS Klaus Engel Siemens AG, Erlangen, Germany Eurographics 2006

Quality: Pre- vs. Post-Classification Comparison of image quality Pre-Classification Post-Classification Same TF, same Resolution,

Quality: Pre- vs. Post-Classification Comparison of image quality Pre-Classification Post-Classification Same TF, same Resolution, same Sampling Rate REAL-TIME VOLUME GRAPHICS Klaus Engel Siemens AG, Erlangen, Germany Eurographics 2006

Quality Pre-Classification REAL-TIME VOLUME GRAPHICS Klaus Engel Siemens AG, Erlangen, Germany Post-Classification Eurographics 2006

Quality Pre-Classification REAL-TIME VOLUME GRAPHICS Klaus Engel Siemens AG, Erlangen, Germany Post-Classification Eurographics 2006

Pre- vs Post-Classification Discrete data alpha value Continuous data Scalar value Transfer Function Classified

Pre- vs Post-Classification Discrete data alpha value Continuous data Scalar value Transfer Function Classified data Analytical Solution REAL-TIME VOLUME GRAPHICS Klaus Engel Siemens AG, Erlangen, Germany Transfer Function Supersampling Transfer Function Pre-interpolative TF Post-interpolative TF Eurographics 2006

Post- vs Pre-Integrated Classification Discrete data alpha value Continuous data Scalar value Transfer Function

Post- vs Pre-Integrated Classification Discrete data alpha value Continuous data Scalar value Transfer Function Classified data Analytical Solution REAL-TIME VOLUME GRAPHICS Klaus Engel Siemens AG, Erlangen, Germany Supersampling Transfer Function Pre-Integrated Transfer Function Post-interpolative TF Pre-Integrated TF Eurographics 2006

Classification Artifacts / Pre-integration Slab Screen sb sf Eye REAL-TIME VOLUME GRAPHICS Klaus Engel

Classification Artifacts / Pre-integration Slab Screen sb sf Eye REAL-TIME VOLUME GRAPHICS Klaus Engel Siemens AG, Erlangen, Germany Eurographics 2006

Pre-Integrated Classification front slice back slice pre-integrate all possible combinations in the TF sf

Pre-Integrated Classification front slice back slice pre-integrate all possible combinations in the TF sf sb d Assume constant sampling distance d store integral into table sf sb sb sf REAL-TIME VOLUME GRAPHICS Klaus Engel Siemens AG, Erlangen, Germany Eurographics 2006

Classification Artifacts / Pre-integration struct v 2 f_simple { float 4 Hposition : POSITION;

Classification Artifacts / Pre-integration struct v 2 f_simple { float 4 Hposition : POSITION; float 3 Tex. Coord 0 : TEXCOORD 0; float 3 Tex. Coord 1 : TEXCOORD 1; float 4 Color 0 : COLOR 0; }; Cg Fragment Program float 4 main(v 2 f_simple IN, uniform sampler 3 D Volume, uniform sampler 2 D Transfer. Function, uniform sampler 2 D Pre. Integration. Table) : COLOR { float 4 lookup; //sample front scalar lookup. x = tex 3 D(Volume, IN. Tex. Coord 0. xyz). x; //sample back scalar lookup. y = tex 3 D(Volume, IN. Tex. Coord 1. xyz). x; //lookup and return pre-integrated value return tex 2 D(Pre. Integration. Table, lookup. yx); } REAL-TIME VOLUME GRAPHICS Klaus Engel Siemens AG, Erlangen, Germany Eurographics 2006

Pre-Integrated Classification Fast re-computation of the pre-integration table when transfer function changes Use Integral

Pre-Integrated Classification Fast re-computation of the pre-integration table when transfer function changes Use Integral functions a a 0 sf sb 0 sf = sb Hardware-Accelerated Computation: Roettger, Ertl. A Two-Step Approach for Interactive Pre-Integrated Volume Rendering of Unstructured Grids. In Proc. Vol. Vis '02 REAL-TIME VOLUME GRAPHICS Klaus Engel Siemens AG, Erlangen, Germany Eurographics 2006

Pre-Integrated Classification REAL-TIME VOLUME GRAPHICS Klaus Engel Siemens AG, Erlangen, Germany Eurographics 2006

Pre-Integrated Classification REAL-TIME VOLUME GRAPHICS Klaus Engel Siemens AG, Erlangen, Germany Eurographics 2006

When to use which Classification Pre-Interpolative Classification If the graphics hardware does not support

When to use which Classification Pre-Interpolative Classification If the graphics hardware does not support fragment shaders For simple segmented volume data visualization Post-Interpolative Classification If the transfer function is “smooth” For good quality and good performance (especially when slicing) Pre-Integrated Classification If the transfer function contains high frequencies For best quality REAL-TIME VOLUME GRAPHICS Klaus Engel Siemens AG, Erlangen, Germany Eurographics 2006