Isocontour/surface Extractions 2D Isocontour 3D Isosurface.

22
Isocontour/surface Extractions 2D Isocontour 3D Isosurface

Transcript of Isocontour/surface Extractions 2D Isocontour 3D Isosurface.

Page 1: Isocontour/surface Extractions 2D Isocontour 3D Isosurface.

Isocontour/surface Extractions

2D Isocontour 3D Isosurface

Page 2: Isocontour/surface Extractions 2D Isocontour 3D Isosurface.

Isocontour (0)

Remember bi-linear interpolation

p2 p3

p0 p1

P =?

p4 p5

To know the value of P, we can first compute p4 andP5 and then linearly interpolateP

Page 3: Isocontour/surface Extractions 2D Isocontour 3D Isosurface.

Isocontour (1)

Consider a simple case: one cell data set

The problem of extracting an isocontour is an inverse of value interpolation. That is:

p2 p3

p0 p1

Gieven f(p0)=v0, f(p1)=v1, f(p2)=v2, f(p3)=v3

Find the point(s) P within the cell that have values F(p) = C

Page 4: Isocontour/surface Extractions 2D Isocontour 3D Isosurface.

Isocontour (2)

p2 p3

p0 p1

We can solve the problem based on linear interpolation

(1) Identify edges that contain points P that have value f(P) = C

(2) Calculate the positions of P

(3) Connect the points with lines

Page 5: Isocontour/surface Extractions 2D Isocontour 3D Isosurface.

Isocontouring – Step 1

(1) Identify edges that contain points P that have value f(P) = C

v1 v2

If v1 < C < v2 then the edge contains such a point

Page 6: Isocontour/surface Extractions 2D Isocontour 3D Isosurface.

Isocontouring – Step 2

(2) Calculate the position of P

Use linear interpolation:

P = P1 + (C-v1)/(v2-v1) * (P2 – P1)v1 v2

Pp1 p2

C

Page 7: Isocontour/surface Extractions 2D Isocontour 3D Isosurface.

Isocontouring – Step 3

p2 p3

p0 p1

Connect the points with line(s)

Based on the principle of linear variation, all the points on the line have values equal C

Page 8: Isocontour/surface Extractions 2D Isocontour 3D Isosurface.

Isocontour cases

How many cases can an isocontour intersect a cell?

p2 p3

p0 p1

When comparing the value of Pi with the isovalue C, there can be two cases:

Vi > = C or Vi < C

So there can be 2 * 2 * 2 * 2 = 16 cases!

Page 9: Isocontour/surface Extractions 2D Isocontour 3D Isosurface.

How many cases again?

In fact, there are only 4 unique topological cases

(1) Complete outside(inside) (2) One inside(outside), 3 outside(inside)

(3) Two inside(outside), two outside(inside) (4) Two contours pass through

Page 10: Isocontour/surface Extractions 2D Isocontour 3D Isosurface.

Inside or Outside? Just a naming convention

1. If a value is smaller than the isovalue, we call it “Inside”

2. If a value is greater than the isovalue, we call it “Outise”

p2 p3

p0 p1- +

outside cell

p2 p3

p0 p1-

inside cell

Page 11: Isocontour/surface Extractions 2D Isocontour 3D Isosurface.

Put it all together

Divide-and-conquer algorithm

1. Look at one cell at a time2. Compare the values at 4

vertices with the isovalue C

3. Linear interpolate along the edges

4. Connects the interpolated points together

Page 12: Isocontour/surface Extractions 2D Isocontour 3D Isosurface.

3D Isocontour (Isosurface)

Page 13: Isocontour/surface Extractions 2D Isocontour 3D Isosurface.

Extend the same divide-and-conquer algorithm to three dimension

• 3D cells

• Look at one cell at a time

• Let’s only focus on voxel

Isosurface Extraction

Page 14: Isocontour/surface Extractions 2D Isocontour 3D Isosurface.

Divide-and-Conquer_+

+

+

+ _

_

_

+

+

+

+ _

_

_

_

(2 triangles)

Page 15: Isocontour/surface Extractions 2D Isocontour 3D Isosurface.

How many cases?

Now we have 8 vertices

So it is: 2 = 2568

How many unique topological cases?

Page 16: Isocontour/surface Extractions 2D Isocontour 3D Isosurface.

Case Reduction (1)

Value Symmetry

+

+

_ _

_

__

_

+

+

_

_

+

+

+

+

Page 17: Isocontour/surface Extractions 2D Isocontour 3D Isosurface.

Case Reduction (2)

Rotation Symmetry

+

+

_ _

_

__

__

_

+

+

_ _

__

By inspection, we can reduce 256 14

Page 18: Isocontour/surface Extractions 2D Isocontour 3D Isosurface.

Isosurface CasesTotal number of cases: 14

Page 19: Isocontour/surface Extractions 2D Isocontour 3D Isosurface.

Marching Cubes Algorithm

A Divide-and-Conquer Algorithm

v1 v2

v3v4

v5v6

v7v8 Vi is ‘1’ or ‘0’ (one bit) 1: > C; 0: <C (C= sovalue)

Each cell has an index mapped to a value ranged [0,255]

Index = v8 v7 v6 v5 v4 v3 v2 v1

Page 20: Isocontour/surface Extractions 2D Isocontour 3D Isosurface.

Marching Cubes (2)

Given the index for each cell, a table lookup is performedto identify the edges that has intersections with the isosurface

0

12

3

14

e1, e3, e5…

Index intersection edges

e1

e2

e3

e4

e5

e6

e7

e8

e9 e10

e11 e12

Page 21: Isocontour/surface Extractions 2D Isocontour 3D Isosurface.

Marching Cubes (3)

+

+

+

+ _

_

_

_• Perform linear interpolations at the edges to calculate the intersection points

• Connect the points

Page 22: Isocontour/surface Extractions 2D Isocontour 3D Isosurface.

Why is it called marching cubes?

Linear search through cells •Row by row, layer by layer•Reuse the interpolated points for adjacent cells