Yingcai Xiao Chapter 6 Fundamental Algorithms. Types of Visualization Transformation Types 1.Data (Attribute Transformation) 2.Topology (Topological Transformation)

Slides:



Advertisements
Similar presentations
Reconstruction from Voxels (GATE-540)
Advertisements

Lecture 8 Transparency, Mirroring
CS 450: COMPUTER GRAPHICS FILLING POLYGONS SPRING 2015 DR. MICHAEL J. REALE.
Yingcai Xiao Chapter 4 The Visualization Pipeline.
November 12, 2013Computer Vision Lecture 12: Texture 1Signature Another popular method of representing shape is called the signature. In order to compute.
Direct Volume Rendering. What is volume rendering? Accumulate information along 1 dimension line through volume.
Visualization Data Representation Ray Gasser SCV Visualization Workshop – Fall 2008.
Extended Gaussian Images
CHAPTER 12 Height Maps, Hidden Surface Removal, Clipping and Level of Detail Algorithms © 2008 Cengage Learning EMEA.
2D Viewing and Projection
3DSkeleton-based Human Modeling with Metaballs 18 April 2008 Donghun Kim Robot Vision Lab.
Piecewise Convex Contouring of Implicit Functions Tao Ju Scott Schaefer Joe Warren Computer Science Department Rice University.
Informationsteknologi Wednesday, November 7, 2007Computer Graphics - Class 51 Today’s class Geometric objects and transformations.
CSE554ContouringSlide 1 CSE 554 Lecture 4: Contouring Fall 2013.
CDS 301 Fall, 2009 Scalar Visualization Chap. 5 September 24, 2009 Jie Zhang Copyright ©
University of British Columbia CPSC 314 Computer Graphics Jan-Apr 2005 Tamara Munzner Information Visualization.
Vertices and Fragments I CS4395: Computer Graphics 1 Mohan Sridharan Based on slides created by Edward Angel.
Surface Reconstruction from 3D Volume Data. Problem Definition Construct polyhedral surfaces from regularly-sampled 3D digital volumes.
Lesson 5 Representing Fields Geometrically. Class 13 Today, we will: review characteristics of field lines and contours learn more about electric field.
Introduction to Volume Visualization Mengxia Zhu Fall 2007.
Tetra-Cubes: An algorithm to generate 3D isosurfaces based upon tetrahedra BERNARDO PIQUET CARNEIRO CLAUDIO T. SILVA ARIE E. KAUFMAN Department of Computer.
Feature Sensitive Surface Extraction from Volume Data Leif P. Kobbelt Mario Botsch Ulrich Schwanecke Hans-Peter Seidel Computer Graphics Group, RWTH-Aachen.
Seminar 1 Surface Rendering, Decimation Presented By Sonali Barua Date:10/31/2005.
ITUppsala universitet Data representation and fundamental algorithms Filip Malmberg
Marching Cubes A High Resolution 3D Surface Construction Algorithm.
Introduction to 3D Graphics John E. Laird. Basic Issues u Given a internal model of a 3D world, with textures and light sources how do you project it.
Modeling and representation 1 – comparative review and polygon mesh models 2.1 Introduction 2.2 Polygonal representation of three-dimensional objects 2.3.
Volumetric and Blobby Objects Lecture 8 (Modelling)
Tracking Surfaces with Evolving Topology Morten Bojsen-Hansen IST Austria Hao Li Columbia University Chris Wojtan IST Austria.
Scalar Visualization Chap. 5 September 23, 2008 Jie Zhang Copyright ©
Technology and Historical Overview. Introduction to 3d Computer Graphics  3D computer graphics is the science, study, and method of projecting a mathematical.
C O M P U T E R G R A P H I C S Stuff Jian Chen January 15, 2010 Transformations 1/10 Describing Shape By Andries van Dam.
Scientific Visualization An Introduction Michel O. R. Eboueya Computer Sciences Department Pôle Sciences et Technologies Université de La Rochelle.
19/18/ :34 Graphics II Volume Rendering Session 10.
CS 551/651 Advanced Computer Graphics Warping and Morphing Spring 2002.
CDS 301 Fall, 2009 Vector Visualization Chap. 6 October 7, 2009 Jie Zhang Copyright ©
C O M P U T E R G R A P H I C S Guoying Zhao 1 / 14 C O M P U T E R G R A P H I C S Guoying Zhao 1 / 14 Going-through.
Marching Cubes: A High Resolution 3D Surface Construction Algorithm William E. Lorenson Harvey E. Cline General Electric Company Corporate Research and.
Introduction Image geometry studies rotation, translation, scaling, distortion, etc. Image topology studies, e.g., (i) the number of occurrences.
Stable, Circulation- Preserving, Simplicial Fluids Sharif Elcott, Yiying Tong, Eva Kanso, Peter Schröder, and Mathieu Desbrun.
Halliday/Resnick/Walker Fundamentals of Physics
Vector Field Visualization
CSE554ContouringSlide 1 CSE 554 Lecture 4: Contouring Fall 2015.
Data Visualization Fall 2015.
CHAPTER 6 (1) VECTOR VISUALIZATION. OUTLINE Vector datasets are samplings of vector fields over discrete spatial domains Visualizing Vector A number of.
CHAPTER 5 CONTOURING. 5.3 CONTOURING Fig 5.7. Relationship between color banding and contouring Contour line (isoline): the same scalar value, or isovalue.
3D Object Representations 2011, Fall. Introduction What is CG?  Imaging : Representing 2D images  Modeling : Representing 3D objects  Rendering : Constructing.
SCALAR VISUALIZATION. OUTLINE Visualizing scalar data A number of the most popular scalar visualization techniques Color mapping Contouring Height plots.
CDS 301 Fall, 2008 Image Visualization Chap. 9 November 11, 2008 Jie Zhang Copyright ©
2/24/2016 A.Aruna/Assistant professor/IT/SNSCE 1.
CDS 301 Fall, 2008 Domain-Modeling Techniques Chap. 8 November 04, 2008 Jie Zhang Copyright ©
1 Introduction to Computer Graphics with WebGL Ed Angel Professor Emeritus of Computer Science Founding Director, Arts, Research, Technology and Science.
67 x 89 = ? 67 x
3D Object Representations 2009, Fall. Introduction What is CG?  Imaging : Representing 2D images  Modeling : Representing 3D objects  Rendering : Constructing.
Computer Graphics CC416 Lecture 04: Bresenham Line Algorithm & Mid-point circle algorithm Dr. Manal Helal – Fall 2014.
Lesson Plan: Drafting and Design J6-2. What is 3D solid modeling? How do 3D solid modeling programs work?
1 E. Angel and D. Shreiner: Interactive Computer Graphics 6E © Addison-Wesley 2012 Marching Squares Ed Angel Professor Emeritus of Computer Science University.
Lecture 9 From Vertices to Fragments. Objectives Introduce basic implementation strategies Clipping Rasterization hidden-surface removal.
Simplified Representation of Vector Fields
VTK: The Visualization Toolkit
Introduction to Functions of Several Variables
Domain-Modeling Techniques
Tensor Visualization Chap. 7 October 21, 2008 Jie Zhang Copyright ©
Lecture 3 : Isosurface Extraction
Volume Graphics (lecture 4 : Isosurface Extraction)
Lecture 13 Clipping & Scan Conversion
Many of the figures from this book may be reproduced free of charge in scholarly articles, proceedings, and presentations, provided only that the following.
Visualization CSE 694L Roger Crawfis The Ohio State University.
Marching Squares Ed Angel
Presentation transcript:

