Visualisatie BMT Volume visualization Arjan Kok a.j.f.kok@tue.nl - - PowerPoint PPT Presentation

visualisatie
SMART_READER_LITE
LIVE PREVIEW

Visualisatie BMT Volume visualization Arjan Kok a.j.f.kok@tue.nl - - PowerPoint PPT Presentation

Visualisatie BMT Volume visualization Arjan Kok a.j.f.kok@tue.nl 1 Lecture overview Transparency Volume rendering Assignment 2 Transparency Makes it possible to see inside or behind objects Complement of transparency


slide-1
SLIDE 1

1

Visualisatie

BMT

Volume visualization Arjan Kok a.j.f.kok@tue.nl

slide-2
SLIDE 2

2

Lecture overview

  • Transparency
  • Volume rendering
  • Assignment
slide-3
SLIDE 3

3

Transparency

  • Makes it possible to see inside or behind objects
  • Complement of transparency is opacity
  • Opacity defined by alpha value with range [0,1]
  • Alpha = 1:

Completely opaque

  • Alpha = 0:

Completely transparent

slide-4
SLIDE 4

4

Transparency

  • Compositing
  • R = As Rs + (1 – As) Rb
  • G = As Gs + (1 – As) Gb
  • B = As Bs + (1 – As) Bb
  • A = As + (1 – As) Ab
  • Where s refers to the surface of the object,

while subscript b refers to what is behind the obj

  • 1-As is called the transmissivity, the amount of light that is

transmitted through the actor

  • Important
  • Render object in correct order: from back to front

RGBA RbGbBbAb RsGsBsAs

slide-5
SLIDE 5

5

Transparency

(0.8, 0, 0, 0.5) (0, 0.8, 0, 0.5) (0, 0, 0.8, 0.5)

(0, 0, 0, 0) (0, 0, 0.4, 0.5) (0, 0.4, 0.2, 0.75) (0.4, 0.2, 0.1, 0.875) (0.1, 0.2, 0.4, 0.875) (0.2, 0.4, 0, 0.75) (0, 0.4, 0, 0.5) (0, 0, 0, 0)

We have to sort the obj from back to front and then render them in that order !!

slide-6
SLIDE 6

6

Transparency

  • Wrong rendering order: BRG

(0.8, 0, 0, 0.5) (0, 0.8, 0, 0.5) (0, 0, 0.8, 0.5)

(0, 0, 0.4, 0.5) (0, 0, 0, 0) (0.3, 0.2, 0.175, 0.875) (0.4, 0.0, 0.2, 0. 75)

Cs = (0.4, 0, 0.2, 0.75) Cb = (0, 0.8, 0, 0.5)

slide-7
SLIDE 7

7

Surface Graphics

  • Traditionally, graphics objects are modeled with surface

primitives (surface graphics).

  • Continuous in object space
slide-8
SLIDE 8

8

Difficulty with Surface Graphics

  • Volumetric object handling
  • gases, fire, smoke, clouds (amorphous data)
  • sampled data sets (MRI, CT, scientific)
  • Peeling, cutting, sculpting
  • any operation that exposes

the interior

slide-9
SLIDE 9

9

Volume Graphics

  • Defines objects on a 3D raster, or discrete grid in object

space

  • Raster grids: structured or unstructured
  • Data sets: sampled, computed, or voxelized
  • Peeling,cutting … are easy with a volume model
slide-10
SLIDE 10

10

Volume Graphics & Surface Graphics

slide-11
SLIDE 11

11

Volume Graphics Applications (simulation data set)

  • Scientific data set visualization
slide-12
SLIDE 12

12

More Volume Graphics Applications (artistic data set)

  • Amorphous entity visualization
  • smoke, steam, fire
slide-13
SLIDE 13

13

Volume visualization

  • Surface rendering
  • Shows surfaces at

discrete values (iso- values)

  • Volume rendering
  • Shows continuous

fields in 3D

  • Enables to see through

the data

  • Data is seen more

directly; less likely to miss details

slide-14
SLIDE 14

14

Volume rendering

Volume rendering methods

  • Image-order (“ray casting or ray tracing”)
  • Object-order
  • Projection types (ray functions)
  • Maximum intensity projection
  • Average projection
  • Distance projection (compute the distance along the ray

at which a scalar value at or above val is first encountered)

  • Transparency projection (alpha compositing)
slide-15
SLIDE 15

15

Ray Traversal Schemes

slide-16
SLIDE 16

16

Image-order volume rendering

  • Ray casting
  • Image space is traversed
  • For each pixel one or more rays are fired into the volume
  • Process the data along the ray (using a projection function)

volume image plane

Base plane

slide-17
SLIDE 17

17

Image-order volume rendering

slide-18
SLIDE 18

18

Image-order volume rendering

  • During tracing ray we must sample the volume
  • Sample the volume at uniform intervals
  • Evaluate at intervals Δt along ray
  • Use a discrete representation of the line
  • Evaluate at each encountered voxel

a,b,c, - the normalized ray direction vector

slide-19
SLIDE 19

19

Image-order volume rendering

  • Uniform sampling algorithm

t = t1 // distance where the ray enter the volume initialize v while (t < t2) { // distance where the ray exits the volume x = x0 + a*t y = y0 + b*t z = z0 + c*t v = EvaluateFunction(v, t) t = t + Δt }

slide-20
SLIDE 20

20

Image-order volume rendering

slide-21
SLIDE 21

21

Image-order volume rendering

  • Interpolation function
slide-22
SLIDE 22

22

Object-order volume rendering

  • Object space (= data set) is traversed
  • For each voxel
  • Determine projection position on the view pane
  • Process data (using voxel and image information)

volume image plane

slide-23
SLIDE 23

