CSE554Contouring IISlide 1 CSE 554 Lecture 5: Contouring (faster) Fall 2013.

Slides:



Advertisements
Similar presentations
Christian Lauterbach COMP 770, 2/16/2009. Overview  Acceleration structures  Spatial hierarchies  Object hierarchies  Interactive Ray Tracing techniques.
Advertisements

2009. April. 01 Yongsu Song PNU STEM Lab
Nearest Neighbor Search
Advanced Iso-Surfacing Algorithms Jian Huang, CS594, Spring 2002 This set of slides are developed and used by Prof. Han-Wei Shen at Ohio State University.
INTERVAL TREE & SEGMENTATION TREE
Augmenting Data Structures Advanced Algorithms & Data Structures Lecture Theme 07 – Part I Prof. Dr. Th. Ottmann Summer Semester 2006.
I/O-Algorithms Lars Arge Fall 2014 September 25, 2014.
Searching on Multi-Dimensional Data
Volume Graphics (lecture 5 : Contour Tree / Contour Spectrum) lecture notes acknowledgement : J. Snoeyink, C. Bajaj Bong-Soo Sohn School of Computer Science.
Binary Trees, Binary Search Trees CMPS 2133 Spring 2008.
Quadtrees Raster and vector.
CSE554ContouringSlide 1 CSE 554 Lecture 4: Contouring Fall 2013.
Contour Tree and Small Seed Sets for Isosurface Traversal Marc van Kreveld Rene van Oostrum Chandrajit Bajaj Valerio Pascucci Daniel R. Schikore.
K-structure, Separating Chain, Gap Tree, and Layered DAG Presented by Dave Tahmoush.
2-dimensional indexing structure
lecture 4 : Isosurface Extraction
Octree-Based Decimation of Marching Cubes Surface (1996) Raj Shekhar Elias Fayyad Roni Yagel J. Fredrick Cornhill.
Advanced Iso- Surfacing Algorithms Mengxia Zhu, Fall 2007.
1 Trees. 2 Outline –Tree Structures –Tree Node Level and Path Length –Binary Tree Definition –Binary Tree Nodes –Binary Search Trees.
I/O-Algorithms Lars Arge University of Aarhus March 1, 2005.
I/O-Algorithms Lars Arge Spring 2009 March 3, 2009.
UNC Chapel Hill M. C. Lin Overview of Last Lecture About Final Course Project –presentation, demo, write-up More geometric data structures –Binary Space.
Fast Isocontouring For Improved Interactivity Chandrajit L. Bajaj Valerio Pascucci Daniel R. Schikore.
Implicit Representations of Surfaces and Polygonalization Algorithms Dr. Scott Schaefer.
R-Trees 2-dimensional indexing structure. R-trees 2-dimensional version of the B-tree: B-tree of maximum degree 8; degree between 3 and 8 Internal nodes.
Efficient Distance Computation between Non-Convex Objects By Sean Quinlan Presented by Sean Augenstein and Nicolas Lee.
AALG, lecture 11, © Simonas Šaltenis, Range Searching in 2D Main goals of the lecture: to understand and to be able to analyze the kd-trees and.
Binary Trees Chapter 6.
Contour Trees CSE Han-Wei Shen. Level Sets Level set: Level sets is also called Isolines for n=2, isosurface for n=3, or isocontours in general.
Orthogonal Range Searching I Range Trees. Range Searching S = set of geometric objects Q = query object Report/Count objects in S that intersect Q Query.
Isosurface Extractions 2D Isocontour 3D Isosurface.
Volumetric and Blobby Objects Lecture 8 (Modelling)
Spatial Data Structures Jason Goffeney, 4/26/2006 from Real Time Rendering.
Chapter Tow Search Trees BY HUSSEIN SALIM QASIM WESAM HRBI FADHEEL CS 6310 ADVANCE DATA STRUCTURE AND ALGORITHM DR. ELISE DE DONCKER 1.
10/09/2001CS 638, Fall 2001 Today Spatial Data Structures –Why care? –Octrees/Quadtrees –Kd-trees.
UNC Chapel Hill M. C. Lin Orthogonal Range Searching Reading: Chapter 5 of the Textbook Driving Applications –Querying a Database Related Application –Crystal.
CSCE350 Algorithms and Data Structure Lecture 17 Jianjun Hu Department of Computer Science and Engineering University of South Carolina
B-trees and kd-trees Piotr Indyk (slides partially by Lars Arge from Duke U)
Binary Trees, Binary Search Trees RIZWAN REHMAN CENTRE FOR COMPUTER STUDIES DIBRUGARH UNIVERSITY.
2IL50 Data Structures Fall 2015 Lecture 9: Range Searching.
Orthogonal Range Search
3D Object Representations
CSE554ContouringSlide 1 CSE 554 Lecture 4: Contouring Fall 2015.
CSE554FairingSlide 1 CSE 554 Lecture 6: Fairing Fall 2015.
Hank Childs, University of Oregon Isosurfacing (Part 3)
Spatial Indexing Techniques Introduction to Spatial Computing CSE 5ISC Some slides adapted from Spatial Databases: A Tour by Shashi Shekhar Prentice Hall.
R-Trees: A Dynamic Index Structure For Spatial Searching Antonin Guttman.
CHAPTER 5 CONTOURING. 5.3 CONTOURING Fig 5.7. Relationship between color banding and contouring Contour line (isoline): the same scalar value, or isovalue.
Hierarchical Volume Rendering
AQUASUN - GLSVLSI '02April 19, AQUASUN: an adaptable 2D range index for CAD applications Michiel De Wilde Ghent University, Belgium.
DATA STRUCTURE BS(IT)3rd. Tree An Introduction By Yasir Mustafa Roll No. BS(IT) Bahauddin Zakariya University, Multan.
Lecture 3 : Isosurface Extraction. Isosurface Definition  Isosurface (i.e. Level Set ) :  Constant density surface from a 3D array of data  C(w) =
CSE554Contouring IISlide 1 CSE 554 Lecture 5: Contouring (faster) Fall 2015.
CSE554Contouring IISlide 1 CSE 554 Lecture 3: Contouring II Fall 2011.
Fifth International Conference on Curves and Surfaces Incremental Selective Refinement in Hierarchical Tetrahedral Meshes Leila De Floriani University.
Adversarial Search 2 (Game Playing)
Ray Tracing Optimizations
Ray Tracing Acceleration (3)
UNC Chapel Hill M. C. Lin Geometric Data Structures Reading: Chapter 10 of the Textbook Driving Applications –Windowing Queries Related Application –Query.
1 R-Trees Guttman. 2 Introduction Range queries in multiple dimensions: Computer Aided Design (CAD) Geo-data applications Support special data objects.
School of Computing Clemson University Fall, 2012
CSE 554 Lecture 5: Contouring (faster)
Isosurface Extractions (II)
Mean Shift Segmentation
Binary and Ternary Search
CSE373: Data Structures & Algorithms Lecture 23: Applications
Orthogonal Range Searching and Kd-Trees
Quadtrees 1.
An O(n log n)-Time Algorithm for the k-Center Problem in Trees
Continuous Density Queries for Moving Objects
Presentation transcript:

