medical imaging and virtual medicine - udgggg.udg.edu/events/dbartz/indirect3_print.pdf · medical...

30
1 Dirk Bartz, Visual Computing for Medicine [email protected] Lecture 3: Transfer Functions, Indirect Volume Rendering Medical Imaging and Virtual Medicine [email protected] VCM 2005 Outline 1D Transfer Functions nD Transfer Functions Indirect Volume Rendering

Upload: dinhnhi

Post on 13-Jul-2018

217 views

Category:

Documents


0 download

TRANSCRIPT

1

Dirk Bartz, Visual Computing for [email protected]

Lecture 3:

Transfer Functions,Indirect Volume Rendering

Medical Imaging and Virtual Medicine

[email protected] 2005

Outline

1D Transfer Functions

nD Transfer Functions

Indirect Volume Rendering

2

[email protected] 2005

1D Transfer Functions (1)

• 4-tupels of color (r,g,b) and opacity (α) are assigned to histogram values (voxel values):

• Focus is on material interfaces

• Increases spectrum of frequencies in dataset:

tf:v → (r,g,b,α)

ftotal = fds x ftf

[email protected] 2005

1D Transfer Functions (2)

Example of Transfer Function• Histogram

• Rising or falling edges indicate material interface

• Gradientmagnitudealso useful

3

[email protected] 2005

1D Transfer Functions (3)

Example of Transfer Function• Histogram

• Opacity

[email protected] 2005

1D Transfer Functions (4)

Example of Transfer Function• Histogram

• Opacity

• Red channel

4

[email protected] 2005

1D Transfer Functions (5)

Example of Transfer Function• Histogram

• Opacity

• Red channel

• Blue channel

[email protected] 2005

1D Transfer Functions (6)

Example of Transfer Function• Histogram

• Opacity

• Red channel

• Blue channel

• Final color

5

[email protected] 2005

1D Transfer Functions (7)

Fluid (CSF)

Tissue

[email protected] 2005

Outline

1D Transfer Functions

nD Transfer Functions

Indirect Volume Rendering

6

[email protected] 2005

nD Transfer Functions (1)

• 4-tupel of color (r,g,b) and opacity (α) are assigned to histogram values (voxel values), gradient magnitudes, 2. derivatives

• Better specification of material interfaces

tf:(v,v‘,v‘‘) → (r,g,b,α)

[email protected] 2005

nD Transfer Functions (2)

1D Histogram2D Histogram

7

[email protected] 2005

nD Transfer Functions (3)

3D Transfer Function Editor (Univ. of Utah):

[J. Kniss et al., 2001]

[email protected] 2005

nD Transfer Functions (3)

3D Transfer Function Editor (Univ. of Utah):

[J. Kniss et al., 2001]

Enhances zero-crossing of 2. derivative

8

[email protected] 2005

nD Transfer Functions (4)

Typical Transfer Function Marker:

[J. Kniss et al., 2001]

[email protected] 2005

nD Transfer Functions (5)

[J. Kniss et al., 2001]

Color Table

9

[email protected] 2005

nD Transfer Functions (6)

Visible Male Dataset(Cyro sections)

[J. Kniss et al., 2001]

TF for air

TF for tooth…

[email protected] 2005

Outline

1D Transfer Functions

nD Transfer Functions

Indirect Volume Rendering

10

[email protected] 2005

Indirect Volume Rendering (1)

• Extracts polygonal surface from volume data

• Surface represents an isosurface

• Like isolines (2D) are isosurfaces 2-manifolds with same voxel value

• Also known as 3D contours

• Most popular algorithm: Marching Cubes[Lorensen, Cline, SIGGRAPH 1987]

[email protected] 2005

Indirect Volume Rendering (2)

• Isosurfaces are specified by voxel value• Separates areas above and below voxel

value• Equivalent to binary transfer function• Equivalent to threshold segmentation

• In this case, classification and segmentation essentially identical

• Isosurface can also be computed on segmented data

11

[email protected] 2005

Indirect Volume Rendering (3)

• Threshold equivalent to binary transfer function for opacity

[email protected] 2005

Indirect Volume Rendering (4)

• Problem: Data is only discretely defined , hence not explicitly computable

• Solution: Approximation of surface based on cells

• Example 2D:

• f(v) ≥ t

12

[email protected] 2005

Indirect Volume Rendering (5)

• In the 2D case, we have 24 different configurations.

• With symmetry, (rotations) down to 7