23

Object-order volume rendering

slide-24
SLIDE 24

24

Volume rendering

Volume rendering methods

  • Image-order
  • Object-order
  • Projection types (ray functions)
  • Maximum intensity projection
  • Average projection
  • Distance projection
  • Transparency projections (compositing)
slide-25
SLIDE 25

25

Maximum intensity projection

  • Image pixel is set to

maximum sample value along ray

  • Simple(st)
  • Provides intuitive

understanding of data

  • No depth cues
slide-26
SLIDE 26

26

Average projection

  • Image pixel is set to

average value along ray

  • Simple
  • Provides less intuitive

understanding of data

  • No depth cues
slide-27
SLIDE 27

27

Distance projection

  • Image pixel is set to

distance of closest voxel with value larger than requested distance (thresholding)

  • Simple
  • Depth cues
  • Iso-surface projection
slide-28
SLIDE 28

28

Projections

slide-29
SLIDE 29

29

Transparency projections

  • Goal of visualization
  • Classification of objects
  • Selection of objects
  • Volume classification can be done by transfer functions
slide-30
SLIDE 30

30

Drebin, et. al.

Original CT Data Fat Tissue Bone Density Color and Opacity Strength Gradient NX NY NZ Shaded Transformed Final Image

slide-31
SLIDE 31

31

Transparency projections

  • Basic model: (we want to understand structure !!)
  • Each point in the volume transmits and emits light
  • Opacity and emission along ray:
  • Opacity:

α(t)

  • Emission:

ρ(t)

t

slide-32
SLIDE 32

32

Transparency projections

  • Back-to-front
  • Alpha-compositing
  • and

bg

I ) t ( I ) t ( = = ρ

Ipixel Ibg

) t ( I )) t ( a 1 ( ) t ( ) t ( ) t ( I

1 n n n n n −

− + ρ α =

1 ) t ( 0 = α

) t ( I )) t ( a 1 ( ) t ( ) t ( ) t ( I

1 2 2 2 2

− + ρ α = ∏ α − ρ ∑α =

+ = = N 1 i j j i N i i pixel

)) t ( 1 ( ) t ( ) t ( I

N samples:

) t ( I )) t ( a 1 ( ) t ( ) t ( ) t ( I

1 1 1 1

− + ρ α =

slide-33
SLIDE 33

33

Transparency projection

  • Back to front

I = I0 for i = 1 .. N do I = ρi αi + (1- αi) I

  • Front to back

I = 0 T = 1 for i = N .. 1 do I = I + ρi αi T T = (1- αi) T I = I + T I0

slide-34
SLIDE 34

34

Transfer function

  • Transfer functions
  • Assign opacity (α), and emission (ρ) to points
  • How do we assign opacity (α) to points?
  • Scalar value
  • Gradient magnitude
  • How do we assign emission (ρ) to points?
  • Scalar value
  • Illumination
slide-35
SLIDE 35

35

Transfer function - opacity

  • Opacity (α)
  • Scalar value
  • Gradient magnitude
  • Large gradients indicate change of material

                ∆ ∆ − − ∆ + ∆ ∆ − − ∆ + ∆ ∆ − − ∆ + = z 2 ) z z , y , x ( f ) z z , y , x ( f y 2 ) z , y y , x ( f ) z , y y , x ( f x 2 ) z , y , x x ( f ) z , y , x x ( f ) z , y , x ( G

slide-36
SLIDE 36

36

Transfer function - emission

  • Emission (ρ)
  • Scalar value to color (I or RGB)
slide-37
SLIDE 37

37

Illumination

  • Include lighting effects
  • Emission (ρ) depends on illumination

        = ) z , y , x ( g ) z , y , x ( g N L

( ) ∑ ⋅ + ⋅ + = ρ

i n i s i d i a a

) R V ( k ) L N ( k I I k

V is the direction of the specular reflection

slide-38
SLIDE 38

38

Illumination

slide-39
SLIDE 39

39

Volume visualization

  • Intermixing volume rendering and surface rendering
  • Get the best from both techniques in the same picture
  • Volume rendering

(bone)

  • Surface rendering

(skin)

  • Clipping
slide-40
SLIDE 40

40

Assignment

  • Volume rendering
  • Rendering not to generate image
  • Rendering to generate structured point datasets
slide-41
SLIDE 41

41

Assignment

  • Create 6 images (structured point datasets)
  • For each side of dataset

(xmin, xmax, ymin, ymax, zmin, zmax)

  • Do same volume rendering projections on each side
  • Use parallel projection
slide-42
SLIDE 42

42

Assignment

  • Use uniform sampling
  • Step size Δt equal to distance between nodes
  • No interpolation needed; use node values
  • (If accuracy not sufficient: use 0.5 Δt)

Δt

slide-43
SLIDE 43

43

Example max projection x-min

// generate scalar field to store results .. for (int j = 0; j < dims[1]; j++) { // y-direction for (int k = 0; k < dims[2]; k++) { // z-direction double max = 0.0; for (int i = 0; i < dims[0]; i++) { // projection (ray) max = Math.max(max, scalars.getScalar(i, j, k)); } // store max value in scalar field .. } }

slide-44
SLIDE 44

44

Assignment

  • Experiment with the projection types
  • Experiment with transfer functions
  • Use of scalars and gradients to compute opacity
  • Use different colors for different objects
  • Experiment with illumination, clipping, ..
  • Reminder:

                − − + − − + − − + = 2 ) 1 k , j , i ( D ) 1 k , j , i ( D 2 ) k , 1 j , i ( D ) k , 1 j , i ( D 2 ) k , j , 1 i ( D ) k , j , 1 i ( D ) k , j , i ( G

slide-45
SLIDE 45

45

Questions