+ All Categories
Home > Documents > Introduction to VTK - Purdue University · PDF fileIntroduction to VTK ... • Python...

Introduction to VTK - Purdue University · PDF fileIntroduction to VTK ... • Python...

Date post: 06-Feb-2018
Category:
Upload: duongtram
View: 236 times
Download: 8 times
Share this document with a friend
30
Introduction to VTK CS 53000 Introduction to Scientific Visualization August 25, 2011
Transcript
Page 1: Introduction to VTK - Purdue University · PDF fileIntroduction to VTK ... • Python • Java. CS530 - Introduction to Scientific VisualizationCS 53000 ... 0-1-2-3D geometry 0-1-2D

Introduction to VTK

CS 53000 Introduction to Scientific Visualization

August 25, 2011

Page 2: Introduction to VTK - Purdue University · PDF fileIntroduction to VTK ... • Python • Java. CS530 - Introduction to Scientific VisualizationCS 53000 ... 0-1-2-3D geometry 0-1-2D

CS530 - Introduction to Scientific VisualizationCS 53000 - Introduction to Scientific Visualization - 08/25/2011

The Visualization Toolkit• Open source software for

• Imaging

• Computer Graphics

• Visualization

• Written in C++

• Supports scripting languages (wrappers)• Tcl/Tk• Python• Java

Page 3: Introduction to VTK - Purdue University · PDF fileIntroduction to VTK ... • Python • Java. CS530 - Introduction to Scientific VisualizationCS 53000 ... 0-1-2-3D geometry 0-1-2D

CS530 - Introduction to Scientific VisualizationCS 53000 - Introduction to Scientific Visualization - 08/25/2011

Outline• Object-oriented design

• Visualization pipeline

• Data structure

• Rendering

• Examples

Page 4: Introduction to VTK - Purdue University · PDF fileIntroduction to VTK ... • Python • Java. CS530 - Introduction to Scientific VisualizationCS 53000 ... 0-1-2-3D geometry 0-1-2D

CS530 - Introduction to Scientific VisualizationCS 53000 - Introduction to Scientific Visualization - 08/25/2011

Outline• Object-oriented design

• Visualization pipeline

• Data structure

• Rendering

• Examples

Page 5: Introduction to VTK - Purdue University · PDF fileIntroduction to VTK ... • Python • Java. CS530 - Introduction to Scientific VisualizationCS 53000 ... 0-1-2-3D geometry 0-1-2D

CS530 - Introduction to Scientific VisualizationCS 53000 - Introduction to Scientific Visualization - 08/25/2011

dimension=3# faces=5# edges=9

# vertices=6

dimension=3# faces=6

# edges=12# vertices=8

dimension=3# faces=4# edges=6

# vertices=4

dimension=2# faces# edges

# vertices

dimension=2# faces=1# edges=4

# vertices=4

dimension=2# faces=1# edges=3

# vertices=3

dimension=3# faces# edges

# vertices

dimension=2# faces# edges

# vertices

dimension# faces# edges

# vertices

Cell

Object-Oriented Design

Cell3DCell2D

Triangle Quad Polygon Tet Hexa Prism

abstract

abstract abstract

Page 6: Introduction to VTK - Purdue University · PDF fileIntroduction to VTK ... • Python • Java. CS530 - Introduction to Scientific VisualizationCS 53000 ... 0-1-2-3D geometry 0-1-2D

CS530 - Introduction to Scientific VisualizationCS 53000 - Introduction to Scientific Visualization - 08/25/2011

Outline• Object-oriented design

• Visualization pipeline

• Data structure

• Rendering

• Examples

Page 7: Introduction to VTK - Purdue University · PDF fileIntroduction to VTK ... • Python • Java. CS530 - Introduction to Scientific VisualizationCS 53000 ... 0-1-2-3D geometry 0-1-2D

CS530 - Introduction to Scientific VisualizationCS 53000 - Introduction to Scientific Visualization - 08/25/2011