• With complements down to 5 configurations1 2 3

4 4a

[email protected] 2005

Indirect Volume Rendering (6)

• Case 4 leads to a (not decidable) problem:

• Avoid inconsistencies by deciding always for the same way of treatment

4 4aor

4a4

13

[email protected] 2005

Indirect Volume Rendering (7)

• If triangles are used instead of quads, then there are no ambiguities.

• Indicates ambiguous nature of problem

[email protected] 2005

Indirect Volume Rendering (8)

In 3D, we examine volume cells instead of image cells:

• Six faces, eight voxels, 12 edges

• Algorithm: Marching Cubes

14

[email protected] 2005

Indirect Volume Rendering (9)

Marching Cubes:[Lorensen, Cline SIGGRAPH 1987]

1. Load four slices of grid into memory (two for cell, two more for normals)

2. Generate cell, with four voxels from center slices

3. Classify voxels of cell as in two-dimensional case in marked - edge intersects isosurface- and unmarked

[email protected] 2005

Indirect Volume Rendering (10)

4. Compute case index: For each marked voxel a certain bit in a byte is set, resulting 28= 256 cases, of marked and unmarked voxels. This can be organized into 14 equivalence classes for 3D case.

v3 v2

v1v0

v7 v6

v5v4

v6 v5v7 v4 v3 v2 v1 v0index =

15

[email protected] 2005

Indirect Volume Rendering (11)

Example: • v0,v5 are above isovalue,

• v1,v2,v3,v4,v6,v7 are below isovalue

• Resulting in case 33

v3 v2

v1v0

v7 v6

v5v4

0 10 0 0 0 0 1index = = 33

[email protected] 2005

Indirect Volume Rendering (13)

The 256 cases ofMarching-Cubes –can be mapped by rotation, mirroringat a plane andcomplement op’into 14 equivalence classes.

16

[email protected] 2005

Indirect Volume Rendering (14)

5. Marching Cubes assumes, that the investigates surface intersects exactly oncethe cell edges with one marked and one unmarked voxel The intersected edges and respective triangles can be indicated and computed based on the indices of the pre-computed 256 case table.

[email protected] 2005

Indirect Volume Rendering (15)

Entry in look-up-table for Index 33 contains:

• Pointer to intersected edges e0; e3; e8; e4; e5; e9

• Instructions how totriangulate intersections into triangles (e3; e0; e8) and (e4; e9; e5).

0 10 0 0 0 0 1index = = 33

e0

v3 v2

v1v0

v7 v6

v5v4

e1

e2e3

e4

e5

e6e7

e8 e9

e10e11

17

[email protected] 2005

Indirect Volume Rendering (16)

6. Compute exact position of sample point vs on intersected edges by linear interpolation:

with isovalue c

( )( )( ) ( )ab

bvfvfcvfa −

−=

