This article is written in: 🇺🇸

Data Types and Structures

VTK uses 3D geometries, including points, lines, polygons, and volumes. It handles images and volumetric data for 2D and 3D visualization. It works with scalar, vector, and tensor fields for complex data representation. Supports structured and unstructured grid types for various spatial data layouts. Includes support for time-series data and hierarchical datasets.

vtkDataObject

I. Base class for all data objects in VTK

II. Stores data and metadata including

III. Common subclasses include

  1. vtkImageData: Handles regular, rectilinear grid data.
  2. vtkRectilinearGrid: Manages grid data with varying spacing.
  3. vtkStructuredGrid: Deals with structured data points in 3D space.
  4. vtkPolyData: Specializes in representing polygonal data.
  5. vtkUnstructuredGrid: Ideal for representing complex, irregular grid data.

|
|--- vtkDataObject
     |
     |--- vtkDataSet
          |
          |--- vtkPointSet
          |    |
          |    |--- vtkPolyData
          |    |
          |    |--- vtkStructuredPoints (vtkImageData)
          |    |
          |    |--- vtkStructuredGrid
          |    |
          |    |--- vtkUnstructuredGrid
          |
          |--- vtkRectilinearGrid
          |
          |--- vtkCompositeDataSet
               |
               |--- vtkHierarchicalBoxDataSet
               |
               |--- vtkMultiBlockDataSet
               |
               |--- vtkHierarchicalDataSet
               |
               |--- vtkOverlappingAMR
               |
               |--- vtkNonOverlappingAMR

vtkImageData

image_data

vtkRectilinearGrid

rectilinear_grid

vtkPolyData

poly_data

vtkStructuredGrid

structured_grid

vtkUnstructuredGrid

unstructured_grid

Structured vs Unstructured Grids

Structured Grids Unstructured Grids
Characteristics Regular grids with fixed topology Irregular grids with flexible topology
Examples vtkImageData, vtkRectilinearGrid, vtkStructuredGrid vtkUnstructuredGrid
Advantages Easier to work with, more memory-efficient Highly versatile in handling complex shapes
Disadvantages Limited flexibility in representing complex geometries Less memory-efficient and can be computationally intensive

Multiblock Dataset

multiblock_dataset

A vtkMultiBlockDataSet organizes datasets (or blocks) hierarchically. Each block can be a vtkDataSet subclass or another composite dataset, allowing versatile dataset organization. For instance, a vtkMultiBlockDataSet might contain blocks like vtkPolyData, vtkStructuredGrid, and even another vtkMultiBlockDataSet. This structure is invaluable in large-scale simulations where data is segmented into blocks representing different simulation areas or system components, enabling VTK to manage complex, multi-part datasets coherently.

Choosing the Right Data Structure

VTK Data Object Purpose and Use Cases Complexity Flexibility Efficiency
PolyData Ideal for representing 3D surfaces and complex shapes like sculptures or terrain models. Moderate: Comprised of polygons and polylines, allowing for manipulation and detailing. High: Excellent for complex, arbitrary shapes including intricate surface details. High: Efficiently stores data specific to the shape, omitting unnecessary information.
Structured Grids Suitable for 3D grid-based data like volumetric images or regular spatial data. Low: Simple, regular structure with implicit connectivity, making it straightforward to handle. Low: Confined to regular grid shapes, limiting its application to uniformly structured data. High for regular data: Efficiently handles uniformly spaced data but less suitable for irregular datasets.
Unstructured Grids Used for complex, irregular shapes like biological structures or geological formations. High: Requires detailed definition of point connectivity, accommodating intricate geometries. High: Extremely versatile, capable of representing any shape, be it regular or irregular. Low to Moderate: Efficiency varies with the shape's complexity; generally less efficient than structured grids.
Structured Points (ImageData) Perfect for regularly spaced data such as medical imaging (CT, MRI scans) or 3D textures. Low: Simple and regular, with implicit connectivity for easy navigation. Low: Restricted to regular grid shapes, ideal for uniformly spaced data. Very High: Optimal for regular data thanks to implicit connectivity and uniform structure.
Rectilinear Grids Appropriate for data with variable resolution, like atmospheric or oceanic datasets. Moderate: Allows variable spacing while maintaining a regular grid structure. Moderate: More adaptable than regular grids but less so than unstructured grids. High: More efficient than unstructured grids for data that aligns with its variable but regular structure.

Table of Contents

    Data Types and Structures
    1. vtkDataObject
    2. vtkImageData
    3. vtkRectilinearGrid
    4. vtkPolyData
    5. vtkStructuredGrid
    6. vtkUnstructuredGrid
    7. Structured vs Unstructured Grids
    8. Multiblock Dataset
    9. Choosing the Right Data Structure