Isosurfaces Lecture 7 February 6, 2020 CS530 / Spring 2020 : - - PowerPoint PPT Presentation

isosurfaces
SMART_READER_LITE
LIVE PREVIEW

Isosurfaces Lecture 7 February 6, 2020 CS530 / Spring 2020 : - - PowerPoint PPT Presentation

CS53000 - Spring 2020 Introduction to Scientific Visualization Isosurfaces Lecture 7 February 6, 2020 CS530 / Spring 2020 : Introduction to Scientific Visualization. Feb 6, 2020 7. Isosurfaces 2 Isosurfaces In Scientific Visualization


slide-1
SLIDE 1

CS53000 - Spring 2020

Introduction to Scientific Visualization

Lecture

Isosurfaces

February 6, 2020

7

slide-2
SLIDE 2

CS530 / Spring 2020 : Introduction to Scientific Visualization.

  • 7. Isosurfaces

Feb 6, 2020 2

slide-3
SLIDE 3

CS530 / Spring 2020 : Introduction to Scientific Visualization.

  • 7. Isosurfaces

Feb 6, 2020

Isosurfaces In Scientific Visualization

3

slide-4
SLIDE 4

CS530 / Spring 2020 : Introduction to Scientific Visualization.

  • 7. Isosurfaces

Feb 6, 2020 4

Isosurfaces In Scientific Visualization

slide-5
SLIDE 5

CS530 / Spring 2020 : Introduction to Scientific Visualization.

  • 7. Isosurfaces

Feb 6, 2020

Pre-image of scalar value

Applicable in any dimension Manifolds of codimension 1

Closed (except at boundaries) Nested: different values do not cross

Can consider the zero-set case:

Normals given by gradient vector of f ( )

Properties of Isocontours

5

f(x, y) = k ⇔ f(x, y) − k = 0

rf

slide-6
SLIDE 6

CS530 / Spring 2020 : Introduction to Scientific Visualization.

  • 7. Isosurfaces

Feb 6, 2020

Contours in 2D

6

Assign geometric primitives (line segments) to individual cells (process one cell at a time)

slide-7
SLIDE 7

CS530 / Spring 2020 : Introduction to Scientific Visualization.

  • 7. Isosurfaces

Feb 6, 2020

Contours in 2D

7

Assign geometric primitives (line segments) to individual cells (process one cell at a time) Consider sign of the values at vertices

slide-8
SLIDE 8

CS530 / Spring 2020 : Introduction to Scientific Visualization.

  • 7. Isosurfaces

Feb 6, 2020

Contours in 2D

8

Assign geometric primitives (line segments) to individual cells (process one cell at a time) Consider sign of the values at vertices

Intersections occur on edges with sign change

slide-9
SLIDE 9

CS530 / Spring 2020 : Introduction to Scientific Visualization.

  • 7. Isosurfaces

Feb 6, 2020

Contours in 2D

9

Assign geometric primitives (line segments) to individual cells (process one cell at a time) Consider sign of the values at vertices

Intersections occur on edges with sign change Determine exact position of intersection

slide-10
SLIDE 10

CS530 / Spring 2020 : Introduction to Scientific Visualization.

  • 7. Isosurfaces

Feb 6, 2020

Contours in 2D

Assign geometric primitives (line segments) to individual cells (process one cell at a time) Consider sign of the values at vertices

Intersections occur on edges with sign change Determine exact position of intersection Interpolate along grid edges

10

slide-11
SLIDE 11

CS530 / Spring 2020 : Introduction to Scientific Visualization.

  • 7. Isosurfaces

Feb 6, 2020

Contours in 2D

Idea: primitives must cross every grid line connecting two grid points of opposite sign

11

Interpolate along grid lines

+

  • x

x

Get cell Identify grid lines w/cross Find crossings Primitives naturally chain together

slide-12
SLIDE 12

CS530 / Spring 2020 : Introduction to Scientific Visualization.

  • 7. Isosurfaces

