8.1 Vis_04 Data Visualization Lecture 8 3D Scalar Visualization Volume Rendering : Further Ray...
-
Upload
benjamin-mitchell -
Category
Documents
-
view
239 -
download
3
Transcript of 8.1 Vis_04 Data Visualization Lecture 8 3D Scalar Visualization Volume Rendering : Further Ray...
8.1Vis_04
Data VisualizationData Visualization
Lecture 83D Scalar Visualization
Volume Rendering : Further Ray Casting plus Other
Approaches
8.2Vis_04
Classical Approach - Volume Rendering Integral
Classical Approach - Volume Rendering Integral
Cast rays through image plane into volume, and measure light received
– Kajiya and von Hertzen (1984)
– Max (1995) L
s
I = L0C(s)(s) exp[ -s
0 (t)dt ] ds
C(s)=light reflectedat point s
(s) = density atpoint s
lightdensity attenuation
imageplane
volume
8.3Vis_04
Simplifying the IntegralSimplifying the Integral
Approximate using Riemann sums (n = number of steps)
Approximate exponential by Taylor series and introduce opacity, , and unit spacing
Calculate recursively front-to-back as...
I = L0C(s)(s) exp[ -s
0 (t)dt ] ds
I = ni=0 C(is)(is)s
i-1j=0 exp [- (js)s]
I = ni=0 C(i)(i) i-1
j=0 (1 - (j))
Cout = Cin + (1-in)iCi
out = in + i(1 - in)
Compositing associative but not commutativeie can group but cannot re-order
{stop when = 1}
8.4Vis_04
InterpolationInterpolation
Sample points occur within cells, not at grid points, so we need to interpolate
Do we:– classify at grid
points, then interpolate colour / opacity
– interpolate data values, then classify
– ?
Classify - interpolate
– classification done as pre-processing
– smoothing effect can obscure detail
Interpolate - classify– classification now
within the inner loop of the ray cast (sample points are view dependent)
– in return, fine detail can be picked out
8.5Vis_04
Classify - InterpolateClassify - Interpolate
There is a danger in interpolation after classification
Naïve colour interpolation would assign 3 parts yellow, 1 part blue to centre point…
… but if opacity of bottomleft is zero?
Correct approach is toweight according to opacity,so colour at centre is yellow!
=1 =1
=1=0
8.6Vis_04
A Note on ShadingA Note on Shading
The appearance of volume rendered images depends critically on the reflectance calculation used to shade the samples...
8.7Vis_04
A Note on ShadingA Note on Shading
At (xi,yj,zk), df/dx = 0.5*(f i+1,j,k - f i-1,j,k) df/dy = 0.5*(f i,j+1,k - f i,j-1,k) df/dz = 0.5*(f i,j,k+1 - f i,j,k-1)
This gives us normals at all grid points
Recall from isosurface rendering - that surface normal is equal to the gradient vector of f
8.8Vis_04
A Note on ShadingA Note on Shading
If the classification is done at the vertices, there is a choice:– Gouraud-type: shade vertices and
then interpolate to get reflected colour at sample point
– Phong-type: interpolate normals at vertices to get sample normal and then calculate shading
Phong-type gives better quality - at the cost of more computational effort
8.9Vis_04
Ray CastingRay Casting
Advantages– Non binary
classification– Shows structure
between surfaces– Readily parallelisable
Disadvantages– Computationally
expensive - cost proportional to number of voxels (compositing is expensive)
– Does not take advantage of triangle rendering hardware
8.10Vis_04
Ray Casting ExamplesRay Casting Examples
The following sequence of slides were produced using the ray casting technique available in the vtk software
The slides show for the bonsai tree data set how different aspects can be highlighted by control of the opacity transfer
The slides also show, by animation, a comparison of different approaches to interpolation and shading
Thanks to Chris Goodyer for creating the images
8.11Vis_04
LegendLegend
NN = classify vertex, shade, nearest neighbour interpolate
Trilin Vertex = classify vertex, trilinear interpolate, shade
Trilin Sample = trilinear interpolate, classify, shade
8.12Vis_04
Bonsai TreeNN – TrilinVertex –
TrilinSample
Bonsai TreeNN – TrilinVertex –
TrilinSample
NN TrilinVertex
TrilinSample
8.13Vis_04
Bonsai Tree BranchesNN – TrilinVertex -
TrilinSample
Bonsai Tree BranchesNN – TrilinVertex -
TrilinSample
8.14Vis_04
Bonsai Tree LeavesNN – TrilinVertex -
TrilinSample
Bonsai Tree LeavesNN – TrilinVertex -
TrilinSample
8.15Vis_04
SkullNN – TrilinVertex -
TrilinSample
SkullNN – TrilinVertex -
TrilinSample
8.16Vis_04
Texture-based Volume Rendering
Texture-based Volume Rendering
Volume rendering by ray casting is time-consuming– one ray per pixel– each ray involves tracking through
volume calculating samples, and then compositing
– different for each viewpoint Alternative approach - using
texture maps - can exploit graphics hardware
8.17Vis_04
Texture MappingTexture Mapping
Modern graphics hardware includes facility to draw a textured polygon
The texture is an image with red, green, blue and alpha components…
… this is used in computer graphics to avoid constructing complex geometric models
… and we can exploit this in volume rendering
8.18Vis_04
Texture-based Volume Rendering
Texture-based Volume Rendering
Draw from back-to-front a set of rectangles– first rectangle drawn as an area of
coloured pixels, with associated opacity, as determined by transfer function and interpolation - and merged with background in a compositing operation (supported by hardware)
– successive rectangles drawn on top
8.19Vis_04
3D Texture-based Volume Rendering
3D Texture-based Volume Rendering
For a given viewing direction, we would need to select slices perpendicular to this direction
This requires interpolation to get the values on the slices
Until recently this has only been possible with expensive graphics boards
imageplane
volume
3D texture mapping
8.20Vis_04
2D Texture-based Volume Rendering
2D Texture-based Volume Rendering
Simpler solution - 2D texture mapping:– view volume as set of slices parallel
to co-ordinate planes
-Precompute the textured planes for each of the 3 directions-Choose the orientation best suited to viewing direction
8.21Vis_04
Texture-based Volume Rendering
Texture-based Volume Rendering
8.22Vis_04
Comparison of Ray Casting and Texture Approaches
Comparison of Ray Casting and Texture Approaches
Ray casting Ray castingTexture-based Texture-based
http://www.cora.nwra.com/Ogle/
http://vg.swan.ac.uk/vlib
http://www.amiravis.com
8.23Vis_04
Close UpClose Up
Ogle: texture-based Vlib: ray casting
8.24Vis_04
Shear Warp RenderingShear Warp Rendering
To get fast traversal, shear volume by translating each slice… then can resample as shown
Project front-to-back to get intermediate image
Then warp image
8.25Vis_04
Example of Shear Warp Rendering
Example of Shear Warp Rendering
8.26Vis_04
New Hardware AdvancesNew Hardware Advances
Holy grail: real-time volume rendering
Main searcher has been Kaufman through Cube architectures
VolumePro System first commercially available from Mitsubishi’s RealTime Visualization, now from TeraRecon
Uses shear-warp rendering
http://www.rtviz.com/home.html
8.27Vis_04
SplattingSplatting
Another commonly used method is splatting
Fuzzy balls around each voxel projected on to image plane
Composited in the image plane
VolumeToGeom in IRIS Explorer
8.28Vis_04
Summary of Volume Rendering TechniquesSummary of Volume
Rendering Techniques
Ray casting Splatting
– Both high quality, computationally expensive
Texture-based Shear-warp
– Both lower quality, but faster
8.29Vis_04
ReadingReading Overviews of Volume Visualization
– Todd Elvins, `A Survey of Algorithms for Volume Visualization’, Computer Graphics, 1992
– Ken Brodlie and Jason Wood, Computer Graphics Forum, 2001
– Michael Meissner et al, ‘A Practical Evaluation of Popular Volume Rendering Algorithms’,
http://www.gris.uni-tuebingen.de/~bartz/Publications/paper/volvis2000.pdf
Ray Casting - Classic Paper– Marc Levoy, `Display of Surfaces from Volume
Data’, IEEE CG&A, 1988 Book
– Introduction to Volume Rendering, Lichtenbelt, Crane, Naqvi, Hewlett-Packard Professional Books