Yingcai Xiao Chapter 6 Fundamental Algorithms

Types of Visualization Transformation Types 1.Data (Attribute Transformation) 2.Topology (Topological Transformation) 3.Geometry(Geometric Transformation) 4.Combined Visualization Algorithm Types 1.Scalar Algorithms 2.Vector Algorithms 3.Tensor Algorithms 4.Modeling Algorithms

Color Mapping

Scalar Algorithms: Color Mapping Color mapping is a common scalar visualization technique that maps scalar data to colors. The scalar mapping is implemented by indexing into a color lookup table (discrete).

Scalar Algorithms: Color Mapping

V i = 0 V > max => i = n-1 i = (n-1) * (V - min) / (max – min) max lower bound (mlb) i = (truncate) (n-1) * (V - min) / (max – min) least upper bound (lub) i = (ceiling) (n-1) * (V - min) / (max – min)

A Color Table

Scalar Algorithms: Color Mapping To define a color table we need to provide the number of colors and the color for each entry. To use a color table we need to provide the range of the scalar values. One color table can be used by multiple scalars.

A Color Map

Scalar Algorithms: Color Mapping A color table is discrete. A transfer function is continuous. A transfer function can be any monotonic expression that maps scalar value into a color specification (continuous). R = Fr(V); G = Fg(V); B = Fb(V);

