1 / 29

Yingcai Xiao

Chapter 5 Basic Data Representation. Yingcai Xiao. Characteristics of Data. Discrete  Interpolation P1, P2 Regular/Irregular Data Dimensions. Data Structure Design Criterion. Compact (save space) Efficient (fast retrieval) Map- able (easy to convert)

hovan
Download Presentation

Yingcai Xiao

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. Chapter 5 Basic Data Representation • Yingcai Xiao

  2. Characteristics of Data • DiscreteInterpolation • P1, P2 • Regular/Irregular • Data Dimensions

  3. Data Structure Design Criterion • Compact (save space) • Efficient (fast retrieval) • Map-able (easy to convert) • Minimal Coverage (small foot prints) • Simple (easy to use)

  4. Dataset • Data objects in the visualization pipeline are called datasets • consisting of two pieces: an organizing structure and supplemental data attributes.

  5. Dataset • Structure: topology and geometry • Topology: is the set of properties invariant under certain geometric transformations. • Geometry: is the instantiation of the topology; the specification of positions in a 3D space. • VTK Model: the structure consists of cells and points. The cells specify the topology; while the points specify the geometry

  6. Dataset • Dataset Attribute: • Data to be visualized. • Associated with each point. • Typical attributes: scalars, vectors, normals, texture coordinates, tensors, and user-defined data.

  7. Cell Types • A data set consists of one or more cells • A cell is defined by a “type” and an ordered list of point • Type: topology, cell type • Ordered list: geometry, points • Together: organizational structure • Use Set: all the cells using a point: • U(pi) = {Ci: pi Ci}

  8. Cell Types Vertex: zero-dimensional cell, It is defined by a single point. vtkVertex Line: one dimensional cell. It is defined by two points. vtkLine Polyline: is a composite one-dimensional cell consisting of n connected lines. It is defined by an ordered list of n+1 points. vtkPolyLine Triangle: is a primary two-dimensional cell. The triangle is defined by a counter-clockwise ordered list of three points. vtkTriangle Polygon: is a primary two-dimensional cell. The polygon is defined by an ordered list of three or more points lying in a plane Tetrahedron: is a primary three-dimensional cell. It is defined by a list of four nonplanar point. VtkTetrahedron

  9. Attribute Data • Attribute data is information associated with the structure of the dataset. It is what to be visualized. • Dataset Attribute Model • Scalars • Vectors • Normals • Texture Coordinates • Tensors (The rank of a tensor is the dimension of the matrix containing its values.) • User-defined

  10. Type of Datasets • Dependent on topology of the dataset. • Uniform Grid (uniform in each direction, vtkImageData) • Parameters: • Dimension: nx, ny, nz • Origin: x0, y0, z0 • Spacing: dx, dy, dz

  11. Type of Datasets: Uniform Grid • IJK space • x = i*dx + x0 • y = j*dy + y0 • z = k*dz + z0 • Data array (i, j, k), loop i first, then j, k last. • Simple, compact and speedy retrieval. • Not flexible • Represented by vtkImageData in VTK. • Example: Fig. 5-18.

  12. Rectlinear Grid • Dimension: nx, ny, nz • Nonuniform spacing, but straight grid lines. float x[44]={0.0,1.2,2.8,3.9…….} float y[33]={1.0,……………} float z[22]={0.8,……………}

  13. Rectlinear Grid • IJK space. x = x[I]; y = y[J]; z = z[K]; • Data array (i, j, k), i changes first, then j, k last. • Simple • compact (takes O(nx +ny + nz) more space) • speedy retrieval • Little more flexible

  14. RectlinearGrid (Example Code) • vtkFloatArray * xCoords=vtkFloatArray::New(); • for(i=0;i<44;i++) xCoords-> InsertNextValue(x[i]) • vtkFloatArray * yCoords=vtkFloatArray::New(); • for(i=0;i<33;i++) yCoords-> InsertNextValue(y[i]) • vtkFloatArray * zCoords=vtkFloatArray::New(); • for(i=0;i<22;i++) zCoords-> InsertNextValue(z[i]) • vtkRectiLinearGrid * rgrid=vtkRectiLinearGrid::New(); • rgridsetXCoordinates(xCoords); rgridsetYCoordinates(yCoords); • rgridsetZCoordinates(zCoords); • rgridSetDimensions(44,33,22);

  15. Structured Grid • Dimension: nx, ny, nz • Nonuniform spacing • IJK space (no formula) • Coordinates of each grid node need to be given. x(I,J,K), y(I,J,K), z(I,J,K)

  16. Data Set:Internal Memory Structurein Generic Form

  17. Unstructured Grid • No dimensions parameters: nx, ny, nz • No IJK space • Coordinates of each node need to be given • Most flexible, can represent any structures of data • Not compact (need space to save xyz values and cell information) • Slow retrieval

  18. Data SetInternal MemoryStructure

  19. Unstructured Surface • Polygonal Surface (PolyData) • No dimensions parameters: nx, ny, nz • No IJK space • Coordinates of each node need to be given • Data value(s) on each node needs to be given

  20. Structure Representation • P1 of T1 and P2 of T2 are connected at P(1,0,0)

  21. Structure RepresentationThe Wrong Way: Making Copies Tri T1, T2; T1.P1.x=1.0; T1.P1.y=0.0; T1.P1.z=0.0; ……. T2.P2.x=1.0; T2.P2.y=0.0; T2.P2.z=0.0; ……… • class Tri{ • public: • point P1, P2, P3; };

  22. Structure Representation: Wrong Way • Each triangle keeps a copy of the vertex values. • Drawback: if the coordinate of Pis changed, all cells having a copy of its value need to be updated.

  23. Structure Representation: Correct Way • Save the vertex values in an array (Point List). • Store the indexes of the vertexes for each triangle in the triangle definition  

  24. Structure RepresentationThe Correct Way: Indexing • P2.x=1.0; • P2.y=1.0; • P2.z=0.0; • P3.x=0.0; • P3.y=1.0; • P3.z=0.0; • Point List • P0.x=0.0; • P0.y=0.0; • P0.z=0.0; • P1.x=1.0; • P1.y=0.0; • P1.z=0.0;

  25. Structure RepresentationThe Correct Way: Indexing • Tri T1, T2; • T1.ID1=0; • T1.ID2=1; • T1.ID3=3; • T2.ID1=1; • T2.ID2=2; • T2.ID3=3; • class Tri{ • public: • Int ID1, ID2, ID3; };

  26. Structure Representation: The Correct Way: Indexing • Each triangle keeps an index list (cell list) of its vertexes. • If the coordinate of Pis changed, none of the cells using it needs to be changes. Only the one copy of its value in the point list needs to be updated.

  27. Data SetInternal MemoryStructure

  28. Dataset • Structure: topology and geometry • Topology: is the set of properties invariant under certain geometric transformations. • Geometry: is the instantiation of the topology; the specification of positions in a 3D space. • VTK Model: the structure consists of cells and points. The cells specify the topology; while the points specify the geometry

  29. Summary of VTK Data Structures

More Related