Feb 6, 2020

Questions

How many grid lines with crossings can there be? What are the different configurations (adjacencies) of +/- grid points?

12

slide-13
SLIDE 13

CS530 / Spring 2020 : Introduction to Scientific Visualization.

  • 7. Isosurfaces

Feb 6, 2020

Cases

13

Case Polarity Rotation Total No crossing x2 2 Singlet x2 x4 8 Double adjacent x2 x2 4 Double

  • pposite

x2 x1 2

16 = 24

slide-14
SLIDE 14

CS530 / Spring 2020 : Introduction to Scientific Visualization.

  • 7. Isosurfaces

Feb 6, 2020

Ambiguities

How to form the lines?

14

x x x x

slide-15
SLIDE 15

CS530 / Spring 2020 : Introduction to Scientific Visualization.

  • 7. Isosurfaces

Feb 6, 2020

Ambiguities

Right or wrong?

15

x x x x x x x x x x x x

slide-16
SLIDE 16

CS530 / Spring 2020 : Introduction to Scientific Visualization.

  • 7. Isosurfaces

Feb 6, 2020

Isosurfacing

Goal: given a big 3D block of numbers (“scalars”), create a picture Slicing shows data, but not its 3D shape Solution: Isosurfacing

16

slide-17
SLIDE 17

CS530 / Spring 2020 : Introduction to Scientific Visualization.

  • 7. Isosurfaces

Feb 6, 2020

A Little Math...

Scalar volume: Want to find = “All the locations where the value of is ” : isosurface of at In 2D: isocontours (some path) In 3D: isosurface Why are isosurfaces useful?

17

Sv = {(x, y, z)|f(x, y, z) = v}

Sv

f : D ⇢ I R3 ! I R (x, y, z) 7! f(x, y, z)

f

v

v

f

slide-18
SLIDE 18

CS530 / Spring 2020 : Introduction to Scientific Visualization.

  • 7. Isosurfaces

Feb 6, 2020

Notations

18

f000 f001 f100 f101 f111 Volume of data voxel vertex Each voxel transformed to unit cube f011 f110 f010

slide-19
SLIDE 19

CS530 / Spring 2020 : Introduction to Scientific Visualization.

  • 7. Isosurfaces

Feb 6, 2020

Trilinear Interpolation

In a cuboid (axis parallel)

general formula with local coordinates

19

φ(x, y, z) = axyz + bxy + cxz + dyz + ex + fy + gz + h

P = P1

+u(P2 − P1) +w(P5 − P1)

+uv(P1 − P2 + P3 − P4)

+uw(P1 − P2 + P6 − P5)

+vw(P1 − P4 + P8 − P5)

+uvw(P1 − P2 + P3 − P4 + P5 − P6 + P7 − P8) +v(P4 − P1)

P2

P1

P3

P4 P5

P6 P7 P8 P

slide-20
SLIDE 20

CS530 / Spring 2020 : Introduction to Scientific Visualization.

  • 7. Isosurfaces

Feb 6, 2020

Isosurfacing

20

slide-21
SLIDE 21

CS530 / Spring 2020 : Introduction to Scientific Visualization.

  • 7. Isosurfaces

Feb 6, 2020

Increasing the Threshold

21

slide-22
SLIDE 22

CS530 / Spring 2020 : Introduction to Scientific Visualization.

  • 7. Isosurfaces

Feb 6, 2020

Isosurface Construction

For simplicity, we shall work with zero level isosurface, and denote

22

positive vertices as

There are 8 vertices, each can be positive or negative - so there are 28 = 256 different cases

slide-23
SLIDE 23

CS530 / Spring 2020 : Introduction to Scientific Visualization.

  • 7. Isosurfaces

Feb 6, 2020

Straightforward Cases

23

There is no portion of the isosurface inside the cube!

slide-24
SLIDE 24

