1 / 57

Advanced Iso-Surfacing Algorithms

Advanced Iso-Surfacing Algorithms. Mengxia Zhu, Fall 2007. 2D Contour Display. Common method for displaying a result across a surface Contour lines: represent a constant value across the surface. 9000 ft. 10000 ft. 8000 ft. Topographic Map. Weather Map. 2D Contour Lines. p5. p4.

Télécharger la présentation

Advanced Iso-Surfacing Algorithms

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Advanced Iso-Surfacing Algorithms Mengxia Zhu, Fall 2007

  2. 2D Contour Display • Common method for displaying a result across a surface • Contour lines: represent a constant value across the surface 9000 ft 10000 ft 8000 ft Topographic Map Weather Map 2D Contour Lines

  3. p5 p4 2D contour (0) Remember bi-linear interpolation p2 p3 To know the value of P, we can first compute p4 and P5 and then linearly interpolate P P =? p1 p0

  4. p2 p3 p1 p0 Iso-contour (1) Consider a simple case: one cell data set The problem of extracting an iso-contour is an inverse of value interpolation. That is: Given 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

  5. p2 p3 p1 p0 Iso-contour (2) 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

  6. If v1 < C < v2 then the edge contains such a point v1 v2 Iso-contouring – Step 1 (1) Identify edges that contain points P that have value f(P) = C

  7. Use linear interpolation: P = P1 + (C-v1)/(v2-v1) * (P2 – P1) p1 P p2 v1 v2 C Iso-contouring – Step 2 (2) Calculate the position of P

  8. Connect the points with line(s) p2 p3 p1 p0 Iso-contouring – Step 3 Based on the principle of linear variation, all the points on the line have values equal C

  9. Cases of 2D Cells (Squares)             case 0 case 1 case 2 case 3 case 4 case 5 case 6 case 7                    case 8 case 9 case 10 case 11 case 12 case 13 case 14 case 15 By complementary and rotational symmetries, the number of the basic cases is reduced to 4     

  10. p2 p2 p3 p3 p1 p1 p0 p0 - - + outside cell inside cell Inside or Outside? • Just a naming convention • If a value is smaller than the iso-value, we call it “Inside” • If a value is greater than the iso-value, we call it “Outside”

  11. 3D Iso-surface Example

  12. Now we have 8 vertices So it is: 2 = 256 8 How many unique topological cases? How many cases for 3D?

  13. _ _ + + _ + + _ _ _ + + _ + _ + Case Reduction (1) Value Symmetry

  14. _ _ _ _ _ + _ + _ _ _ _ _ _ + + Case Reduction (2) Rotation Symmetry By inspection, we can reduce 256 14

  15. Iso-surface Cases Total number of cases: 14 + 1

  16. Marching Cubes Algorithm(1) A Divide-and-Conquer Algorithm Vi is ‘1’ or ‘0’ (one bit) 1: > C; 0: <C (C= iso-value) Each cell has an index mapped to a value ranged [0,255] Index = v8 v7 v6 v5 v4 v3 v2 v1 v8 v7 v4 v3 v6 v5 v2 v1

  17. Marching Cubes (2) Given the index for each cell, a table lookup is performed to identify the edges that has intersections with the iso-surface Index intersection edges 0 e1, e3, e5 e7 … 1 e11 e8 e12 e6 2 e3 e5 3 e2 e4 e9 e10 e1 14 Pre-defined look-up table enumerates how many triangles will make up the isosurface segment passing through the cube which edges of the cubes contain vertices of triangles, and in what order

  18. + _ + _ + _ + _ Marching Cubes (3) • Perform linear interpolations • at the edges to calculate the • intersection points • Connect the points

  19. Interpolation of Triangle Vertices • For each triangle, find an vertex location along the edge using linear interpolation of the values at the edge’s two end points where 10 20 • Vertices of triangle   30 40 t3 = t8 t4 = 30  20 t3 t4 t8 = 0 10 a

  20. Why is it called marching cubes? • Linear search through cells • Row by row, layer by layer • Reuse the interpolated points • for adjacent cells

  21. Steps in Marching Cubes • Select a cell • Classify the inside/outside state of each vertex • Create an index • Get edge list from table • Interpolate the edge location • Go to the next cell

  22. Marching Cubes at various Isovalues www.erc.msstate.edu

  23. Dividing Cubes Algorithm • Generate isosurface using dense cloud points • Use point primitive instead of triangles in MC • Conditions: • Large number of points • Density of points>= screen resolution • Lighting and shading calculation H. Cline, W. Lorensen, S. Ludke, C. Crawford, and B. Teeter, “Two algorithms for the three-dimesnional reconstruction of tomographs” Medical Physics, vol. 15, no. 3, May 1988

  24. Find Intersecting Voxel • Select a voxel (cell) and determine whether the isosurface passes through it • Whether there are scalar values at vertices both above and below the iso-value    Inside isosurface

  25. Subdivide Voxel • The voxel is subdivided into a regular grid of n1  n2  n3 subvoxels • ni = wi /R, • where R is screen resolution and wi is width of the voxel z n3 y x n2 n1

  26. Generate Points • Scalar values at the subpoints are generated using the interpolation function • Find whether the isosurface passes through each sub-voxel • If it does, generate a point at the center of the subvoxel and compute its normal • Collection of all such points compose the Dividing Cubes’ isosurface 

  27. Recursive Implementation • Recursively divide the voxel as in octree decomposition • Scalar values at the new points are interpolated • Process repeats for each sub-voxel if the isosurface passes through it • This process continues until the size of the subvoxel =< R • A point is generated at the center of the sub-voxel Hierarchy of spatial subdivisions to form an octree

  28. Dividing Squares’ Contour            

  29. Dividing Cubes’ Image Image with voxel subdivision into 4x4x4 cubes Image of human head www.cs.umbc.edu

  30. Iso-surface cell search • Iso-surface cells: cells that contain iso-surface. min < iso-value < max • Marching cubes algorithm performs a linear search to locate the iso-surface cells – not very efficient for large-scale data sets.

  31. Iso-surface Cells • For a given iso-value, only a smaller portion of cells are iso-surface cell. • For a volume with n x n x n cells, the average number of the iso-surface cells is O(n x n) (ratio of surface v.s. volume) n n n

  32. Efficient iso-surface cell search • Problem statement: Given a scalar field with N cells, c1, c2, …, cn, with min-max ranges (a1,b1), (a2,b2), …, (an, bn) Find {Ck | ak < C < bk; C=iso-value}

  33. Efficient search methods • Spatial subdivision (domain search) • Value subdivision (range search) • Contour propagation

  34. Domain search • Subdivide the space into several sub-domains, check the min/max values for each sub-domain • If the min/max values (extreme values) do not contain the iso-value, we skip the entire region Min/max Complexity = O(Klog(n/k))

  35. Range Search (1) Subdivide the cells based on their min/max ranges Global minimum Global maximum Hierarchically subdivide the cells based on their min/max ranges Isovalue

  36. Min and Max values Max M5 M2 M6 M4 M1 M3 M7 M8 M11 M10 M9 Min m5 m1 m6 m3 m8 m7 m2 m9 m11 m4 m10 Range Search (2) Within each subinterval, there are more than one cells To further improve the search speed, we sort them. Sort by what ? G1 G2 Isosurface cells = G1 G2

  37. Range Search (3) A clean range subdivision is difficult … Difficult to get an optimal speed ?

  38. Id I right I left Range Search: Interval Tree Sort all the data points (x1,x2,x3,x4,…. , xn) Let d = x (mid point) Interval Tree: n/2 We used to divide the cells into three sets Id, I left, and I right Id : cells that have min < d < max I left: cells that have max < d I right: cells that have min >d … …

  39. Id I right I left Interval Tree • Now, given an isovalue C • If C < d • If C > d • 3) If C = d … … Complexity = O(log(n)+k) Optimal!! Id : cells that have min < d < max I left: cells that have max < d I right: cells that have min >d

  40. Range Search Methods In general, range search methods all are super fast – two orders of magnitude faster than the marching cubes algorithm in terms of cell search But they all suffer a common problem … Excessive extra memory requirement!!!

  41. FIFO Queue A B C C C D …. C A E B D Contour Propagation Basic Idea: Given an initial cell that contains iso-surface, the remainder of the iso-surface can be found by propagation Initial cell: A Enqueue: B, C Dequeue: B Enqueue: D … Breadth-First Search

  42. Challenges Need to know the initial cells! For any given iso-value C, finding the initial cells to start the propagation is almost as hard as finding the iso-surface cells. You could do a global search, but …

  43. Solutions • Extrema Graph (Itoh vis’95) • Seed Sets (Bajaj volvis’96) Problem Statement: Given a scalar field with a cell set G, find a subset SG, such that for any given iso-value C, the set S contains initial cells to start the propagation. We need search through S, but S is usually (hopefully) much smaller than G.

  44. Ambiguity !

  45. 2D Ambiguous Cases   or • Ambiguous cases: • 5, 10 • Contour ambiguity arises when adjacent vertices in different states but diagonal vertices in the same state • Break contour • Join contour • Both are valid       Join contour (single loop) Break contour (two loops)

  46. 3D Ambiguity Problem Certain Marching Cube cases have more than one possible triangulation Mismatch!!! Hole! + + Case 6 Case 3 + +

  47. 3D Ambiguous Cases     • Ambiguous cases: • 3, 6, 7, 10, 12, 13 • Adjacent vertices in • different states, but diagonal vertices in the same state • Ambiguity cases may cause holes    case 3 case 6c      hole Isosurface polygons are disjoint across the common element surface

  48. The Problem Ambiguous Face: a face that has two diagonally opposing points with the same sign + + Connecting either way is possible

  49. To fix it … Match!!! + + Case 6 Case 3 B + + The goal is to come up with a consistent triangulation

  50. Solutions There are many solutions available – we present a method called: Asymptotic Decider by Nielson and Hamann (IEEE Vis’91)

More Related