Computer Graphics WS07/08 – Volume Rendering
Computer Graphics
- Volume Rendering -
Computer Graphics - Volume Rendering - Hendrik Lensch [a couple of - - PowerPoint PPT Presentation
Computer Graphics - Volume Rendering - Hendrik Lensch [a couple of slides thanks to Holger Theisel] Computer Graphics WS07/08 Volume Rendering Overview Last Week Subdivision Surfaces on Sunday Ida Helene Today
Computer Graphics WS07/08 – Volume Rendering
Computer Graphics WS07/08 – Volume Rendering 2
– Subdivision Surfaces
– Ida Helene
– Volume Rendering
Computer Graphics WS07/08 – Volume Rendering
– Fog, smoke, clouds, fire, water, … – Scientific/medical visualization: CT, MRI – Simulations: Fluid flow, temperature, weather, ... – Subsurface scattering
– Absorption – Emission – Scattering
– Klaus Engel et al., Real-time Volume Graphics, AK Peters – Paul Suetens, Fundamentals of Medical Imaging, Cambridge University Press
Computer Graphics WS07/08 – Volume Rendering 4
Computer Graphics WS07/08 – Volume Rendering
Computer Graphics WS07/08 – Volume Rendering
Computer Graphics WS07/08 – Volume Rendering 7
Computer Graphics WS07/08 – Volume Rendering 8
Computer Graphics WS07/08 – Volume Rendering 9
voxels voxels: represent : represent homogeneous areas homogeneous areas cells: represent cells: represent inhomogeneous areas inhomogeneous areas
Computer Graphics WS07/08 – Volume Rendering 10
voxels voxels: represent : represent homogeneous areas homogeneous areas cells: represent cells: represent inhomogeneous areas inhomogeneous areas
Computer Graphics WS07/08 – Volume Rendering
– Ellipsoidal clouds with sum-of-sines densities – Hypertextures [Perlin]
– Regular (uniform) or rectilinear (rectangular) – CT, MRI
– Curvilinear grid (mapping of regular grid to 3D)
– Unstructured meshes
tetrahedral mesh)
Curvilinear grid
Computer Graphics WS07/08 – Volume Rendering
– Wald et al. – Implicit kd-trees
– Warped Rectilinear Grid – Hexahedral cells
– Tetrahedral cells
Computer Graphics WS07/08 – Volume Rendering 13
Data values inside a cell have to be computed by interpolation. Data values inside a cell have to be computed by interpolation. Most common interpolation for cells: Most common interpolation for cells: trilinear trilinear interpolation interpolation
f100 f000 f110 f010 f001´ f101 f011 f111 f(x,y,z)
Computer Graphics WS07/08 – Volume Rendering 14
Let Let f fijk
ijk =
= f f( (i,j,k i,j,k) for ) for i,j,k i,j,k∈ ∈{0,1}. Then the value {0,1}. Then the value f f( (x,y,z x,y,z) for a certain point ) for a certain point ( (x,y,z x,y,z) )∈ ∈[0,1] [0,1]3
3 inside the cell is computed by
inside the cell is computed by trilinear trilinear interpolation as: interpolation as: a a1
1 = (1
= (1-
x)* )*f f000
000 +
+ x x* *f f100
100
a a2
2 = (1
= (1-
x)* )*f f010
010 +
+ x x* *f f110
110
a a3
3 = (1
= (1-
x)* )*f f011
011 +
+ x x* *f f111
111
a a4
4 = (1
= (1-
x)* )*f f001
001 +
+ x x* *f f101
101
a a5
5 = (1
= (1-
y)* )*a a1
1
+ + y y*a *a2
2
a a6
6 = (1
= (1-
y)* )*a a4
4
+ + y y*a *a3
3
f(x,y,z f(x,y,z) ) = (1 = (1-
z)* )*a a5
5
+ + z z*a *a6
6
Computer Graphics WS07/08 – Volume Rendering
Computer Graphics WS07/08 – Volume Rendering
– Probability of a photon being absorbed at x in direction ω per unit length – Optical depth τ of a material of thickness s
– Measure for how far light travels before being absorbed
) , ( ω x L dL x L + ) , ( ω
ds
) , ( ) , ( ) , ( ) , ( ) , ( ) , ( ω ω κ ω ω ω κ ω x L x x ds dL ds x L x x dL − = − =
) , ( ω κ x
] , [ ) , ( ) ( const iff s dt t x s
s
= = + = ∫ κ κ ω ω κ τ
Computer Graphics WS07/08 – Volume Rendering
) , ( ) ( ) , ( ) , ( ) , ( ) ( ) , ( ) , ( ) , (
) (
ω ω ω ω ω ω κ τ ω ω κ ω
τ
x L s T x L e s x L dt t x s and x L x x ds dL
s s
= = + + = − =
−
∫ + − −
= =
s
dt t x s
e e s T
) ( ) (
) (
ω κ τ
) ( 1 ) ( s T s O − =
Computer Graphics WS07/08 – Volume Rendering
– Number of photons being emitted at x in direction ω per unit length
) , ( ω x L dL x L + ) , ( ω
ds
) , ( ) , ( ) , ( ) , ( ω ω ω ω x q x ds dL ds x q x dL = =
) , ( ω x q
Computer Graphics WS07/08 – Volume Rendering
– Kombines absorption and emission only
– In differential form
– Incoming light is absorbed along the entire segment – Emitted light is only absorbed along the remaining segment – Must integrate over emission along the entire segment
) , ( ) , ( ) , ( ) , ( ω ω ω κ ω x q x L x x ds dL + − =
− − s dt t dt t
s s s
) ( ) (
'
κ κ
Computer Graphics WS07/08 – Volume Rendering
– Probability of a photon being scattered out of direction per unit length – Total absorption (extinction): true absorption plus out-scattering – Albedo (“Weißheit”, measure for reflectivity or ability to scatter)
) , ( ω x L dL x L + ) , ( ω
ds
) (x σ
σ κ χ + = σ κ σ χ σ + = = W
Computer Graphics WS07/08 – Volume Rendering
– Number of photons being scattered into path per unit length – Depend on scattering coefficient (probability of being scattered) and the phase function (directional distribution of out-scattering events) – Total Emission: true emission q plus in-scattering j – Phase function (essentially the BRDF for volumes)
) , ( ω x L dL x L + ) , ( ω
ds
) , ( ω σ x
=
2
) , ( ) , , ( ) , ( ) , (
S i i i i
d x L x p x x j ω ω ω ω ω σ ω ) , , ( ω ωi x p ) , ( ) , ( ) , ( ω ω ω η x j x q x + =
Computer Graphics WS07/08 – Volume Rendering
– cos θ = ω⋅ω'
– Isotropic – Rayleigh (small molecules)
– Mie scattering (larger spherical particles) ω ω’
1 ) (cos = θ p
4 2
cos 1 4 3 ) (cos λ θ θ + = p
= =
2
1 ) , , ( 4 1 ) , , ( ) , , (
S i i i
d x p x p x p ω ω ω π ω ω ω ω
Computer Graphics WS07/08 – Volume Rendering
Computer Graphics WS07/08 – Volume Rendering
– Often used for interstellar clouds, tissue, and similar material – Average cosine of phase angle
3 2 2
cos 2 1 1 4 1 ) (cos θ π θ g g g p − + − = θ θ θ π
π
= cos ) (cos 2 d p g
g= 0.6 g= 0.0 g= -0.3
Computer Graphics WS07/08 – Volume Rendering
Computer Graphics WS07/08 – Volume Rendering
+ + − = ∂ ∂ = ∇ ⋅
2
) , ( ) , , ( ) , ( ) , ( ) , ( ) , ( ) , ( ) , (
S i i i i x
d x L x p x x q x L x s x L x L ω ω ω ω ω σ ω ω ω χ ω ω ω
) , (
'
s dt t x
s s
ω ω χ
+ −
Attenuation: (absorption &
Source Term: in-scattering,emission, and background (η(0,ω)= L(x,ω)δ(x))
point x at ) , , ( z y x
x
∂ ∂ ∂ ∂ ∂ ∂ = ∇
Computer Graphics WS07/08 – Volume Rendering
– Homogeneous media (κ = const) – Constant source term q (ambient illumination)
– Affine combination of background and fog color – Depending on distance
q s T C s T s L q e C e s L qds e C e s L q s L s s L
s s s s s
)) ( 1 ( ) ( ) ( 1 ) ( ' ) ( ) ( ) (
'
− + = − + = + = + − = ∂ ∂
− − − −
κ κ κ κ
κ
S C
Computer Graphics WS07/08 – Volume Rendering 30
Two ways of graphical representation of volume data 1) extracting geometry
2) direct rendering of the whole volume (direct volume rendering)
Computer Graphics WS07/08 – Volume Rendering
– Compute iso-surface for v(x,y,z)= C and shade as normal
– Intersect ray with cubic surface defined by values at vertices – Several accurate and/or fast algorithms
– Iterate over all voxels – Classify voxel into 15 classes (by symmetry) surface topology – Compute vertex location by interpolation – Render as triangle mesh
Computer Graphics WS07/08 – Volume Rendering 32 view plane view plane
a) b)
data cube data cube 1 2 3 ..... ..... 3 1 2 4
1. Raycasting (send a ray through the data volume; evaluation of the color distribution concerning the hit volume elements)
for each ray do for each voxel-ray intersection d calculate pixel contribution
2. Projection of the volume elements onto screen
for each voxel or cell do for each pixel projected onto do calculate pixel contribution
Computer Graphics WS07/08 – Volume Rendering 33
There are two ways to evaluate color and transparency properties for raycasting: equidistant equidistant stepsize stepsize intersection ray / volume element intersection ray / volume element
Computer Graphics WS07/08 – Volume Rendering
– Map value given in the volume to optical properties – Typical: One-dimensional transfer functions
– Multidimensional transfer functions
– Before (pre-) or after (post-classification) interpolation? – Post-classification is more appropriate
frequency modulation of it
– Assume linear interpolation of κ and q inside small segments – Precompute integral value for all tuples (v0,v1,∆s)
Computer Graphics WS07/08 – Volume Rendering
Computer Graphics WS07/08 – Volume Rendering
– – data acquisition data acquisition – – data conversion data conversion – – data completion data completion – – data reduction data reduction – – filter operators filter operators
– – for each volume element the distribution of the containing for each volume element the distribution of the containing materials is computed materials is computed – – for each material transparency and color is specified for each material transparency and color is specified – – multiply the percentage of materials with assigned properties multiply the percentage of materials with assigned properties
Computer Graphics WS07/08 – Volume Rendering
Computer Graphics WS07/08 – Volume Rendering 39
[Kniss et al, 2002]
depend not only on scalar value but also on magnitude of the gradient
boundaries
areas
Computer Graphics WS07/08 – Volume Rendering 40
T z y x T
Idea: collect contributions (using a local lightning model) along a : collect contributions (using a local lightning model) along a viewing ray viewing ray
for surface rendering the normals normals are necessary; they can be are necessary; they can be computed using computed using gradients gradients. .
The gradient grad grad f f over a scalar function
f = f(x,y,z f(x,y,z) ) is is definied definied as: as:
Computer Graphics WS07/08 – Volume Rendering 41
z z y y x x
Gradients express the difference of the data values along the ax Gradients express the difference of the data values along the axes. es. They are perpendicular to the They are perpendicular to the isosurfaces isosurfaces f(x,y,z f(x,y,z)=const )=const; thus they can ; thus they can be used to estimate the surface be used to estimate the surface normals normals. . For piecewise For piecewise trilinear trilinear scalar fields, gradients are computed using scalar fields, gradients are computed using central differences: central differences: where where G Gx
x,
, G Gy
y and
and G Gz
z are the components of the gradients and
are the components of the gradients and s sx
x,
, s sy
y,
, s sz
z is
is the the stepsize stepsize along the regular grid in x along the regular grid in x-
, y-
and z-
direction.
Computer Graphics WS07/08 – Volume Rendering 42
– No binary classification – Show small details – Compute complexity depends on volume size; but parallelization possible; – combination with geometrical data not trivial, no traditional rendering
Computer Graphics WS07/08 – Volume Rendering
– As seen from the viewer (sn is at front)
– Front to back (start at sn) and back to front (start at s0) – Accumulate color and opacity
– Allows for early ray termination – C = Cn, α=0 (Opacity) – for (i=n-1; i >= 0; i--) – C += (1-α)*ci – α += (1-α)(1-Ti) – if (α > threshold) break – C+= (1-α)Cbackground
Computer Graphics WS07/08 – Volume Rendering
– Compute illumination via shadow ray
phase function, and light radiance
– Accumulate front to back
– Add background illumination times transparency T=1 L=0 for (s=0; s < 1; s+= ds) j= σ(s) * p(ω, ωL) * Ls * TS L += T*j*ds T *= (1- Τ(v(s))) L+= T * L0 Directional Lighting Shadow Ray: TS=1 for (t=0; t < 1; t+= dt) TS *= (1- Τ(v(t)))*dt
Computer Graphics WS07/08 – Volume Rendering
– Zonal method (FE-Technique) [Rushmeier’87]
– P-N (PN) method [Kajiya’84]
– Discrete Ordinate method [Languénou’95]
– Should distribute in solid angle
– Diffusion process [Stam’95]
Computer Graphics WS07/08 – Volume Rendering 47
check transparency; if beyond certain threshold: stop process;
Ray is sent for group of pixels, i.e. 3*3; if values of adjacent rays differ significantly: additional rays are sent.
describe a ray as set of 3D points (artifacts possible)
per volume element: coding the distance to the next volume element -> skip areas of low interest.
Computer Graphics WS07/08 – Volume Rendering 48
first hit
Computer Graphics WS07/08 – Volume Rendering 49
maximum intensity projection
Computer Graphics WS07/08 – Volume Rendering 50
– average
Computer Graphics WS07/08 – Volume Rendering
– Isosurface Rendering (implicit surface) – Maximum-Intensity-Projection
– Direct or Emission-Absorption Volume Rendering (x-ray)
Isosurface Rendering Maximum-Intensity-P. E-A Volume Rendering
Computer Graphics WS07/08 – Volume Rendering 52
view plane view plane
a) b)
view point data cubel data cube
Computer Graphics WS07/08 – Volume Rendering 54
– plane composing – voxel projection – cell projection – shear warp
Computer Graphics WS07/08 – Volume Rendering 55
slices. During the rendering process, the slices are composes one over the
Basic Complexity = VolumeSize
Computer Graphics WS07/08 – Volume Rendering
– Given volume data set as 3D texture – Slice bounding box of 3D texture with planes parallel to viewing plane – Render with back to front approach
– Same technique but use 2D slices of of volume directly – Needs three copies (xy, xz, yz) to always use best orientation
Computer Graphics WS07/08 – Volume Rendering 58
Computer Graphics WS07/08 – Volume Rendering 59
Computer Graphics WS07/08 – Volume Rendering 60
Computer Graphics WS07/08 – Volume Rendering 61
Computer Graphics WS07/08 – Volume Rendering 62
Computer Graphics WS07/08 – Volume Rendering 63
Computer Graphics WS07/08 – Volume Rendering 64
Computer Graphics WS07/08 – Volume Rendering 65
Computer Graphics WS07/08 – Volume Rendering 66
Computer Graphics WS07/08 – Volume Rendering 67
Computer Graphics WS07/08 – Volume Rendering
– Surface/Volume
– Volume/Volume
– Opacity combines from both volumes
– Surfaces:
– Volumes
Computer Graphics WS07/08 – Volume Rendering