Visualization Pipeline• Process objects

Source(s) Filter(s) Mapper

Page 8: Introduction to VTK - Purdue University · PDF fileIntroduction to VTK ... • Python • Java. CS530 - Introduction to Scientific VisualizationCS 53000 ... 0-1-2-3D geometry 0-1-2D

CS530 - Introduction to Scientific VisualizationCS 53000 - Introduction to Scientific Visualization - 08/25/2011

• Process objects

• Source: input data• Read data from file (reader)

• Generate data from parameters (procedural)

• Set up data structure

Visualization Pipeline

Source(s) Filter(s) Mapper Actor

Page 9: Introduction to VTK - Purdue University · PDF fileIntroduction to VTK ... • Python • Java. CS530 - Introduction to Scientific VisualizationCS 53000 ... 0-1-2-3D geometry 0-1-2D

CS530 - Introduction to Scientific VisualizationCS 53000 - Introduction to Scientific Visualization - 08/25/2011

Visualization Pipeline• Process objects

• Filter : visualization processing• Compute data

• Transform data

• Create representation

Source(s) Filter(s) Mapper Actor

Page 10: Introduction to VTK - Purdue University · PDF fileIntroduction to VTK ... • Python • Java. CS530 - Introduction to Scientific VisualizationCS 53000 ... 0-1-2-3D geometry 0-1-2D

CS530 - Introduction to Scientific VisualizationCS 53000 - Introduction to Scientific Visualization - 08/25/2011

Visualization Pipeline• Process objects

• Mapper: output data• Generate graphical primitives

• Write data to file

• Interface with another software or device

Source(s) Filter(s) Mapper Actor

Page 11: Introduction to VTK - Purdue University · PDF fileIntroduction to VTK ... • Python • Java. CS530 - Introduction to Scientific VisualizationCS 53000 ... 0-1-2-3D geometry 0-1-2D

CS530 - Introduction to Scientific VisualizationCS 53000 - Introduction to Scientific Visualization - 08/25/2011

Visualization Pipeline• Connections (type checking)

Source

Source

Filter

Source(s) Filter(s) Mapper Actor

Page 12: Introduction to VTK - Purdue University · PDF fileIntroduction to VTK ... • Python • Java. CS530 - Introduction to Scientific VisualizationCS 53000 ... 0-1-2-3D geometry 0-1-2D

CS530 - Introduction to Scientific VisualizationCS 53000 - Introduction to Scientific Visualization - 08/25/2011

Visualization Pipeline• Connections (type checking)

FilterFilter Filter

Source(s) Filter(s) Mapper Actor

Page 13: Introduction to VTK - Purdue University · PDF fileIntroduction to VTK ... • Python • Java. CS530 - Introduction to Scientific VisualizationCS 53000 ... 0-1-2-3D geometry 0-1-2D

CS530 - Introduction to Scientific VisualizationCS 53000 - Introduction to Scientific Visualization - 08/25/2011

Visualization Pipeline• Connections (type checking)

Filter

Filter

Filter

Source(s) Filter(s) Mapper Actor

Page 14: Introduction to VTK - Purdue University · PDF fileIntroduction to VTK ... • Python • Java. CS530 - Introduction to Scientific VisualizationCS 53000 ... 0-1-2-3D geometry 0-1-2D

CS530 - Introduction to Scientific VisualizationCS 53000 - Introduction to Scientific Visualization - 08/25/2011

Visualization Pipeline• Connections (type checking)

Filter

Filter

Filter

Source(s) Filter(s) Mapper Actor

Page 15: Introduction to VTK - Purdue University · PDF fileIntroduction to VTK ... • Python • Java. CS530 - Introduction to Scientific VisualizationCS 53000 ... 0-1-2-3D geometry 0-1-2D

CS530 - Introduction to Scientific VisualizationCS 53000 - Introduction to Scientific Visualization - 08/25/2011