CS530 / Spring 2020 : Introduction to Scientific Visualization.

  • 7. Isosurfaces

Feb 6, 2020

Isosurface Construction

One Positive Vertex

24

Intersections with edges found by inverse linear interpolation (as in contouring)

x x x

slide-25
SLIDE 25

CS530 / Spring 2020 : Introduction to Scientific Visualization.

  • 7. Isosurfaces

Feb 6, 2020

Inverse Linear Interpolation

The linear interpolation formula gives value of f at specified point t: Inverse linear interpolation gives value of t at which f takes a specified value f*

  • 25

f1 f2 x1 x2 t f1 f2 x1 x2 t

f*

f*

f ∗ = (1 − t)f1 + tf2 t = f ∗ − f1 f2 − f1

slide-26
SLIDE 26

CS530 / Spring 2020 : Introduction to Scientific Visualization.

  • 7. Isosurfaces

Feb 6, 2020

Isosurface Construction

One Positive Vertex (continued)

26

Joining edge intersections across faces forms a triangle as part of the isosurface

slide-27
SLIDE 27

CS530 / Spring 2020 : Introduction to Scientific Visualization.

  • 7. Isosurfaces

Feb 6, 2020

Isosurface Construction

Two Positive Vertices at Opposite Vertices

27

slide-28
SLIDE 28

CS530 / Spring 2020 : Introduction to Scientific Visualization.

  • 7. Isosurfaces

Feb 6, 2020

Isosurface Construction

One can work through all 256 cases in this way - although it quickly becomes apparent that many cases are similar. For example:

2 cases where all are positive, or all negative, give no isosurface 16 cases where one vertex has opposite sign from all the rest

In fact, there are only 15 topologically distinct configurations

28

slide-29
SLIDE 29

CS530 / Spring 2020 : Introduction to Scientific Visualization.

  • 7. Isosurfaces

Feb 6, 2020

Canonical Cases

29

slide-30
SLIDE 30

CS530 / Spring 2020 : Introduction to Scientific Visualization.

  • 7. Isosurfaces

Feb 6, 2020

Canonical Cases

The 256 possible configurations can be grouped into these 15 canonical cases on the basis of complementarity (swapping positive and negative) and rotational symmetry. The advantage of doing this is for ease of implementation - we just need to code 15 cases not 256

30

slide-31
SLIDE 31

CS530 / Spring 2020 : Introduction to Scientific Visualization.

  • 7. Isosurfaces

Feb 6, 2020

Isosurface Construction

In some configurations, just one triangle forms the isosurface In other configurations ...

...there can be several triangles …or a polygon with 4, 5 or 6 points which can be triangulated

A software implementation will have separate code for each configuration

31

slide-32
SLIDE 32

CS530 / Spring 2020 : Introduction to Scientific Visualization.

  • 7. Isosurfaces

Feb 6, 2020

Marching Cubes Algorithm

Step 1: Classify the eight vertices relative to the isosurface value

32

8-bit index ; 1 ; 0 -

V1 V2 V3 V4 V5 V6 V7 V8

Code identifies edges intersected:

V1V4; V1V5; V2V3; V2V6; V5V8; V7V8; V4V8

+

1 1 1

slide-33
SLIDE 33

CS530 / Spring 2020 : Introduction to Scientific Visualization.

  • 7. Isosurfaces

Feb 6, 2020

Marching Cubes Algorithm

Step 2: Look up table which identifies the canonical configuration For example:

33

00000000 Configuration 0 10000000 Configuration 1 01000000 Configuration 1 … 11000001 Configuration 6 … 11111111 Configuration 0

slide-34
SLIDE 34

CS530 / Spring 2020 : Introduction to Scientific Visualization.

  • 7. Isosurfaces

Feb 6, 2020

Marching Cubes Algorithm

