Volume Rendering Reference Material The slides have used/adapted - - PowerPoint PPT Presentation

volume rendering reference material
SMART_READER_LITE
LIVE PREVIEW

Volume Rendering Reference Material The slides have used/adapted - - PowerPoint PPT Presentation

Volume Rendering Reference Material The slides have used/adapted material from the following references: 1. Advanced Animation and Rendering Techniques by Watt and Watt 2. Slides by Prof Parag Chaudhuri of Course CS 775 on Volume Graphics 3.


slide-1
SLIDE 1

Volume Rendering

slide-2
SLIDE 2

Reference Material

The slides have used/adapted material from the following references:

  • 1. Advanced Animation and Rendering Techniques by Watt and Watt
  • 2. Slides by Prof Parag Chaudhuri of Course CS 775 on Volume Graphics
  • 3. Slides by Prof Bong Soo Sohn of Lecture on Direct Volume Rendering
  • 4. Lecture Slides on Contouring by Prof Tao Ju (Course CSE554)
slide-3
SLIDE 3

Volume Rendering

Bicubic Parametric Patches Polygons 3D Structured Objects 2D Image

I x y ( , )

Conventional Rendering

slide-4
SLIDE 4

Volume Rendering

V x y z ( , , )

Scalar Field:

slide-5
SLIDE 5

Volume Rendering

slide-6
SLIDE 6

Volume Rendering

V x y z ( , , ) V x y z ( , , )

Structured 3D Model 3D Scalar Field 3D Scalar Field 2D Scalar Image

slide-7
SLIDE 7

Volume Rendering

  • Polylines (2D) or

meshes (3D) that tile the object boundary

  • Smoother appearance
  • Less storage (no

interior pieces)

Binary picture Boundary mesh

slide-8
SLIDE 8

Volume Rendering

  • Creates a binary picture from a grayscale image
  • How to create a smooth boundary at the threshold?
  • Such boundary is known as an iso-contour (or iso-curve,

iso-surface, etc.)

Digital image Binary picture Boundary curve

slide-9
SLIDE 9

Volume Rendering

  • Iso-contour: set of points at a particular function value
  • Given a continuous function f defined on every point in

the space

  • An iso-contour is all points where f evaluates to be some

value c (called the iso-value)

  • Iso-curves: iso-contours of 2D

functions