CSE554Contouring IISlide 1 CSE 554 Lecture 5: Contouring (faster) Fall 2013

CSE554Contouring IISlide 2 Review Iso-contours – Points where a function evaluates to a same value (iso-value) Smooth thresholded boundaries Contouring methods – Primal methods Marching Squares (2D) and Cubes (3D) Placing vertices on grid edges – Dual methods Dual Contouring (2D,3D) Placing vertices in grid cells PrimalDual

CSE554Contouring IISlide 3 Efficiency Iso-contours is very often used for visualizing 3D volumes – The volume data can be large (e.g, 1000^3) MRI, CT, Ultrasound, EM, etc. – The user often needs to view surfaces as she changes iso-values An efficient contouring algorithm is needed – Optimized for viewing one volume at multiple iso-values

CSE554Contouring IISlide 4 Marching Squares - Revisited Active cell – A grid cell where {min, max} of 4 corner values encloses the iso-value Algorithm – Visit each cell. – If active, create vertices and edges Time complexity: O(n+k) n: the number of all grid cells k: the number of active cells Iso-value = 3.5 O(n) O(k)

CSE554Contouring IISlide 5 Marching Squares - Revisited Running time (seconds) Iso-value Only visiting each square and checking if it is active (without creating vertices and edges) O(n) Marching Squares O(n+k)

CSE554Contouring IISlide 6 Speeding Up Contouring Data structures that allow faster query of active cells – Quadtrees (2D), Octrees (3D) Hierarchical spatial structures for quickly pruning large areas of inactive cells Complexity: O(k*Log(n)) – Interval trees An optimal data structure for range finding Complexity: O(k+Log(n))

CSE554Contouring IISlide 7 Interval Trees Running time (seconds) Iso-value Marching Squares O(n+k) Quadtree O(k*Log(n)) Interval tree O(k+Log(n))