Step 3: Inverse linear interpolation along the identified edges will locate the intersection points Step 4: The canonical configuration will determine how the pieces of the isosurface are created (0, 1, 2, 3 or 4 triangles) Step 5: Pass triangles to renderer for display Algorithm marches from cube to cube between slices, and then from slice to slice to produce a smoothly triangulated surface

34

slide-35
SLIDE 35

CS530 / Spring 2020 : Introduction to Scientific Visualization.

  • 7. Isosurfaces

Feb 6, 2020

Case 12

Three positive vertices on the bottom plane; and one positive vertex on the top plane, directly above the single negative on the bottom plane. Solution…?

35

slide-36
SLIDE 36

CS530 / Spring 2020 : Introduction to Scientific Visualization.

  • 7. Isosurfaces

Feb 6, 2020

Three positive vertices on the bottom plane; and one positive vertex on the top plane, directly above the single negative on the bottom plane. Solution…?

36

slide-37
SLIDE 37

CS530 / Spring 2020 : Introduction to Scientific Visualization.

  • 7. Isosurfaces

Feb 6, 2020

Marching Cubes Algorithm

Advantages

isosurfaces good for extracting boundary layers surface defined as triangles in 3D - well-known rendering techniques available for lighting, shading and viewing ... with hardware support

Disadvantages

shows only a slice of data topological ambiguities?

37

slide-38
SLIDE 38

CS530 / Spring 2020 : Introduction to Scientific Visualization.

  • 7. Isosurfaces

Feb 6, 2020

Topological Ambiguities

Marching cubes suffers from exactly the same problems that we saw in contouring

38

Case 3: Triangles are chosen to slice off the positive vertices - but could they have been drawn another way?

slide-39
SLIDE 39

CS530 / Spring 2020 : Introduction to Scientific Visualization.

  • 7. Isosurfaces

Feb 6, 2020

Ambiguities on Faces

On the front face, we have exactly the same ambiguity problem we had with contouring We can determine which pair of intersections to connect by looking at value at saddle point (∇f=0)

39

slide-40
SLIDE 40

CS530 / Spring 2020 : Introduction to Scientific Visualization.

  • 7. Isosurfaces

Feb 6, 2020

Ambiguities on Faces

Trouble occurs because:

trilinear interpolant is only linear along the edges

  • n a face, it becomes a bilinear function ... and for

correct topology we must join the correct pair of intersections

40

Case 3 has two triangle pieces cutting off corners!

slide-41
SLIDE 41

CS530 / Spring 2020 : Introduction to Scientific Visualization.

  • 7. Isosurfaces

Feb 6, 2020

Ambiguities on Faces

Trouble occurs because:

trilinear interpolant is only linear along the edges

  • n a face, it becomes a bilinear function ... and for

correct topology we must join the correct pair of intersections

41

6 configurations include ambiguous faces .. but here is another interpretation! Case 3 has two triangle pieces cutting off corners!

slide-42
SLIDE 42

CS530 / Spring 2020 : Introduction to Scientific Visualization.

  • 7. Isosurfaces

Feb 6, 2020

Holes in Isosurfaces

Because of the ambiguity, early implementations which did not allow for this could leave holes (“cracks”) where cells join

42

Cases 12 and 3 in adjoining cells can cause holes

slide-43
SLIDE 43

CS530 / Spring 2020 : Introduction to Scientific Visualization.

  • 7. Isosurfaces

Feb 6, 2020

Resolving the Face Ambiguities

Using the saddle point method to determine the correct behavior on a face

generates sub-cases for each of the 6 ambiguous configurations which sub-case is chosen depends on the value of the saddle-point on the face note that some configurations have several ambiguous faces so many subcases arise - e.g., see config 13! if we do not extend the 15 cases there is chance of holes appearing in surface

43

slide-44
SLIDE 44

CS530 / Spring 2020 : Introduction to Scientific Visualization.

  • 7. Isosurfaces

Feb 6, 2020

Trilinear Interpolant

The trilinear function:

