weiguang guan guanw@sharcnetguanw/ss2018/ss-2018-viz.pdf · many file formats ... example of vtk...
TRANSCRIPT
![Page 1: Weiguang Guan guanw@sharcnetguanw/ss2018/ss-2018-viz.pdf · Many file formats ... Example of VTK legacy formats File “quadrilateral.vtk” # vtk DataFile Version 3.0 Just an example](https://reader034.vdocuments.net/reader034/viewer/2022042115/5e92b595a16a1259e311f525/html5/thumbnails/1.jpg)
Weiguang Guan
Code and data: http://www.sharcnet.ca/~guanw
![Page 2: Weiguang Guan guanw@sharcnetguanw/ss2018/ss-2018-viz.pdf · Many file formats ... Example of VTK legacy formats File “quadrilateral.vtk” # vtk DataFile Version 3.0 Just an example](https://reader034.vdocuments.net/reader034/viewer/2022042115/5e92b595a16a1259e311f525/html5/thumbnails/2.jpg)
Overview of ParaView Introduction
Open source
General-purpose visualization package
Large user base
Kitware, Los Alomas, Sandia National Labs, etc
www.paraview.org
Latest version 5.5
![Page 3: Weiguang Guan guanw@sharcnetguanw/ss2018/ss-2018-viz.pdf · Many file formats ... Example of VTK legacy formats File “quadrilateral.vtk” # vtk DataFile Version 3.0 Just an example](https://reader034.vdocuments.net/reader034/viewer/2022042115/5e92b595a16a1259e311f525/html5/thumbnails/3.jpg)
Overview of ParaView Introduction
Parallel visualization of large data
Either standalone or client/server mode
Multiple platforms (Windows, Linux/Unix, MacOS)
Multi-dimensional and/or Multi-variables
Rich functionalities implemented as filters
Many file formats
Various data types
Scripting
![Page 4: Weiguang Guan guanw@sharcnetguanw/ss2018/ss-2018-viz.pdf · Many file formats ... Example of VTK legacy formats File “quadrilateral.vtk” # vtk DataFile Version 3.0 Just an example](https://reader034.vdocuments.net/reader034/viewer/2022042115/5e92b595a16a1259e311f525/html5/thumbnails/4.jpg)
Overview of ParaView Documentations and resources
Mailing lists:
Users:
http://www.paraview.org/mailman/listinfo/paraview
Developers
http://www.paraview.org/mailman/listinfo/paraview-developers
Help online F1 or context-sensitive
![Page 5: Weiguang Guan guanw@sharcnetguanw/ss2018/ss-2018-viz.pdf · Many file formats ... Example of VTK legacy formats File “quadrilateral.vtk” # vtk DataFile Version 3.0 Just an example](https://reader034.vdocuments.net/reader034/viewer/2022042115/5e92b595a16a1259e311f525/html5/thumbnails/5.jpg)
Overview of ParaView Documentations and resources
Guide: http://www.paraview.org/paraview-guide
Wiki: http://www.paraview.org/Wiki/ParaView
Tutorials: http://www.paraview.org/tutorials
Webinars: http://www.paraview.org/webinars
![Page 6: Weiguang Guan guanw@sharcnetguanw/ss2018/ss-2018-viz.pdf · Many file formats ... Example of VTK legacy formats File “quadrilateral.vtk” # vtk DataFile Version 3.0 Just an example](https://reader034.vdocuments.net/reader034/viewer/2022042115/5e92b595a16a1259e311f525/html5/thumbnails/6.jpg)
Dataset types inside ParaView Structured data
vtkImageData (uniform rectilinear grid, *.vti)
vtkRectilinearGrid (rectilinear grid, *.vtr)
vtkStructuredGrid (curvilinear grid, *.vts)
Unstructured data
vtkPolyData (*.vtp)
vtkUnstructuredGrid (*.vtu)
![Page 7: Weiguang Guan guanw@sharcnetguanw/ss2018/ss-2018-viz.pdf · Many file formats ... Example of VTK legacy formats File “quadrilateral.vtk” # vtk DataFile Version 3.0 Just an example](https://reader034.vdocuments.net/reader034/viewer/2022042115/5e92b595a16a1259e311f525/html5/thumbnails/7.jpg)
Structured data Having topological structure
Uniform rectilinear grid Rectilinear grid Curvilinear grid
![Page 8: Weiguang Guan guanw@sharcnetguanw/ss2018/ss-2018-viz.pdf · Many file formats ... Example of VTK legacy formats File “quadrilateral.vtk” # vtk DataFile Version 3.0 Just an example](https://reader034.vdocuments.net/reader034/viewer/2022042115/5e92b595a16a1259e311f525/html5/thumbnails/8.jpg)
Unstructured data Without regular topological structure
Polygonal data Unstructured grid
![Page 9: Weiguang Guan guanw@sharcnetguanw/ss2018/ss-2018-viz.pdf · Many file formats ... Example of VTK legacy formats File “quadrilateral.vtk” # vtk DataFile Version 3.0 Just an example](https://reader034.vdocuments.net/reader034/viewer/2022042115/5e92b595a16a1259e311f525/html5/thumbnails/9.jpg)
Points vs Cells
![Page 10: Weiguang Guan guanw@sharcnetguanw/ss2018/ss-2018-viz.pdf · Many file formats ... Example of VTK legacy formats File “quadrilateral.vtk” # vtk DataFile Version 3.0 Just an example](https://reader034.vdocuments.net/reader034/viewer/2022042115/5e92b595a16a1259e311f525/html5/thumbnails/10.jpg)
Cell types
![Page 11: Weiguang Guan guanw@sharcnetguanw/ss2018/ss-2018-viz.pdf · Many file formats ... Example of VTK legacy formats File “quadrilateral.vtk” # vtk DataFile Version 3.0 Just an example](https://reader034.vdocuments.net/reader034/viewer/2022042115/5e92b595a16a1259e311f525/html5/thumbnails/11.jpg)
Why cells? A cell is defined by
One or more points, and
Their connections (topology)
Points are discrete in 3D space
Cells are enclosed space in 1D (lines), 2D (polygons), and 3D (hexahedra)
Continuous space
Interpolation
![Page 12: Weiguang Guan guanw@sharcnetguanw/ss2018/ss-2018-viz.pdf · Many file formats ... Example of VTK legacy formats File “quadrilateral.vtk” # vtk DataFile Version 3.0 Just an example](https://reader034.vdocuments.net/reader034/viewer/2022042115/5e92b595a16a1259e311f525/html5/thumbnails/12.jpg)
Attributes Attributes associated with points and/or cells
Point data
Cell data
![Page 13: Weiguang Guan guanw@sharcnetguanw/ss2018/ss-2018-viz.pdf · Many file formats ... Example of VTK legacy formats File “quadrilateral.vtk” # vtk DataFile Version 3.0 Just an example](https://reader034.vdocuments.net/reader034/viewer/2022042115/5e92b595a16a1259e311f525/html5/thumbnails/13.jpg)
Attributes Attribute types
Scalar (e.g., temperature, density, pressure, etc.)
Vector (e.g., velocity)
Normal
Color
Tensor
Field
![Page 14: Weiguang Guan guanw@sharcnetguanw/ss2018/ss-2018-viz.pdf · Many file formats ... Example of VTK legacy formats File “quadrilateral.vtk” # vtk DataFile Version 3.0 Just an example](https://reader034.vdocuments.net/reader034/viewer/2022042115/5e92b595a16a1259e311f525/html5/thumbnails/14.jpg)
Data formats supported by ParaView VTK formats (legacy and XML)
Various non-VTK formats DICOM
EnSight
NetCDF
STL
……
See the full list (of 73 formats) https://www.paraview.org/Wiki/ParaView/Users_Guide/List_of_readers
![Page 15: Weiguang Guan guanw@sharcnetguanw/ss2018/ss-2018-viz.pdf · Many file formats ... Example of VTK legacy formats File “quadrilateral.vtk” # vtk DataFile Version 3.0 Just an example](https://reader034.vdocuments.net/reader034/viewer/2022042115/5e92b595a16a1259e311f525/html5/thumbnails/15.jpg)
ParaView is great!
What if my data are not recognized by Paraview?
![Page 16: Weiguang Guan guanw@sharcnetguanw/ss2018/ss-2018-viz.pdf · Many file formats ... Example of VTK legacy formats File “quadrilateral.vtk” # vtk DataFile Version 3.0 Just an example](https://reader034.vdocuments.net/reader034/viewer/2022042115/5e92b595a16a1259e311f525/html5/thumbnails/16.jpg)
What if ParaView does not support my data format? Import as CSV or Raw
Write a converter to transform your data into a format that is recognizable by ParaView
VTK legacy formats
VTK XML formats
NetCDF
Write a plugin for your data format
![Page 17: Weiguang Guan guanw@sharcnetguanw/ss2018/ss-2018-viz.pdf · Many file formats ... Example of VTK legacy formats File “quadrilateral.vtk” # vtk DataFile Version 3.0 Just an example](https://reader034.vdocuments.net/reader034/viewer/2022042115/5e92b595a16a1259e311f525/html5/thumbnails/17.jpg)
Loading CSV Pseudo CSV to CSV using Excel or OpenOffice
Load CSV file as table
Convert table to Either points
Or structured grid (the order of data: x index increasing fastest, then y index, z index is the slowest)
Examples CVS without header and attribute data
CVS with header but no attribute data
CVS with header and one scalar attribute data
CVS with header and two scalar attribute data
![Page 18: Weiguang Guan guanw@sharcnetguanw/ss2018/ss-2018-viz.pdf · Many file formats ... Example of VTK legacy formats File “quadrilateral.vtk” # vtk DataFile Version 3.0 Just an example](https://reader034.vdocuments.net/reader034/viewer/2022042115/5e92b595a16a1259e311f525/html5/thumbnails/18.jpg)
Import raw data Only for uniform rectilinear grids
The data is stored in the order of x increasing the fastest, then y, then z.
You need to know
Data type (integer, float, etc.)
Endian-ness
Spacing and origin
![Page 19: Weiguang Guan guanw@sharcnetguanw/ss2018/ss-2018-viz.pdf · Many file formats ... Example of VTK legacy formats File “quadrilateral.vtk” # vtk DataFile Version 3.0 Just an example](https://reader034.vdocuments.net/reader034/viewer/2022042115/5e92b595a16a1259e311f525/html5/thumbnails/19.jpg)
Conversion to formats supported by Paraview
![Page 20: Weiguang Guan guanw@sharcnetguanw/ss2018/ss-2018-viz.pdf · Many file formats ... Example of VTK legacy formats File “quadrilateral.vtk” # vtk DataFile Version 3.0 Just an example](https://reader034.vdocuments.net/reader034/viewer/2022042115/5e92b595a16a1259e311f525/html5/thumbnails/20.jpg)
Formats converted to VTK legacy formats
VTK XML formats
Many others such as netCDF
![Page 21: Weiguang Guan guanw@sharcnetguanw/ss2018/ss-2018-viz.pdf · Many file formats ... Example of VTK legacy formats File “quadrilateral.vtk” # vtk DataFile Version 3.0 Just an example](https://reader034.vdocuments.net/reader034/viewer/2022042115/5e92b595a16a1259e311f525/html5/thumbnails/21.jpg)
VTK legacy formats Documentation: https://www.vtk.org/wp-
content/uploads/2015/04/file-formats.pdf
![Page 22: Weiguang Guan guanw@sharcnetguanw/ss2018/ss-2018-viz.pdf · Many file formats ... Example of VTK legacy formats File “quadrilateral.vtk” # vtk DataFile Version 3.0 Just an example](https://reader034.vdocuments.net/reader034/viewer/2022042115/5e92b595a16a1259e311f525/html5/thumbnails/22.jpg)
VTK legacy formats Identifier and version: # vtk DataFile Version x.y
Description (<=256 characters)
ASCII or Binary (NOTE: Stored in big endian)
Geometry and topology: DATASET type type = STRUCTURED_POINTS
RECTILINEAR_GRID
STRUCTURED_GRID
UNSTRUCTURED_GRID
POLYDATA
FIELD
POINT_DATA n (optional)
CELL_DATA n (optional)
![Page 23: Weiguang Guan guanw@sharcnetguanw/ss2018/ss-2018-viz.pdf · Many file formats ... Example of VTK legacy formats File “quadrilateral.vtk” # vtk DataFile Version 3.0 Just an example](https://reader034.vdocuments.net/reader034/viewer/2022042115/5e92b595a16a1259e311f525/html5/thumbnails/23.jpg)
Example of VTK legacy formats File “quadrilateral.vtk” # vtk DataFile Version 3.0 Just an example by Weiguang Guan ASCII DATASET POLYDATA POINTS 4 float 0 0 0 1 0 0 1.1 1.1 0 0 1 0 POLYGONS 1 5 4 0 1 2 3 CELL_DATA 1 POINT_DATA 4 SCALARS pressure float LOOKUP_TABLE default 0 1 2 1.1
![Page 24: Weiguang Guan guanw@sharcnetguanw/ss2018/ss-2018-viz.pdf · Many file formats ... Example of VTK legacy formats File “quadrilateral.vtk” # vtk DataFile Version 3.0 Just an example](https://reader034.vdocuments.net/reader034/viewer/2022042115/5e92b595a16a1259e311f525/html5/thumbnails/24.jpg)
How to write in VTK legacy formats Build a VTK pipeline and add vtk writer at the end
Native way --- write data to a file without using any tool.
Use third-party tools
pyVTK (https://sysbio.ioc.ee/projects/pyvtk)
TVTK (http://code.enthought.com/pages/mayavi-project.html#TVTK)
![Page 25: Weiguang Guan guanw@sharcnetguanw/ss2018/ss-2018-viz.pdf · Many file formats ... Example of VTK legacy formats File “quadrilateral.vtk” # vtk DataFile Version 3.0 Just an example](https://reader034.vdocuments.net/reader034/viewer/2022042115/5e92b595a16a1259e311f525/html5/thumbnails/25.jpg)
Examples By editing manually
A cube as STRUCTURED_POINTS (volume)
A cube as RECTILINEAR_GRID (volume)
A hexahedron as STRUCTURED_GRID (volume)
A hexahedron as polygonal data (surface only)
A hexahedron as UNSTRUCTURED_GRID (volume)
C++ program
a volume data of STRUCTURED_POINTS in both ASCII and BINARY formats
![Page 26: Weiguang Guan guanw@sharcnetguanw/ss2018/ss-2018-viz.pdf · Many file formats ... Example of VTK legacy formats File “quadrilateral.vtk” # vtk DataFile Version 3.0 Just an example](https://reader034.vdocuments.net/reader034/viewer/2022042115/5e92b595a16a1259e311f525/html5/thumbnails/26.jpg)
VTK XML-based formats Serial formats
ImageData (.vti) — Serial vtkImageData
PolyData (.vtp) — Serial vtkPolyData
RectilinearGrid (.vtr) — Serial vtkRectilinearGrid
StructuredGrid (.vts) — Serial vtkStructuredGrid
UnstructuredGrid (.vtu) — Serial vtkUnstructuredGrid
Parallel formats PImageData (.pvti) — Parallel vtkImageData
PPolyData (.pvtp) — Parallel vtkPolyData
PRectilinearGrid (.pvtr) — Parallel vtkRectilinearGrid
PStructuredGrid (.pvts) — Parallel vtkStructuredGrid
PUnstructuredGrid (.pvtu) — Parallel vtkUnstructuredGrid
![Page 27: Weiguang Guan guanw@sharcnetguanw/ss2018/ss-2018-viz.pdf · Many file formats ... Example of VTK legacy formats File “quadrilateral.vtk” # vtk DataFile Version 3.0 Just an example](https://reader034.vdocuments.net/reader034/viewer/2022042115/5e92b595a16a1259e311f525/html5/thumbnails/27.jpg)
ImageData
![Page 28: Weiguang Guan guanw@sharcnetguanw/ss2018/ss-2018-viz.pdf · Many file formats ... Example of VTK legacy formats File “quadrilateral.vtk” # vtk DataFile Version 3.0 Just an example](https://reader034.vdocuments.net/reader034/viewer/2022042115/5e92b595a16a1259e311f525/html5/thumbnails/28.jpg)
RectilinearGrid
![Page 29: Weiguang Guan guanw@sharcnetguanw/ss2018/ss-2018-viz.pdf · Many file formats ... Example of VTK legacy formats File “quadrilateral.vtk” # vtk DataFile Version 3.0 Just an example](https://reader034.vdocuments.net/reader034/viewer/2022042115/5e92b595a16a1259e311f525/html5/thumbnails/29.jpg)
Write VTK XML-based formats Using PyEVTK (python Export VTK)
ImageData
Rectilinear grid
Structured grid
Scattered points as unstructured data
![Page 30: Weiguang Guan guanw@sharcnetguanw/ss2018/ss-2018-viz.pdf · Many file formats ... Example of VTK legacy formats File “quadrilateral.vtk” # vtk DataFile Version 3.0 Just an example](https://reader034.vdocuments.net/reader034/viewer/2022042115/5e92b595a16a1259e311f525/html5/thumbnails/30.jpg)
Parallel VTK XML-based formats
![Page 31: Weiguang Guan guanw@sharcnetguanw/ss2018/ss-2018-viz.pdf · Many file formats ... Example of VTK legacy formats File “quadrilateral.vtk” # vtk DataFile Version 3.0 Just an example](https://reader034.vdocuments.net/reader034/viewer/2022042115/5e92b595a16a1259e311f525/html5/thumbnails/31.jpg)
Time-series data A series of files named “prefix-xxxx.extension”
XDMF – eXtensible Data Model and Format
![Page 32: Weiguang Guan guanw@sharcnetguanw/ss2018/ss-2018-viz.pdf · Many file formats ... Example of VTK legacy formats File “quadrilateral.vtk” # vtk DataFile Version 3.0 Just an example](https://reader034.vdocuments.net/reader034/viewer/2022042115/5e92b595a16a1259e311f525/html5/thumbnails/32.jpg)
Web resources www.paraview.org
https://www.vtk.org/wp-content/uploads/2015/04/file-formats.pdf
www.xdmf.org
pypi.org/project/PyEVTK