CSE554Contouring IISlide 8 Speeding Up Contouring Data structures that allow faster query of active cells – Quadtrees (2D), Octrees (3D) Hierarchical spatial structures for quickly pruning large areas of inactive cells Complexity: O(k*Log(n)) – Interval trees An optimal data structure for range finding Complexity: O(k+Log(n))

CSE554Contouring IISlide 9 Quadtrees (2D) Basic idea:coarse-to-fine search – Start with the entire grid: If the {min, max} of all grid values does not enclose the iso-value, stop. Otherwise, divide the grid into four sub-grids and repeat the check within each sub-grid. If the sub-grid is a unit cell, it’s an active cell.

CSE554Contouring IISlide 10 Quadtrees (2D) Basic idea:coarse-to-fine search – Start with the entire grid: If the {min, max} of all grid values does not enclose the iso-value, stop. Otherwise, divide the grid into four sub-grids and repeat the check within each sub-grid. If the sub-grid is a unit cell, it’s an active cell. Iso-value in {min,max} Iso-value not in {min,max}

CSE554Contouring IISlide 11 Quadtrees (2D) Basic idea:coarse-to-fine search – Start with the entire grid: If the {min, max} of all grid values does not enclose the iso-value, stop. Otherwise, divide the grid into four sub-grids and repeat the check within each sub-grid. If the sub-grid is a unit cell, it’s an active cell. Iso-value in {min,max} Iso-value not in {min,max}

CSE554Contouring IISlide 12 Quadtrees (2D) Basic idea:coarse-to-fine search – Start with the entire grid: If the {min, max} of all grid values does not enclose the iso-value, stop. Otherwise, divide the grid into four sub-grids and repeat the check within each sub-grid. If the sub-grid is a unit cell, it’s an active cell. Iso-value in {min,max} Iso-value not in {min,max}

CSE554Contouring IISlide 13 Quadtrees (2D) Basic idea:coarse-to-fine search – Start with the entire grid: If the {min, max} of all grid values does not enclose the iso-value, stop. Otherwise, divide the grid into four sub-grids and repeat the check within each sub-grid. If the sub-grid is a unit cell, it’s an active cell. Iso-value in {min,max} Iso-value not in {min,max}

CSE554Contouring IISlide 14 Quadtrees (2D) Basic idea:coarse-to-fine search – Start with the entire grid: If the {min, max} of all grid values does not enclose the iso-value, stop. Otherwise, divide the grid into four sub-grids and repeat the check within each sub-grid. If the sub-grid is a unit cell, it’s an active cell. Iso-value in {min,max} Iso-value not in {min,max}

CSE554Contouring IISlide 15 Quadtrees (2D) A degree-4 tree – Root node: entire grid – Each node maintains: {min, max} in the enclosed part of the image (in a non-leaf node) 4 children nodes for the 4 quadrants {1,5} {1,3}{2,4} {3,5} Grid Level-1 nodes (leaves) Root node Quadtree

CSE554Contouring IISlide 16 Quadtrees (2D) Tree building: bottom-up – Each grid cell becomes a leaf node – Assign a parent node to every group of 4 nodes Compute the {min, max} of the parent node from those of the children nodes Padding dummy leaf nodes (e.g., {-∞,-∞}) if the dimension of grid is not power of 2 {1,3}{2,4} {3,5}{2,4} {1,5} Grid Leaf nodes Root node

CSE554Contouring IISlide 17 Tree building: a recursive algorithm Quadtrees (2D) // A recursive function to build a single quadtree node // for a sub-grid at corner (lowX, lowY) and with length len buildNode (lowX, lowY, len) 1.If (lowX, lowY) is out of range: Return a leaf node with {-∞,-∞} 2.If len = 1: Return a leaf node with {min, max} of corner values 3.Else 1.c1 = buildNode (lowX, lowY, len/2) 2.c2 = buildNode (lowX + len/2, lowY, len/2) 3.c3 = buildNode (lowX, lowY + len/2, len/2) 4.c4 = buildNode (lowX + len/2, lowY + len/2, len/2) 5.Return a node with children {c1,…,c4} and {min, max} of all {min, max} of these children // Building a quadtree for a grid whose longest dimension is len Return buildNode (1, 1, 2^Ceiling[Log[2,len]])

CSE554Contouring IISlide 18 Quadtrees (2D) Tree building: bottom-up – Each grid cell becomes a leaf node – Assign a parent node to every group of 4 nodes Compute the {min, max} of the parent node from those of the children nodes Padding background leaf nodes (e.g., {-∞,-∞}) if the dimension of grid is not power of 2 – Complexity: O(n) Total number of nodes in the tree is < 2n But we only need to do this once (after that, the tree can be used to speed up contouring at any iso- value) {1,3}{2,4} {3,5}{2,4} {1,5} Grid Leaf nodes Root node

