CPS 533 Scientific Visualization Wensheng Shen Department of

  • Slides: 13
Download presentation
CPS 533 Scientific Visualization Wensheng Shen Department of Computational Science SUNY Brockport

CPS 533 Scientific Visualization Wensheng Shen Department of Computational Science SUNY Brockport

Vtk File Formats n The visualization file formats consist of five basic parts. #vtk

Vtk File Formats n The visualization file formats consist of five basic parts. #vtk data. File Version 2. 0 ] (1) ] (2) BINARY ] (3) Really cool data ASCII | DATASET type … POINT_DATA n … CELL_DATA n … (4) (5) Part 1: Header Part 2: Title Part 3: Data type Part 4: Geometry/topology. Type Is on of: STRUCTURED_POINTS, STRUCTURED_GRID, UNSTRUCTURED_GRID, POLYDATA RECTILINEAR_GRID FIELD Part 5: Dataset attributes. The number data items n of each Type must match the number of Points in the dataset.

n n n n data. Type is one of the types bit, unsigned_char, short,

n n n n data. Type is one of the types bit, unsigned_char, short, int, float, or double. All keyword phrases are written in ASCII form whether the file is binary or ASCII. The binary section of the file (if in binary form) is the data property: point coordinates, scalars, cell indices, and so forth. Indices are 0 -offset. Thus the first point is point id 0. If both the data attribute and geometry/topology part are present in the file, then the number of data values defined in the data attribute part must exactly match the number of points defined in the geometry/topoloty part. Cell types and indices are of type int. Binary data must be placed into the file immediately after the “newline” character from the previous ASCII keyword and parameter sequence. The geometry/topology description must occur prior to the data attribute description.

Dataset Format n Structured Point DATASET STRUCTURED_POINTS DIMENSIONS nx ny nz ORIGIN x y

Dataset Format n Structured Point DATASET STRUCTURED_POINTS DIMENSIONS nx ny nz ORIGIN x y z SPACING sx sy sz

n Structured Grid DATASET STRUCTURED_GRID DIMENSIONS nx ny nz POINTS n data. Type P

n Structured Grid DATASET STRUCTURED_GRID DIMENSIONS nx ny nz POINTS n data. Type P 0 x p 0 y p 0 z P 1 x p 1 y p 1 z … P(n-1)x p(n-1)y p(n-1)z

n Rectilinear Grid DATASET RECTILINEAR_GRID DIMENSIONS nx ny nz X_COORDINATES nx data. Type x

n Rectilinear Grid DATASET RECTILINEAR_GRID DIMENSIONS nx ny nz X_COORDINATES nx data. Type x 0 x 1 … x(nx-1) Y_COORDINATES ny data. Type y 0 y 1 … y(ny-1) Z_COORDINATES nz data. Type z 0 z 1 … z(nz-1)

n Polygonal Data DATASET POLYDATA POINTS n data. Type p 0 x p 0

n Polygonal Data DATASET POLYDATA POINTS n data. Type p 0 x p 0 y p 0 z P 1 x p 1 y p 1 z … P(n-1)x p(n-1)y p(n-1)z VERTICES n size num. Points 0, i 0, j 0, k 0, … num. Points 1, i 1, j 1, k 1, … num. Points 2, i 2, j 2, k 2, … … num. Pointsn-1, in-1, jn-1, kn-1, … LINES n size num. Points 0, i 0, j 0, k 0, … num. Points 1, i 1, j 1, k 1, … … num. Pointsn-1, in-1, jn-1, kn-1, … POLYGONS n size num. Points 0, i 0, j 0, k 0, … num. Points 1, i 1, j 1, k 1, … num. Points 2, i 2, j 2, k 2, … … num. Pointsn-1, in-1, jn-1, kn-1, … TRIANGLE_STRIPS n size num. Points 0, i 0, j 0, k 0, … num. Points 1, i 1, j 1, k 1, … num. Points 2, i 2, j 2, k 2, … … num. Pointsn-1, in-1, jn-1, kn-1, …

n Unstructured Grid DATASET UNSTRUCTURED_GRID POINTS n data. Type p 0 x p 0

n Unstructured Grid DATASET UNSTRUCTURED_GRID POINTS n data. Type p 0 x p 0 y p 0 z P 1 x p 1 y p 1 z … P(n-1)x p(n-1)y p(n-1)z CELLS n size num. Points 0, i 0, j 0, k 0, … num. Points 1, i 1, j 1, k 1, … num. Points 2, i 2, j 2, k 2, … CELL_TYPES n type 0 type 1 type 2 … typen-1

Attribute Format n Scalars SCALARS data. Name data. Type LOOKUP_TABLE table. Name s 0

Attribute Format n Scalars SCALARS data. Name data. Type LOOKUP_TABLE table. Name s 0 s 1 … sn-1 COLOR_SCALARS data. Name n. Values s 0 c 01 … c 0(n. Values-1) c 10 c 11 … c 1(n. Values-1) c(n-1)0 c(n-1)1 … c(n-1)(n. Values-1)

n Lookup Table LOOKUP_TABLE table. Name size r 0 g 0 b 0 a

n Lookup Table LOOKUP_TABLE table. Name size r 0 g 0 b 0 a 0 r 1 g 1 b 1 a 1 … rsize-1 gsize-1 bsize-1 n Vectors VECTORS data. Name data. Type v 0 x v 0 y v 0 z v 1 x v 1 y v 1 z … v(n-1)x v(n-1)y v(n-1)z

n Normals NORMALS data. Name data. Type n 0 x n 0 y n

n Normals NORMALS data. Name data. Type n 0 x n 0 y n 0 z n 1 x n 1 y n 1 z … n(n-1)x n(n-1)y n(n-1)z n Texture Coordinates TEXTURE_COORDINATES data. Name dim data. Type t 00 t 01 … t 0(dim-1) t 10 t 11 … t 1(dim-1) … t(n-1)0 t(n-1)1 … t(n-1)(dim-1)

n Tensors TENSORS data. Name data. Type t 000 t 001 t 002 t

n Tensors TENSORS data. Name data. Type t 000 t 001 t 002 t 010 t 011 t 012 t 020 t 021 t 022 … tn-100 tn-101 tn-102 tn-110 tn-111 tn-112 tn-120 tn-121 tn-122

Examples # vtk Data. File Version 2. 0 Cube example ASCII DATASET POLYDATA POINTS

Examples # vtk Data. File Version 2. 0 Cube example ASCII DATASET POLYDATA POINTS 8 float 0. 0 0. 0 1. 0 0. 0 1. 0 POLYGONS 6 30 40123 44567 40154 42376 40473 41265 POINT_DATA 8 SCALARS sample_scalars float LOOKUP_TABLE my_table 0. 0 1. 0 2. 0 3. 0 4. 0 5. 0 6. 0 7. 0 LOOKUP_TABLE my_table 8 0. 0 1. 0 0. 0 1. 0