2 2

) , ( y x y x f + = 1 ) , ( = y x f

} ) , ( | } , {{ c y x f y x =

slide-10
SLIDE 10

Volume Rendering

  • Iso-surfaces: iso-contours of 3D functions

} ) , , ( | } , , {{ c z y x f z y x =

2 2 2

) , , ( z y x z y x f + + = 1 ) , , ( = z y x f

slide-11
SLIDE 11

Volume Rendering

Black curves: iso-contours Red arrows: gradient directions Green dots: critical points

  • Closed
  • With a well-defined inside and
  • utside
  • Inside: points above the iso-

value

  • Outside: points below the iso-

value

  • Orthogonal to gradient directions
  • In general, a manifold
slide-12
SLIDE 12

Volume Rendering

Iso-value = Grid point (pixel) Grid edge Grid cell

  • Input
  • A grid where each grid

point (pixel or voxel) has a value (color)

  • An iso-value (threshold)
  • Output
  • A closed, manifold, non-

intersecting polyline (2D)

  • r mesh (3D) that

separates grid points above or below the iso- value

slide-13
SLIDE 13

Volume Rendering

  • For each grid cell with a sign

change

  • Create one vertex on each grid

edge with a sign change

  • Connect vertices by lines
slide-14
SLIDE 14

Volume Rendering

  • Creating vertices
  • Assuming the underlying, continuous function is linear
  • n the grid edge
  • Linearly interpolate the positions of the two grid points

{x0,y0} {x1,y1 } f f0 f1 {x,y}

) ( ) (

1 1 1

y y t y y x x t x x f f f t ! + = ! + = ! =

+

  • t

1-t

slide-15
SLIDE 15

Volume Rendering

  • Connecting vertices by lines
  • Lines shouldn’t intersect
  • Each vertex is used once
  • So that the polyline is a closed

manifold

  • Two approaches
  • Do a walk around the grid cell
  • Connect consecutive pair of vertices
  • Or, using a pre-computed look-up

table

  • 2^4=16 entries
  • For each sign combination at the 4

corners, it stores the indices of the grid edges whose vertices make up the lines.

1 2 3 4 1 3 4 2

“0 0 0 1” {{2,4}} “0 0 1 1” {{3,4}} “1 0 0 1” {{1,3},{2,4}}

slide-16
SLIDE 16

Volume Rendering

slide-17
SLIDE 17

Volume Rendering

slide-18
SLIDE 18

Volume Rendering

C D D C E F E C E G D , , C H E 1 1 3 2 1 3 2 1

Marching Square

  • Select a cell
  • Calculate inside/outside

state of each vertex

  • Determine which edge is

intersected

  • Move to next cell till all

cells are

slide-19
SLIDE 19

Volume Rendering

? @ @ ? A B A ? A C @ , , ? D A 1 1 3 2 1 3 2 1 No intersection Contour intersects 2 edges (no ambiguity) Contour intersects 2 edges (ambiguity) Contour intersects 2 edges (no ambiguity)

slide-20
SLIDE 20

Volume Rendering

No intersection Contour intersects 2 edges (no ambiguity) Contour intersects 2 edges (ambiguity) Contour intersects 2 edges (no ambiguity) ? @ @ ? A B A ? A C @ , , ? D A 1 1 3 2 1 3 2 1

slide-21
SLIDE 21

Volume Rendering

No intersection Contour intersects 2 edges (no ambiguity) Contour intersects 2 edges (ambiguity) Contour intersects 2 edges (no ambiguity) ? @ @ ? A B A ? A C @ , , ? D A 1 1 3 2 1 3 2 1

slide-22
SLIDE 22

Volume Rendering

No intersection Contour intersects 2 edges (no ambiguity) Contour intersects 2 edges (ambiguity) Contour intersects 2 edges (no ambiguity) ? @ @ ? A B A ? A C @ , , ? D A 1 1 3 2 1 3 2 1

slide-23
SLIDE 23

Volume Rendering

slide-24
SLIDE 24

Volume Rendering

Direction of march Current cube Previously dealt with New vertex

slide-25
SLIDE 25

Volume Rendering

  • To calculate surface normal, we need to determine gradient

vector, g (derivative of the density function).

  • To estimate the gradient vector at the surface of interest, we

first estimate the gradient vectors at the vertices and interpolate the gradient at the intersection.

  • The gradient at cube vertex (i , j, k), is estimated using central

differences along the three coordinate axes by:

D (i, j, k) is the density at pixel (i, j) in slice k. !x, !y, !z are lengths of the cube edges

slide-26
SLIDE 26

Volume Rendering

slide-27
SLIDE 27

Volume Rendering

slide-28
SLIDE 28

Volume Rendering

y j =

y j = +1 V x y z k ( , , ) =

Polygon structure generated by “skimming”

slide-29
SLIDE 29

Volume Rendering

slide-30
SLIDE 30

Volume Rendering

  • scalar field

– like temperature in room at each (x,y,z)

  • many applications

– medical (MRI, CT, PET) – geophysical – fluid dynamics

slide-31
SLIDE 31

Volume Rendering

slide-32
SLIDE 32

Direct Volume Rendering

  • 3D volume data are represented by a finite number of

cross sectional slices (hence a 3D raster)

  • On each volume element (voxel), stores a data value (if

it uses only a single bit, then it is a binary data set. Normally, we see a gray value of 8 to 16 bits on each voxel.)

N x 2D arrayes = 3D array

slide-33
SLIDE 33

Direct Volume Rendering

Based on the idea of ray tracing

  • Trace from eat each pixel as a ray

into object space

  • Compute color value along the ray
  • Assign the value to the pixel
slide-34
SLIDE 34

Direct Volume Rendering

  • Maps voxel data values to optical properties
  • Color/opacity map
  • Emphasize or classify features of interest in the data
  • Piecewise linear functions, Look-up tables, 1D, 2D
  • GPU – simple shader functions, texture lookup tables

Voxel Data

  • Density
  • Temperature

Optical Properties

  • Color
  • Opacity
slide-35
SLIDE 35

Direct Volume Rendering

  • Stepping through the volume: a ray is cast into

the volume, sampling the volume at certain intervals

  • The sampling intervals are usually equi-distant,

but don’t have to be (e.g. importance sampling)

  • At each sampling location, a sample is

interpolated / reconstructed from the grid voxels

  • popular filters are: nearest neighbor (box),

trilinear (tent), Gaussian, cubic spline

  • Along the ray - what are we looking for?
slide-36
SLIDE 36

Volume Rendering

Light Source

D x y z ( , , )

t1 t2 t !

Eye Point

D x t y t z t D t I x t y t z t I t ( ( ), ( ), ( )) ( ) ( ( ), ( ), ( )) ( ) = =

Density: Illumination: Light scattered along R in direction of eye from point at t: R

I t D t P ( ) ( ) cos!

slide-37
SLIDE 37

Volume Rendering

Attenuation of light scattered from point t:

exp ( ) ! " # $ $ % & ' '

(

) D s ds

t t

1

Summing the intensity of light arriving at the eye along R from all of the elements:

B D s ds I t D t P dt

t t t t

= ! " # $ $ % & ' ' ( ) * + * ,

  • *

. *

/ / exp

( ) ( ) ( ) cos 1

1 1 2

slide-38
SLIDE 38

Volume Rendering

R

V x y z ( , , )

C R k R k ( , ) ( , ) !

C R ( )

Image Plane

slide-39
SLIDE 39

Volume Rendering

Determining the color of a voxel: C i j k

( , , )

Calculated using the Phong model, assuming that the normal is given by the gradient:

!V x y z

i j k

( , , ) f1 f2 f3 f4 ! f 1 !f 2 ! f 3 !f 4 !( ) X V X ( )

Determining the opacity: !( , , )

i j k

slide-40
SLIDE 40

Volume Rendering

Cin Cout C R k R k ( , ) ( , ) ! C C R k C R k R k

  • ut

in

= ! + ( ( , )) ( , ) ( , ) 1 " "

Transparency Term Opacity Term

C R C R k R k R i

i k K k K

( ) ( , ) ( , ) ( ( , )) = ! " # $ % & '

= + =

( )

* * 1

1

kth voxel along R

slide-41
SLIDE 41

Volume Rendering

slide-42
SLIDE 42

Volume Rendering

Depth Max Average Accumulate First Intensity

slide-43
SLIDE 43

Volume Rendering

Depth Intensity First

slide-44
SLIDE 44

Volume Rendering

Depth Intensity Average

  • Average: produces basically an X-ray picture
slide-45
SLIDE 45

Volume Rendering

Depth Intensity Max

  • Max: Maximum Intensity Projection

used for Magnetic Resonance Angiogram

slide-46
SLIDE 46

Volume Rendering

Depth Intensity Accumulate

  • Accumulate opacity while compositing colors: make transparent layers

visible! Levoy ‘88

slide-47
SLIDE 47

Volume Rendering

color

  • pacity

1.0

  • bject (color, opacity)
slide-48
SLIDE 48

color

  • pacity

1.0 volumetric compositing

  • bject (color, opacity)

Volume Rendering

slide-49
SLIDE 49

color

  • pacity

Interpolation kernel 1.0

  • bject (color, opacity)

volumetric compositing

Volume Rendering

slide-50
SLIDE 50

color c = c s !s(1 - !) + c

  • pacity ! = ! s (1 - !) + !

1.0

  • bject (color, opacity)

volumetric compositing Interpolation kernel

Volume Rendering

slide-51
SLIDE 51

color

  • pacity

1.0

  • bject (color, opacity)

volumetric compositing

Volume Rendering

slide-52
SLIDE 52

color

  • pacity

1.0

  • bject (color, opacity)

volumetric compositing

Volume Rendering

slide-53
SLIDE 53

color

  • pacity

1.0

  • bject (color, opacity)

volumetric compositing

Volume Rendering

slide-54
SLIDE 54

color

  • pacity

1.0

  • bject (color, opacity)

volumetric compositing

Volume Rendering

slide-55
SLIDE 55

color

  • pacity

1.0

  • bject (color, opacity)

volumetric compositing

Volume Rendering

slide-56
SLIDE 56

color

  • pacity
  • bject (color, opacity)

volumetric compositing

Volume Rendering

slide-57
SLIDE 57

Volume Rendering

  • 1. Raycast – once per pixel
  • 2. Sample – uniform intervals along ray
  • 3. Interpolate – trilinear interpolate, apply transfer function
  • 4. Accumulate – integrate optical properties
slide-58
SLIDE 58

Volume Rendering

  • 1. Raycast – once per pixel
  • 2. Sample – uniform intervals along ray
  • 3. Interpolate – trilinear interpolate, apply transfer function
  • 4. Accumulate – integrate optical properties
slide-59
SLIDE 59
  • Phong Shading Model
  • Requires surface normal vector
  • What’s the normal vector of a voxel? Gradient
  • Central differences between neighboring voxels

N s L d L a

n h k I n l k I k I ) ˆ ˆ ( ) ˆ ˆ ( ! + ! + =

Resulting = Ambient + Diffuse + Specular

x back front x bottom top x left right I I grad 2 ) ( , 2 ) ( , 2 ) ( ) ( ! ! ! = " =

Volume Rendering

slide-60
SLIDE 60

Volume Rendering

slide-61
SLIDE 61

Volume Rendering

slide-62
SLIDE 62

Volume Rendering

slide-63
SLIDE 63

Volume Rendering

slide-64
SLIDE 64

Volume Rendering

slide-65
SLIDE 65

Volume Rendering

Lacroute’94

slide-66
SLIDE 66

3D Texture Mapping

Consider ray casting … x y z (top view)

slide-67
SLIDE 67

3D Texture Mapping

x z y

  • Render every xz slice in the volume as a texture-mapped polygon
  • The proxy polygon will sample the volume data
  • Per-fragment RGBA (color and opacity) as classification results
  • The polygons are blended from back to front

Use pProxy geometry for sampling

slide-68
SLIDE 68

3D Texture Mapping

slide-69
SLIDE 69

3D Texture Mapping

Use Image-space axis-aligned slicing plane: the slicing planes are always parallel to the view plane

slide-70
SLIDE 70

3D Texture Mapping

slide-71
SLIDE 71

Volume Rendering

slide-72
SLIDE 72

Volume Rendering

  • forward method

– splat voxels onto screen – must interpolate to get pixel values

  • reverse method

– is ray-casting through volume – resample along ray – collect intensity/gradient info for pixel

slide-73
SLIDE 73

Volume Rendering

Compositing Order

  • front-to-back

– keep running product for the term – keep running sum of terms

  • back-to-front

– keep one variable – multiply by (1-a), add next I