bas vaavv )1( −+=

[email protected] 2005

Indirect Volume Rendering (17)

7. Compute normals at triangle vertices:• Use central differences at

voxels• Approximate

gradient magnitude• Combination of

interpolation weights v3 v2

v1v0

v7 v6

v5v4

v4

18

[email protected] 2005

Indirect Volume Rendering (18)

7. Compute normals at triangle vertices:• Use central differences at

voxels• ∇Vijk = ||Dijk||, with

vi,j,k vi+1,j,kvi-1,j,k

vi,j-1,k

vi,j+1,k

vi,j,k-1

vi,j,k+1

⎟⎟⎟

⎜⎜⎜

−−+−−+

−−+=

⎟⎟⎟

⎜⎜⎜

=1,,1,,

,1,,1,,,1,,1

ijk

ijk

ijk

ijk

kjVikjVikjVikjVikjVikjVi

zDyDxD

D

[email protected] 2005

Indirect Volume Rendering (19)

8. Current cell moves on (marches) to next cell in grid and continues as in instruction 2. or 1., until the whole volume has been traversed.

Already processed cellMarching direction

Current cellNew edgesAlready processed edges

19

[email protected] 2005

Indirect Volume Rendering (20)

Ambiguities due to Triangulation:

• Right cube complementary to left one

• Separating triangulation in left cube, and connecting triangulation in right cube. Hole in triangulation remains between red lines

[email protected] 2005

Indirect Volume Rendering (21)

Ambiguities due to Triangulation:

• Avoid problem with ambiguous triangulation of face, if treated consistently, either always triangulated separating or connecting.

20

[email protected] 2005

Indirect Volume Rendering (22)

Ambiguities due to Triangulation:

• Cell tessellation with tetrahedron

• Compute additional support points

• Consistent case table (255 table, VTK)

[email protected] 2005

Cell Tessellation with Tetrahedrons:• Volume cell can be tessellated into five / six

tetrahedrons.

• Additional edges on main and minor diagonalsof cell

• Consistent choice of diagonals

Indirect Volume Rendering (23)

21

[email protected] 2005

Indirect Volume Rendering (24)

Cell Tessellation with Tetrahedrons:• New case table

Pros and Cons:+ Simple (small lookup-tables)+ Consistent (resolves ambiguities)- Generates twice as many triangles as

Marching Cubes

[email protected] 2005

Indirect Volume Rendering (25)

Resolving of Ambiguities through additional Support Points:

• Computes additional support points

22

[email protected] 2005

Indirect Volume Rendering (26)

Resolve Ambiguities through full Case Table:

• Case table not reduced (except 0,255)

• Does not correct cases, but treats problem cases consistently

• Used in VTK

[email protected] 2005

Indirect Volume Rendering (27)

Example for Indirect Volume Rendering:• Artery

23

[email protected] 2005

Indirect Volume Rendering (28)

cell

Example for Indirect Volume Rendering:

• Artery

[email protected] 2005

Indirect Volume Rendering (29)

Example for Indirect Volume Rendering:• CT Lobster

Lacks volumetric depths

24

[email protected] 2005

Indirect Volume Rendering (30)

Example for Indirect Volume Rendering:• Lunge

Diamond artifact

[email protected] 2005

Indirect Volume Rendering (31)

Pros:• Well established

• Uses graphics hardware

• Flexible use

• Portable

Cons:• No real volumetric

depth

• Large number of small triangles

• Many triangles smaller than a pixel

• Pre-processing required

• Diamond artifacts

25

[email protected] 2005

Indirect Volume Rendering (32)

Optimizations:• Grid-Snapping

• Hierarchical data structures

• Occlusion culling

• Mesh simplification

[email protected] 2005

Indirect Volume Rendering (33)

Grid-Snapping:• If edge intersection close to grid point, we get

small triangles

• These triangles can be long and narrow.

• These triangles are numerically instable.

26

[email protected] 2005

Indirect Volume Rendering (34)

Grid-Snapping: • If distance of intersection to grid is below

threshold, they are moved onto the grid point

• If more than one vertex of the triangle is moved, we get a degenerated triangle, which can be removed.

• We might get non-manifold surfaces

[email protected] 2005

Indirect Volume Rendering (35)

Grid-Snapping:• New vertices on grid might be re-balanced by

moving turning point to grid point

27

[email protected] 2005

Indirect Volume Rendering (36)

Grid-Snapping:• Grid-Snapping enables data reduction

42.642.625.718.313.33.30Reduction Rate in %83083010741182125413981446Number of Vertices0.4950.460.40.30.20.10Grid-Snapping Parameter

[email protected] 2005

Indirect Volume Rendering (37)

Hierarchical Data Structures:• To skip „empty“ areas

• Representation in varying accuracy• Might lead to holes (Cracks)• Accuracy metric must be defined carefully• Eg. Octrees, BSP-trees, kd-trees

28

[email protected] 2005

Indirect Volume Rendering (38)

Hierarchical Data Structures:• Octree blocks with isosurface are highly refined

(down to cell level)

• Blocks without isosurface are less refined

[email protected] 2005

Indirect Volume Rendering (39)

Occlusion Culling:• Occluded (not visible) parts of polygonal

isosurfaces are not rendered (culled)

• Tests can be done based on Octree

• More information later on

View frustum

29

[email protected] 2005

Indirect Volume Rendering (40)

Mesh Simplification:• Marching Cubes meshes are highly refined, but

are limited to volume cells

• Lot of space for simplifications, if adequate metric is available

• Unfortunately not well accepted in medicine (quality reduction)

[email protected] 2005

Indirect Volume Rendering (41)

Dual Marching Cubes:• Computes patches of triangles

• Takes dual representation of patches

• Smoother representation

[Nielson, IEEE Vis 2004]

30

[email protected] 2005

Image Source

• Andreas Schilling (University of Tübingen)

• Kindlmann, Durkin: VolVis 1998

• Kniss et al., http://www.cs.utah.edu/~jmk