Visualization Pipeline• Connections (type checking)

Filter Filter

Feedback

Source(s) Filter(s) Mapper Actor

Page 16: Introduction to VTK - Purdue University · PDF fileIntroduction to VTK ... • Python • Java. CS530 - Introduction to Scientific VisualizationCS 53000 ... 0-1-2-3D geometry 0-1-2D

CS530 - Introduction to Scientific VisualizationCS 53000 - Introduction to Scientific Visualization - 08/25/2011

Visualization Pipeline• Implicit control of execution (lazy evaluation)

A B

D E

C

F

G

D modified

Section re-executes

Page 17: Introduction to VTK - Purdue University · PDF fileIntroduction to VTK ... • Python • Java. CS530 - Introduction to Scientific VisualizationCS 53000 ... 0-1-2-3D geometry 0-1-2D

CS530 - Introduction to Scientific VisualizationCS 53000 - Introduction to Scientific Visualization - 08/25/2011

Outline• Object-oriented design

• Visualization pipeline

• Data structure

• Rendering

• Examples

Page 18: Introduction to VTK - Purdue University · PDF fileIntroduction to VTK ... • Python • Java. CS530 - Introduction to Scientific VisualizationCS 53000 ... 0-1-2-3D geometry 0-1-2D

CS530 - Introduction to Scientific VisualizationCS 53000 - Introduction to Scientific Visualization - 08/25/2011

Cell Types

vertex Polyvertex Line Polyline

Triangle Triangle strip Quadrilateral Pixel

Tetrahedron Hexahedron Voxel Wedge Pyramid

Page 19: Introduction to VTK - Purdue University · PDF fileIntroduction to VTK ... • Python • Java. CS530 - Introduction to Scientific VisualizationCS 53000 ... 0-1-2-3D geometry 0-1-2D

CS530 - Introduction to Scientific VisualizationCS 53000 - Introduction to Scientific Visualization - 08/25/2011

Cell Types

vertex Polyvertex Line Polyline

Triangle Triangle strip Quadrilateral Pixel

Tetrahedron Hexahedron Voxel Wedge Pyramid

0D

Page 20: Introduction to VTK - Purdue University · PDF fileIntroduction to VTK ... • Python • Java. CS530 - Introduction to Scientific VisualizationCS 53000 ... 0-1-2-3D geometry 0-1-2D

CS530 - Introduction to Scientific VisualizationCS 53000 - Introduction to Scientific Visualization - 08/25/2011

Cell Types

vertex Polyvertex Line Polyline

Triangle Triangle strip Quadrilateral Pixel

Tetrahedron Hexahedron Voxel Wedge Pyramid

1D

Page 21: Introduction to VTK - Purdue University · PDF fileIntroduction to VTK ... • Python • Java. CS530 - Introduction to Scientific VisualizationCS 53000 ... 0-1-2-3D geometry 0-1-2D

CS530 - Introduction to Scientific VisualizationCS 53000 - Introduction to Scientific Visualization - 08/25/2011

Cell Types

vertex Polyvertex Line Polyline

Triangle Triangle strip Quadrilateral Pixel

Tetrahedron Hexahedron Voxel Wedge Pyramid

2D

Page 22: Introduction to VTK - Purdue University · PDF fileIntroduction to VTK ... • Python • Java. CS530 - Introduction to Scientific VisualizationCS 53000 ... 0-1-2-3D geometry 0-1-2D

CS530 - Introduction to Scientific VisualizationCS 53000 - Introduction to Scientific Visualization - 08/25/2011

Cell Types

vertex Polyvertex Line Polyline

Triangle Triangle strip Quadrilateral Pixel

Tetrahedron Hexahedron Voxel Wedge Pyramid

3D

Page 23: Introduction to VTK - Purdue University · PDF fileIntroduction to VTK ... • Python • Java. CS530 - Introduction to Scientific VisualizationCS 53000 ... 0-1-2-3D geometry 0-1-2D