f(x,y,z) = f000(1-x)(1-y)(1-z) +f100x(1-y)(1-z) +f010(1-x)y(1-z) + f001(1-x)(1-y)z +f110xy(1-z) +f101x(1-y)z +f011(1-x)yz +f111xyz

is deceptively complex! For example, the isosurface of f(x,y,z) = 0 is a cubic surface

44

slide-45
SLIDE 45

CS530 / Spring 2020 : Introduction to Scientific Visualization.

  • 7. Isosurfaces

Feb 6, 2020

Accurate Isosurface of Trilinear Interpolant

45

True isosurface of a trilinear function is a curved surface

  • cf. contouring where

contours are hyperbola We are in fact approximating by the triangles shown

slide-46
SLIDE 46

CS530 / Spring 2020 : Introduction to Scientific Visualization.

  • 7. Isosurfaces

Feb 6, 2020

Interior Ambiguities

In some cases there can also be ambiguities in the interior Consider case where opposite corners are positive Two possibilities: separated or tunnel

46

slide-47
SLIDE 47

CS530 / Spring 2020 : Introduction to Scientific Visualization.

  • 7. Isosurfaces

Feb 6, 2020

Resolving the Interior Ambiguity

Decided by value at body saddle point Negative: two separate shells Positive: tunnel

47

rf = 0 i.e., ∂f ∂x = ∂f ∂y = ∂f ∂z = 0

slide-48
SLIDE 48

CS530 / Spring 2020 : Introduction to Scientific Visualization.

  • 7. Isosurfaces

Feb 6, 2020

Marching Tetrahedra

As in contouring, another solution is to divide into simpler shapes - here they are tetrahedra

48

24 tetrahedra in all

Fit linear function in each tetrahedron: f(x,y,z) = a + bx + cy + dz Isosurface of linear function is triangle

Value at centre = average of vertex values

slide-49
SLIDE 49

CS530 / Spring 2020 : Introduction to Scientific Visualization.

  • 7. Isosurfaces

Feb 6, 2020

Marching Tetrahedra

A disadvantage of the ‘24’ marching tetrahedra is the large number of triangles which are created - slowing down the rendering time There are versions that just use 5 tetrahedra

49

slide-50
SLIDE 50

CS530 / Spring 2020 : Introduction to Scientific Visualization.

  • 7. Isosurfaces

Feb 6, 2020

References

Original marching cubes algorithm

Lorensen and Cline (1987)

Face ambiguities

Nielson and Hamann (1992)

Interior ambiguities

Chernyaev (1995)

Accurate marching cubes

Lopes and Brodlie (2003)

50

slide-51
SLIDE 51

CS530 / Spring 2020 : Introduction to Scientific Visualization.

  • 7. Isosurfaces

Feb 6, 2020

The Span Space

Livnat, Shen, Johnson 1996

Given: Data cells in 8D Past (active list): Intervals in a 1D Value space New: Points in the 2D Span Space Benefit: Points do not exhibit any spatial relationships

51 Isovalue Isovalue Minimum

min = max

Maximum

slide-52
SLIDE 52

CS530 / Spring 2020 : Introduction to Scientific Visualization.

  • 7. Isosurfaces

Feb 6, 2020

The Span Space

Search

Find all the points minimum < isovalue isovalue < maximum Semi-infinite area Quadrant

52 Isovalue Isovalue Minimum

min = max

Maximum

slide-53
SLIDE 53

CS530 / Spring 2020 : Introduction to Scientific Visualization.

  • 7. Isosurfaces

Feb 6, 2020 Maximum Minimum

min = max

The Span Space

Search for rectangles using Kd-tree O(n log(n)) to build Search Complexity O(√ n+k) Recursively divide each axis along median

53

slide-54
SLIDE 54

CS530 / Spring 2020 : Introduction to Scientific Visualization.

  • 7. Isosurfaces

Feb 6, 2020

Interval Tree

Cignoni et al, 1997

54