Contouring

Scalar Algorithms: Contouring A contour is a line (2D) or a surface (3D) of constant data values.

Scalar Algorithms: Contouring

Contouring: Edge Tracking (2D) Tracks a contour as it moves across cell boundaries. 1.For each unprocessed cell, check if the contour passes through one of its edges by checking if the contour value is between the nodal data values. 2.If not, mark the cell processed and go to the next unprocessed cell. 3.If an edge intersection detected, follow the contour to the exit edge and track the contour to the next cell until the contour closes itself or exit from a boundary edge. Mark each cell processed as the contour passes it. 4.Start the next unprocessed cell till all cells are processed.

Contouring: Marching Squares (2D) Processing each cell independently, using state code to determine how to draw the contour line. 1.Loop through every cell. For each cell, 2.Encoding the state of each vertex as binary code (state code): inside (data value > contour value) or outside (data value < contour value).

Contouring: Marching Squares (2D) 3.Create an index based on the bitwise combined state codes of the vertexes. (Similar to the outcode in Cohen-Sutherland clipping) 4.Using the index to look up the topological state of the cell in a case table. (how) 5.Calculate the contour location (geometry) for each edge in the case table. (where)

Marching Squares: Case Table

Contouring: Marching Squares (2D) 16 cases (4 bit indexing) 6 unique topological cases (one unique case for n vertex inside, n = 0, 1, 2, 3, 4. One additional case for 2 inside vertexes: diagonal (vs. same side). From programming point of view, there are only 4 unique cases: no draw (n=0 or 4); cut one corner (n=1 or 3); cut one side (two connected corners); and cut two opposite corners.

Contouring Ambiguity Need to see how its neighbors are drawn to decide which way to draw. Or to use gradient information to decide which way to draw.

Marching Cubes

Marching Cubes (3D) Similar to 2D Marching Squares. Larger case table: 8 vertices, 256 cases. 15 unique cases.

Marching Cubes

Scalar Generation

Converting complex input into a scalar (single valued) to use scalar algorithms. e.g.: the length of a vector field. Each data field has one data value. value  color value  contour

Programming

Color Map Programming: Creating a Color Table vtkLookupTable *lut = vtkLookupTable:New(); lut->SetHueRange(0.667, 0); //value range [0, 2* П] lut->SetSaturationRange(1,1); lut->SetValueRange(1,1); lut->SetAlphaRange(1,1); // transparency lut->SetNumberOfColor(256); lut->Build();

Color Map Programming: Creating a Color Table Linear interpolation to build the table c: h, s, v, a; Modify the color of an entry (i) in the LUT lut->SetTableValue(i, h, s, v, a);

Color Map Programming: Using a Color Table mapper  SetLookupTable(lut) There is a default red—blue color table. Mapper maps scalars to colors according to lut (Linear interpolation b/w entries) For the default lut, it uses data range set by mapper  SetScalarRange(d 0, d 1 ) To turn the scalar-color mapping off: Mapper  ScalarVisibilityOff();

Color Map Programming: Using a Color Table To force VTK to use a single object color: Actor  GetProperty()  SetColor(R,G,B) SubClassing from vtkLookUp Table VtkLogLookUpTable uses log scale instead linear interpolation.

Contour (Isosurface) Programming // Create an implicit function (continuous) vtkQuadric *q = vtkQuadric::New(); q  SetCoefficients=(5,1,2,0,1,0,0,2,0,0); // F(x,y,z) = 5x 2 + y 2 + 2z 2 + yz + 2y F(x,y,z) = a0*x^2 + a1*y^2 + a2*z^2 + a3*x*y + a4*y*z + a5*x*z + a6*x + a7*y + a8*z + a9 //Create a sample filter (discrete) vtkSampleFunction *s = vtkSampleFunction::New(); s  SetImplicitFunction(q); s  SetSampleDimensions(50,50,50); // uniform grid

Contour (Isosurface) Programming //Create a contour filter object vtkContourFilter *c= vtkContourFilter::New(); c  SetInput(s  GetOutput()); //Create contours c  GenerateValues(4,0,3) //first: number of contours //second: starting value //third: ending value

Contour Programming //Create a mapper to hold the geometry of the contours vtkPolyDataMapper *m= vtkPolyDataMapper::New(); m  SetInput(c  GetOutput); m  SetScalarRange(0,3); // for color mapping //Create an actor to hold the geometry vtkActor *a= vtkActor::New(); a  SetMapper(m);

Contour (Isosurface) Programming

Vector Algorithms Vector data is a three-dimensional representation of direction and magnitude. 3 values: (v x, v y, v z ) => direction and length

Vector Algorithms: Directed Lines Draw a directed line based on the vector value at each data point. A scaling factor is needed to map the data vector field to the display vector field so that the displayed vectors will not be too small or too large.

Vector Algorithms: Vector Algorithms: Hedgehogs Similar to Directed Lines, but no direction arrow on the lines.

Vector Algorithms: Vector Algorithms: Oriented Glyphs Similar to Directed Lines, but use graphical objects to represent vector values.

Vector Algorithms: Vector Algorithms: Warping Deformation of geometry according to a vector field. Where DX is the deformation, V is the vector field and α is the scaling factor.

Vector Algorithms: Vector Algorithms: Displacement Plots Shows the motion of an object in the direction perpendicular to its surface. Vectors are converted to scalars by computing the dot product between the surface normal (N) and vector (V) at each point. Where D is the displacement, V is the vector field, N is the normal field and α is the scaling factor.

Vector Algorithms: Vector Algorithms: Time Animation Time dependent geometry change according to a vector field. Where dX is the geometry change, V is the vector field, α is the scaling factor and dt the time elapsed from previous step. Most vector algorithms need to use a scaling factor to map the data vector field to the display so that the displayed results will not be too small or too large.

Vector Algorithms: Vector Algorithms: Streamlines

Particle Traces: trajectories traced by fluid particles over time. Each trajectory follows a particle. Streaklines: the set of particle traces at a particular time that have previously passed through a specific point. Streamlines: a snap shot of how particles will move at different locations at a given time. The tangent of the streamline curve at any given location represents the vector value at the location. where s is the path on a streamline, V is the vector field.

Vector Algorithms: Vector Algorithms: Streamlines When the vector field is time independent, all three methods can generate the same result.

Tensor Algorithms 9 data values at each point

Tensor Algorithms Convert a tensor into three vectors (X) A  X = X det |A- I| = 0 Using three eigenvalues and three eigenvectors: 1  2  3 X 1  X 2  X 3 Tensor ellipsoid: an ellipsoid drawn using the three eigenvectors as the major, medium, minor axis.

Tensor Algorithms

Modeling Algorithms For creating or changing dataset geometry or topology.

Modeling Algorithms Source Objects: used to define geometry, read data from data file, create data. Implicit Functions: F(x, y, z) = C: Generate geometry. Region separation, F>4, F=4, F<4.

Modeling Algorithms Modeling Objects F(x,y,z) = x*x + y*y + z*z => Creates a data set with field value F(x i,y j,z k ); F(x,y,z) = 1.0; => Creates an Isosurface (a sphere object). Logical operations on two fields: F and G F  G = min(F, G) F  G = max(F,G) F - G = max(F-G)

Modeling Algorithms Implicit Modeling Scalars are generated using a distance function to a given object. Cutting: Cutting through a data set with a surface and then display the interpolated data values on the surface. Geometric intersections Interpolate data values onto the surface. Map the data into color or contours.

Modeling Algorithms Cutting: Cutting through a data set with a surface and then display the interpolated data values on the surface.