CS530 - Introduction to Scientific VisualizationCS 53000 - Introduction to Scientific Visualization - 08/25/2011

Data Attributes

a a aa a aa a a

11 12 13

232221

333231

Scalar 3D vector (u,v,w) normal (u,v,w) ||n||=1

Texture coordinate (u,v) or (u,v,w) 2nd order tensor (3x3 matrix)

Cell-wise / point-wise (vtkDataSetAttribute)

Page 24: Introduction to VTK - Purdue University · PDF fileIntroduction to VTK ... • Python • Java. CS530 - Introduction to Scientific VisualizationCS 53000 ... 0-1-2-3D geometry 0-1-2D

CS530 - Introduction to Scientific VisualizationCS 53000 - Introduction to Scientific Visualization - 08/25/2011

Dataset Types

Image Rectilinear grid

Structured (curvilinear) grid Unstructured grid

Page 25: Introduction to VTK - Purdue University · PDF fileIntroduction to VTK ... • Python • Java. CS530 - Introduction to Scientific VisualizationCS 53000 ... 0-1-2-3D geometry 0-1-2D

CS530 - Introduction to Scientific VisualizationCS 53000 - Introduction to Scientific Visualization - 08/25/2011

Dataset TypesvtkObject

vtkDataSet

vtkPointSetvtkImageDatavtkRectilinearGrid

vtkUnstructuredGrid vtkPolyDatavtkStructuredGridvtkStructuredData

0-1-2D geometry0-1-2-3D geometry

Page 26: Introduction to VTK - Purdue University · PDF fileIntroduction to VTK ... • Python • Java. CS530 - Introduction to Scientific VisualizationCS 53000 ... 0-1-2-3D geometry 0-1-2D

CS530 - Introduction to Scientific VisualizationCS 53000 - Introduction to Scientific Visualization - 08/25/2011

Outline• Object-oriented design

• Visualization pipeline

• Data structure

• Rendering

• Examples

Page 27: Introduction to VTK - Purdue University · PDF fileIntroduction to VTK ... • Python • Java. CS530 - Introduction to Scientific VisualizationCS 53000 ... 0-1-2-3D geometry 0-1-2D

CS530 - Introduction to Scientific VisualizationCS 53000 - Introduction to Scientific Visualization - 08/25/2011

Rendering in VTK

RenderWindow

Renderer

Camera Lights Actor

RenderWindowInteractor

Property Mapper

Page 28: Introduction to VTK - Purdue University · PDF fileIntroduction to VTK ... • Python • Java. CS530 - Introduction to Scientific VisualizationCS 53000 ... 0-1-2-3D geometry 0-1-2D

CS530 - Introduction to Scientific VisualizationCS 53000 - Introduction to Scientific Visualization - 08/25/2011

Outline• Object-oriented design

• Visualization pipeline

• Data structure

• Rendering

• Examples

Page 29: Introduction to VTK - Purdue University · PDF fileIntroduction to VTK ... • Python • Java. CS530 - Introduction to Scientific VisualizationCS 53000 ... 0-1-2-3D geometry 0-1-2D

CS530 - Introduction to Scientific VisualizationCS 53000 - Introduction to Scientific Visualization - 08/25/2011

Demos

Page 30: Introduction to VTK - Purdue University · PDF fileIntroduction to VTK ... • Python • Java. CS530 - Introduction to Scientific VisualizationCS 53000 ... 0-1-2-3D geometry 0-1-2D

CS530 - Introduction to Scientific VisualizationCS 53000 - Introduction to Scientific Visualization - 08/25/2011

Additional References• VTK User’s Guide

• VTK tutorial

http://www.cs.uic.edu/~jbell/CS526/Tutorial/Tutorial.html

• The Visualization Toolkit

An object-oriented Approach to 3D Graphics,

3rd edition, W. Schroeder, K. Martin, B. Lorensen, Kitware


Recommended