CSE554Contouring IISlide 19 Quadtrees (2D) Contouring with a quadtree: top-down – Starting from the root node – If {min, max} of the node encloses the iso-value If the node is not a leaf, search within each of its children If the node is a leaf, contour in that grid cell {1,5} {1,3}{2,4} {3,5}{2,4} Leaf nodes Root node Grid iso-value = 2.5

CSE554Contouring IISlide 20 Quadtrees (2D) // A recursive function to contour in a quadtree node // for a sub-grid at corner (lowX, lowY) and with length len contourNode (node, iso, lowX, lowY, len) 1.If iso is within {min, max} of node 1.If len = 1: do Marching Squares in this grid square 2.Else (let the 4 children be c1,…,c4) 1.contourNode (c1, iso, lowX, lowY, len/2) 2.contourNode (c2, iso, lowX + len/2, lowY, len/2) 3.contourNode (c3, iso, lowX, lowY + len/2, len/2) 4.contourNode (c4, iso, lowX + len/2, lowY + len/2, len/2) // Contouring using a quadtree whose root node is Root // for a grid whose longest dimension is len contourNode (Root, iso, 1, 1, 2^Ceiling[Log[2,len]]) Contouring with a quadtree: a recursive algorithm

CSE554Contouring IISlide 21 Quadtrees (2D) Contouring with a quadtree: top-down – Starting from the root node – If {min, max} of the node encloses the iso-value If the node is an intermediate node, search within each of its children nodes If the node is a leaf, output contour in that grid square – Complexity: (at most) O(k*Log(n)) Much faster than O(k+n) (Marching Squares) if k<<n But not efficient when k is large (can be as slow as O(n)) {1,5} {1,3}{2,4} {3,5}{2,4} Leaf nodes Root node Grid iso-value = 2.5

CSE554Contouring IISlide 22 Quadtrees (2D) Running time (seconds) Iso-value Marching Squares O(n+k) Quadtree O(k*Log(n))

CSE554Contouring IISlide 23 Quadtrees (2D): Summary Algorithm – Preprocessing: building the quad tree Independent of iso-values – Contouring: traversing the quad tree – Both are recursive algorithms Time complexity – Tree building: O(n) Slow, but one-time only – Contouring: O(k*Log(n))

CSE554Contouring IISlide 24 Octrees (3D): Overview Algorithm: similar to quadtrees – Preprocessing: building the octree Each non-leaf node has 8 children nodes, one for each octant of grid – Contouring: traversing the octree – Both are recursive algorithms Time complexity: same as quadtrees – Tree building: O(n) Slow, but one-time only – Contouring: O(k*Log(n))

CSE554Contouring IISlide 25 Speeding Up Contouring Data structures that allow faster query of active cells – Quadtrees (2D), Octrees (3D) Hierarchical spatial structures for quickly pruning large areas of inactive cells Complexity: O(k*Log(n)) – Interval trees An optimal data structure for range finding Complexity: O(k+Log(n))

CSE554Contouring IISlide 26 Interval Trees Basic idea – Each grid cell occupies an interval of values {min, max} An active cell’s interval intersects the iso-value – Stores all intervals in a search tree for efficient intersection queries Minimizes the “path” from root to all leaves intersecting any given iso-value 0255 Iso-value

CSE554Contouring IISlide 27 Interval Trees A binary tree – Root node: all intervals in the grid – Each node maintains: δ : Median of end values of all intervals (used to split the children intervals) (in a non-leaf node) Two children nodes – Left child: intervals strictly lower than δ – Right child: intervals strictly higher than δ Two sorted lists of intervals intersecting δ – Left list (AL): ascending order of min-end of each interval – Right list (DR): descending order of max-end of each interval

CSE554Contouring IISlide 28 Interval Trees Intervals: Interval tree: δ=7 δ=4δ=10 AL: d,e,f,g,h,i DR: i,e,g,h,d,f AL: j,k,l DR: l,j,k AL: m DR: m AL: a,b,c DR: c,a,b δ=12

CSE554Contouring IISlide 29 Interval Trees Intersection queries: top-down – Starting with the root node If the iso-value is smaller than δ – Scan through AL: output all intervals whose min-end is smaller than iso-value. – Go to the left child. If the iso-value is larger than δ – Scan through DR: output all intervals whose max-end is larger than iso-value. – Go to the right child. If iso-value equals δ – Output AL (or DR).

CSE554Contouring IISlide 30 Interval Trees Intervals: Interval tree: δ=7 δ=4δ=10 AL: d,e,f,g,h,i DR: i,e,g,h,d,f AL: j,k,l DR: l,j,k AL: m DR: m AL: a,b,c DR: c,a,b δ=12 iso-value = 9

CSE554Contouring IISlide 31 Interval Trees Intervals: Interval tree: δ=7 δ=4δ=10 AL: d,e,f,g,h,i DR: i,e,g,h,d,f AL: j,k,l DR: l,j,k AL: m DR: m AL: a,b,c DR: c,a,b δ=12 iso-value = 9

CSE554Contouring IISlide 32 Interval Trees Intervals: Interval tree: δ=7 δ=4δ=10 AL: d,e,f,g,h,i DR: i,e,g,h,d,f AL: j,k,l DR: l,j,k AL: m DR: m AL: a,b,c DR: c,a,b δ=12 iso-value = 9

CSE554Contouring IISlide 33 Interval Trees Intersection queries: top-down – Starting with the root node If the iso-value is smaller than δ – Scan through AL: output all intervals whose min-end is smaller than iso-value. – Go to the left child. If the iso-value is larger than δ – Scan through DR: output all intervals whose max-end is larger than iso-value. – Go to the right child. If iso-value equals δ – Output AL (or DR). – Complexity: O(k + Log(n)) k: number of intersecting intervals (active cells) Much faster than O(k+n) (Marching squares/cubes)

CSE554Contouring IISlide 34 Interval Trees Tree building: top-down – Starting with the root node (which includes all intervals) – To create a node from a set of intervals, Find δ (the median of all ends of the intervals). Sort all intervals intersecting with δ into the AL, DR Construct the left (right) child from intervals strictly below (above) δ – A recursive algorithm

CSE554Contouring IISlide 35 Interval Trees Intervals: Interval tree:

CSE554Contouring IISlide 36 Interval Trees Intervals: Interval tree: δ=7 AL: d,e,f,g,h,i DR: i,e,g,h,d,f

CSE554Contouring IISlide 37 Interval Trees Intervals: Interval tree: δ=7 δ=4 AL: d,e,f,g,h,i DR: i,e,g,h,d,f AL: a,b,c DR: c,a,b

CSE554Contouring IISlide 38 Interval Trees Intervals: Interval tree: δ=7 δ=4δ=10 AL: d,e,f,g,h,i DR: i,e,g,h,d,f AL: j,k,l DR: l,j,k AL: a,b,c DR: c,a,b

CSE554Contouring IISlide 39 Interval Trees Intervals: Interval tree: δ=7 δ=4δ=10 AL: d,e,f,g,h,i DR: i,e,g,h,d,f AL: j,k,l DR: l,j,k AL: m DR: m AL: a,b,c DR: c,a,b δ=12

CSE554Contouring IISlide 40 Interval Trees Tree building: top-down – Starting with the root node (which includes all intervals) – To create a node from a set of intervals, Find δ (the median of all ends of the intervals). Sort all intervals intersecting with δ into the AL, DR Construct the left (right) child from intervals strictly below (above) δ – A recursive algorithm – Complexity: O(n*Log(n)) A linear sweep at each level of the tree Depth of the tree is Log(n) (as a result of using the median to split) Again, this is one-time only

CSE554Contouring IISlide 41 Interval Trees Running time (seconds) Iso-value Marching Squares O(n+k) Quadtree O(k*Log(n)) Interval tree O(k+Log(n))

CSE554Contouring IISlide 42 Interval Trees: Summary Algorithm – Preprocessing: building the interval tree Independent of iso-values – Contouring: traversing the interval tree – Both are recursive algorithms Tree-building and traversing are same in 2D and 3D Time complexity – Tree building: O(n*log(n)) Slow, but one-time – Contouring: O(k+log(n))

CSE554Contouring IISlide 43 Further Readings Quadtree/Octrees: – “Octrees for Faster Isosurface Generation”, Wilhelms and van Gelder (1992) Interval trees: – “Dynamic Data Structures for Orthogonal Intersection Queries”, by Edelsbrunner (1980) – “Speeding Up Isosurface Extraction Using Interval Trees”, by Cignoni et al. (1997)

CSE554Contouring IISlide 44 Further Readings Other acceleration techniques: – “Fast Iso-contouring for Improved Interactivity”, by Bajaj et al. (1996) Growing connected component of active cells from pre-computed seed locations – “View Dependent Isosurface Extraction”, by Livnat and Hansen (1998) Culling invisible mesh parts – “Interactive View-Dependent Rendering Of Large Isosurfaces”, by Gregorski et al. (2002) Level-of-detail: decreasing mesh resolution based on distance from the viewer Gregorski et al. Livnat and Hansen