SlideShare uma empresa Scribd logo
1 de 34
Baixar para ler offline
1
INTRODUCTION TO VTK
Gustav Taxén, Ph. D.
Associate Professor
School of Computing Science and Communication
Royal Institute of Technology, Stockholm
gustavt@csc.kth.se
2
OVERVIEW
Programming library
Development of scivis apps
Very powerful
1133 C++ classes (v 5.0)
C++, Tcl/Tk, Python, and Java bindings
3
OVERVIEW
Over-designed
Very complex
Limited on-line tutorial material
Undergone semantic/syntactic changes
Very steep learning curve!
4
WHAT IS VISUALIZED?
Scalar
values
Inter-
polation
5
DEFINITIONS
Point ! Location in 3D space
Attribute data " Information stored at points
Book is vague
Called point data in the code
6
DEFINITIONS
Dataset = Structure + Attribute data
Geometry
(the points)
Topology
(how points
are connected)
7
DEFINITIONS
A topology is built up from cells
There are different kinds of cells
There are different kinds of datasets in VTK
that organize cells in different ways
Some datasets use only one
or a couple of cell types
Other are more general
8
CELL EXAMPLES
This is a polyline cell
It consists of 2 or more
connected lines
9
CELL EXAMPLES
This is a tetrahedron cell
It consists of 3 triangles
10
CELL EXAMPLES
This is a pixel cell
It consists of one quad,
aligned with one of the
world coord system planes
11
CELLS
There are 16 kinds of linear cells in VTK
They interpolate attribute data
linearly between points
There are non-linear cells too
They interpolate using
polynomal basis functions
12
DATA SETS
Dataset = Structure + Attribute data
Some datasets impose a cell structure
Others are more general
13
DATASETS
This is an Image dataset
This example uses pixel cells
There are 5x6 = 30 points
and 4x5 = 20 cells
The image dataset can use
line, pixel, or voxel cells
14
DATASETS
The PolyData dataset consists of:
a set of vertex cells
a set of line cells
a set of polygon cells
a set of triangle strip cells
It is used for unstructured data
15
CELL ARRAYS
For datasets where
lists of cells are involved (e.g., PolyData) you
specify the cells using CellArray:s
16
EXAMPLE
Let’s see how
the data in this
image is organized!
The data describes
a particle trajectory
It is a line strip
containing 9999
(colored) vertices
17
Points
Positions
vtkPoints
Positions
vtkPolyData
Lines
Points
Point data
Polygons
Vertices
Triangle strips
We use a PolyData dataset.
The geometry of the dataset are the locations of the vertices. They are specified as
VTK points. A point always has 3 dimensions (x, y, z).
18
vtkCellArray
Indices
Points
Positions
vtkPoints
Positions
vtkPolyData
Lines
Points
Point data
Polygons
Vertices
Triangle strips
Since this DataSet doesn’t impose a cell structure, we need to specifiy the topology explicitly, i.e.,
the cells of the dataset, i.e., what the relationship between the points is.
THIS IMAGE IS VERY IMPORTANT – EVERYONE SHOULD UNDERSTAND IT
BEFORE MOVING ON!
A PolyData dataset can connect points in different ways. It can contain vertices, lines, polygons,
and/or triangle strips.
Since PolyData is an unstructured dataset, we need to specify cells explicitly. It must be done via
CellArrays.
There is one CellArray for the vertices, one for the lines, one for the polygons, and one for the
tristrips.
A CellArray is an integer-valued array containing point list indices. Together, these indices specify
one or more cells. How the indices are combined into cells are determined by whether we assign the
CellArray as the vertices, the lines, the polygons, or the trianglestrips of the dataset.
The format of the CellArray is as follows: The first value is the number of indices for the first cell.
Then follows the indices themselves. The next value is the number of indices for the second cell.
Then follows the indices for the second cell, and so on.
In our case, we choose to use ONE cell. This cell will contain 9999 indices - one for each point. If a
line contains more than two indices it is automatically interpreted as a line strip.
Since the data points are in order, the indices first index is 0, the second is 1, and so on up to 9998.
19
vtkCellArray
Indices
Points
Positions
vtkPoints
Positions
vtkFloatArray
Scalars
vtkPolyData
Lines
Points
Point data
Polygons
Vertices
Triangle strips
vtkPointData
Scalars
Vectors
Normals
Tex coords
Tensors
The next step is to assign the scalar values to the points.
The dataset contains ”attribute data”, which is VTK speak for ”values defined at
point locations”. These values are the ones that are interpolated by VTK when we
generate the image.
In the API, the ”attribute data” is denoted as ”point data”. At each point, we can
store a scalar, a 3D vector, a normal, a 2D tex coord, or a tensor. I’m not sure
whether it’s OK to store more than one of these at each point.
Here, we want to store scalars, which means that we need one floating-point value
for each geometry point. This has been provided to us in the same data file that
contains the particle trajectory data.
”Attribute data” (or ”Point data”) is stored in FloatArrays. If the data is
multidimensional, it is interleaved in the array. For example, a 3D vector at each
point would be stored as X0 Y0 Z0 X1 Y1 Z1, and so on.
The point data is ”owned” by the polydata object. It has ”slots” for scalars, vectors,
normals, etc. We can either use a pointer to a FloatArray in these slots, or we can
choose to copy the data into the PointData object.
20
EXAMPLE
A 3D vector
field is
visualized using
a ”hedgehog”
The field is
defined at regularly
spaced locations
in a volume
21
vtkImageData
Point data
vtkFloatArray
XYZ
Dimensions: 4x4x4
vtkPointData
Scalars
Vectors
Normals
Tex coords
Tensors
tuple
Since the data is regularly spaced, we can use a ImageData dataset. In VTK,
ImageData can be both 2D and 3D, as long as it is regular and is aligned with the
global coord axes.
We specify that the number of samples in the dataset along each axis is 4x4x4. We
then set a world-space spacing between each sample. This completely defines both
the geometry and the topology.
What remains to be done is to assign the ”attribute data” (or ”point data”) at each
point.
Again, the 3D vectors to be assigned to the points are stored in a FloatArray. Here,
we need 3 floating-point values per geometry point. These 3 values are referred to
as a tuple.
All datasets in VTK use the vtkPointData class to assign attribute data to points. In
this case, we want to store a vector at each point, so we use the ”vector” slot of the
PointData class.
22
HOW IMAGES ARE CREATED
vtkRenderWindow
vtkRenderer
vtkCamera
vtkLight
vtkActor
23
PROPS AND ACTORS
Prop ! Something that can be drawn
Actor ! A prop that can be transformed
There are 2D and 3D actors
Each actor has one property:
Property ! Collection of settings for
surface material, opacity, etc.
24
FILTERS AND MAPPERS
Filter ! Object that converts a dataset
into a different dataset or
performs operations on a dataset
Mapper ! Object responsible for
converting datasets
into a form suitable for actors
25
THE VTK PIPELINE
Data set
SOURCE MAPPER
Data set
FILTER
Geometry
ACTOR
Geometry
RENDERER
Geometry
WINDOW
26
vtkPolyData
vtkPolyDataMapper
vtkActor
vtkRenderer
vtkRenderWindow
27
vtkPolyData
vtkPolyDataMapper
vtkActor
vtkRenderer
vtkRenderWindow
Input
Mapper
Actors
Renderers
28
FILTERS
Dataset / Source
Filter 1 Filter 2
Filter 3
Mapper 1Mapper 2
29
PORTS
Filter Output
ports
FilterInput
connections
30
PORTS
All pipeline objects have ports
Whether an input port is repeatable,
i.e., if you may connect
more than one output to it
depends on the object
Errors are detected at run-time
31
PORTS
There are two ways to connect objects
The old syntax still works but is discouraged
It doesn’t ”know” about multiple inputs
The assignment intermingles both !
32
MEMORY MANAGEMENT
VTK uses reference counting
Don’t use new to create objects!
vtkActor* actor = vtkActor::New();
...
actor->Delete();
33
MEMORY MANAGEMENT
The object may or may not be
deleted when you call Delete()
If you have assigned the object to
another object (e.g., via a port) it is not
When VTK methods are used to assign,
a reference counter is increased
When Delete() is called the counter
is decreased
34
MEMORY MANAGEMENT
When reference counter reaches 0
the object is deleted
BE CAREFUL!
Not true garbage collection
This code will break:
vtkActor* actor = vtkActor::New();
vtkActor* pointer = actor;
actor->Delete();
pointer->Render();

Mais conteúdo relacionado

Mais procurados

Adobe Illustrator: 6 Essential Tips and Tools
Adobe Illustrator: 6 Essential Tips and ToolsAdobe Illustrator: 6 Essential Tips and Tools
Adobe Illustrator: 6 Essential Tips and ToolsNguyet Minh
 
UI드자이너의 짧은 언리얼 UMG 사용기
UI드자이너의 짧은 언리얼 UMG 사용기UI드자이너의 짧은 언리얼 UMG 사용기
UI드자이너의 짧은 언리얼 UMG 사용기Hong-Gi Joe
 
Making High Quality Interactive VR with Unreal Engine Luis Cataldi
Making High Quality Interactive VR with Unreal Engine Luis CataldiMaking High Quality Interactive VR with Unreal Engine Luis Cataldi
Making High Quality Interactive VR with Unreal Engine Luis CataldiUnreal Engine
 
Unity - Building Your First Real-Time 3D Project - All Slides
Unity - Building Your First Real-Time 3D Project - All SlidesUnity - Building Your First Real-Time 3D Project - All Slides
Unity - Building Your First Real-Time 3D Project - All SlidesNexusEdgesupport
 
Unite Seoul 2016 - 스매싱 더 배틀의 멀티플랫폼 개발
Unite Seoul 2016 - 스매싱 더 배틀의 멀티플랫폼 개발 Unite Seoul 2016 - 스매싱 더 배틀의 멀티플랫폼 개발
Unite Seoul 2016 - 스매싱 더 배틀의 멀티플랫폼 개발 Daehoon Han
 
User Interface Design
User Interface DesignUser Interface Design
User Interface DesignJason Hando
 
Nearline storage for sap bw (nls)
Nearline storage for sap bw (nls)Nearline storage for sap bw (nls)
Nearline storage for sap bw (nls)Anil Kumar
 
191221 unreal engine 4 editor 확장하기
191221 unreal engine 4 editor 확장하기191221 unreal engine 4 editor 확장하기
191221 unreal engine 4 editor 확장하기KWANGIL KIM
 

Mais procurados (20)

Adobe Illustrator: 6 Essential Tips and Tools
Adobe Illustrator: 6 Essential Tips and ToolsAdobe Illustrator: 6 Essential Tips and Tools
Adobe Illustrator: 6 Essential Tips and Tools
 
UI드자이너의 짧은 언리얼 UMG 사용기
UI드자이너의 짧은 언리얼 UMG 사용기UI드자이너의 짧은 언리얼 UMG 사용기
UI드자이너의 짧은 언리얼 UMG 사용기
 
Withholding tax configuration
Withholding tax configurationWithholding tax configuration
Withholding tax configuration
 
Making High Quality Interactive VR with Unreal Engine Luis Cataldi
Making High Quality Interactive VR with Unreal Engine Luis CataldiMaking High Quality Interactive VR with Unreal Engine Luis Cataldi
Making High Quality Interactive VR with Unreal Engine Luis Cataldi
 
UE4.17で入る新機能を一気に紹介・解説!
UE4.17で入る新機能を一気に紹介・解説!UE4.17で入る新機能を一気に紹介・解説!
UE4.17で入る新機能を一気に紹介・解説!
 
Lightmassの仕組み ~Precomputed Light Volume編~ (Epic Games Japan: 篠山範明)
 Lightmassの仕組み ~Precomputed Light Volume編~ (Epic Games Japan: 篠山範明) Lightmassの仕組み ~Precomputed Light Volume編~ (Epic Games Japan: 篠山範明)
Lightmassの仕組み ~Precomputed Light Volume編~ (Epic Games Japan: 篠山範明)
 
Unity - Building Your First Real-Time 3D Project - All Slides
Unity - Building Your First Real-Time 3D Project - All SlidesUnity - Building Your First Real-Time 3D Project - All Slides
Unity - Building Your First Real-Time 3D Project - All Slides
 
UE4アセットリダクション手法紹介
UE4アセットリダクション手法紹介UE4アセットリダクション手法紹介
UE4アセットリダクション手法紹介
 
Unite Seoul 2016 - 스매싱 더 배틀의 멀티플랫폼 개발
Unite Seoul 2016 - 스매싱 더 배틀의 멀티플랫폼 개발 Unite Seoul 2016 - 스매싱 더 배틀의 멀티플랫폼 개발
Unite Seoul 2016 - 스매싱 더 배틀의 멀티플랫폼 개발
 
Fortniteを支える技術
Fortniteを支える技術Fortniteを支える技術
Fortniteを支える技術
 
Learning Water Graphics in UE4
Learning Water Graphics in UE4Learning Water Graphics in UE4
Learning Water Graphics in UE4
 
Spau spdd
Spau spddSpau spdd
Spau spdd
 
User Interface Design
User Interface DesignUser Interface Design
User Interface Design
 
UE4のモバイル向け機能や最新情報などを改めて紹介!2019
UE4のモバイル向け機能や最新情報などを改めて紹介!2019UE4のモバイル向け機能や最新情報などを改めて紹介!2019
UE4のモバイル向け機能や最新情報などを改めて紹介!2019
 
UE4のモバイル開発におけるコンテンツアップデートの話 - Chunk IDとの激闘編 -
UE4のモバイル開発におけるコンテンツアップデートの話 - Chunk IDとの激闘編 -UE4のモバイル開発におけるコンテンツアップデートの話 - Chunk IDとの激闘編 -
UE4のモバイル開発におけるコンテンツアップデートの話 - Chunk IDとの激闘編 -
 
実行速度の最適化のあれこれ プラス おまけ
実行速度の最適化のあれこれ プラス おまけ  実行速度の最適化のあれこれ プラス おまけ
実行速度の最適化のあれこれ プラス おまけ
 
Simple flash animation
Simple flash animationSimple flash animation
Simple flash animation
 
Nearline storage for sap bw (nls)
Nearline storage for sap bw (nls)Nearline storage for sap bw (nls)
Nearline storage for sap bw (nls)
 
191221 unreal engine 4 editor 확장하기
191221 unreal engine 4 editor 확장하기191221 unreal engine 4 editor 확장하기
191221 unreal engine 4 editor 확장하기
 
Ers sap
Ers sapErs sap
Ers sap
 

Destaque

Vtk Image procesing
Vtk Image procesingVtk Image procesing
Vtk Image procesingSonu Mangal
 
ITK Tutorial Presentation Slides-953
ITK Tutorial Presentation Slides-953ITK Tutorial Presentation Slides-953
ITK Tutorial Presentation Slides-953Kitware Kitware
 
ITK Tutorial Presentation Slides-944
ITK Tutorial Presentation Slides-944ITK Tutorial Presentation Slides-944
ITK Tutorial Presentation Slides-944Kitware Kitware
 
PyData NYC 2015 Presentation
PyData NYC 2015 PresentationPyData NYC 2015 Presentation
PyData NYC 2015 Presentationviz4biz
 
ITK Tutorial Presentation Slides-950
ITK Tutorial Presentation Slides-950ITK Tutorial Presentation Slides-950
ITK Tutorial Presentation Slides-950Kitware Kitware
 
Machine Learning for Medical Image Analysis: What, where and how?
Machine Learning for Medical Image Analysis:What, where and how?Machine Learning for Medical Image Analysis:What, where and how?
Machine Learning for Medical Image Analysis: What, where and how?Debdoot Sheet
 
Paraviewの等高面を綺麗に出力する
Paraviewの等高面を綺麗に出力するParaviewの等高面を綺麗に出力する
Paraviewの等高面を綺麗に出力するtakuyayamamoto1800
 

Destaque (9)

Vtk Image procesing
Vtk Image procesingVtk Image procesing
Vtk Image procesing
 
ITK Tutorial Presentation Slides-953
ITK Tutorial Presentation Slides-953ITK Tutorial Presentation Slides-953
ITK Tutorial Presentation Slides-953
 
ITK Tutorial Presentation Slides-944
ITK Tutorial Presentation Slides-944ITK Tutorial Presentation Slides-944
ITK Tutorial Presentation Slides-944
 
PyData NYC 2015 Presentation
PyData NYC 2015 PresentationPyData NYC 2015 Presentation
PyData NYC 2015 Presentation
 
ITK Tutorial Presentation Slides-950
ITK Tutorial Presentation Slides-950ITK Tutorial Presentation Slides-950
ITK Tutorial Presentation Slides-950
 
Vistrails and VTK Comparison
Vistrails and VTK ComparisonVistrails and VTK Comparison
Vistrails and VTK Comparison
 
Machine Learning for Medical Image Analysis: What, where and how?
Machine Learning for Medical Image Analysis:What, where and how?Machine Learning for Medical Image Analysis:What, where and how?
Machine Learning for Medical Image Analysis: What, where and how?
 
Paraviewの等高面を綺麗に出力する
Paraviewの等高面を綺麗に出力するParaviewの等高面を綺麗に出力する
Paraviewの等高面を綺麗に出力する
 
Medical Image Processing
Medical Image ProcessingMedical Image Processing
Medical Image Processing
 

Semelhante a Introduction to VTK

Tensor representations in signal processing and machine learning (tutorial ta...
Tensor representations in signal processing and machine learning (tutorial ta...Tensor representations in signal processing and machine learning (tutorial ta...
Tensor representations in signal processing and machine learning (tutorial ta...Tatsuya Yokota
 
Vector and Matrix operationsVector and Matrix operations
Vector and Matrix operationsVector and Matrix operationsVector and Matrix operationsVector and Matrix operations
Vector and Matrix operationsVector and Matrix operationsssuser2624f71
 
Student_Garden_geostatistics_course
Student_Garden_geostatistics_courseStudent_Garden_geostatistics_course
Student_Garden_geostatistics_coursePedro Correia
 
Student_Garden_geostatistics_course
Student_Garden_geostatistics_courseStudent_Garden_geostatistics_course
Student_Garden_geostatistics_coursePedro Correia
 
DSP IEEE paper
DSP IEEE paperDSP IEEE paper
DSP IEEE paperprreiya
 
Principal Component Analysis
Principal Component AnalysisPrincipal Component Analysis
Principal Component AnalysisMason Ziemer
 
HW2-1_05.doc
HW2-1_05.docHW2-1_05.doc
HW2-1_05.docbutest
 
Basic MATLAB-Presentation.pptx
Basic MATLAB-Presentation.pptxBasic MATLAB-Presentation.pptx
Basic MATLAB-Presentation.pptxPremanandS3
 
«Дизайн продвинутых нереляционных схем для Big Data»
«Дизайн продвинутых нереляционных схем для Big Data»«Дизайн продвинутых нереляционных схем для Big Data»
«Дизайн продвинутых нереляционных схем для Big Data»Olga Lavrentieva
 
Cs229 notes10
Cs229 notes10Cs229 notes10
Cs229 notes10VuTran231
 
Machine Learning - Dataset Preparation
Machine Learning - Dataset PreparationMachine Learning - Dataset Preparation
Machine Learning - Dataset PreparationAndrew Ferlitsch
 

Semelhante a Introduction to VTK (20)

Tensor representations in signal processing and machine learning (tutorial ta...
Tensor representations in signal processing and machine learning (tutorial ta...Tensor representations in signal processing and machine learning (tutorial ta...
Tensor representations in signal processing and machine learning (tutorial ta...
 
data_mining
data_miningdata_mining
data_mining
 
Statistics lab 1
Statistics lab 1Statistics lab 1
Statistics lab 1
 
Vector and Matrix operationsVector and Matrix operations
Vector and Matrix operationsVector and Matrix operationsVector and Matrix operationsVector and Matrix operations
Vector and Matrix operationsVector and Matrix operations
 
Session2
Session2Session2
Session2
 
Introduction to R
Introduction to RIntroduction to R
Introduction to R
 
Student_Garden_geostatistics_course
Student_Garden_geostatistics_courseStudent_Garden_geostatistics_course
Student_Garden_geostatistics_course
 
Student_Garden_geostatistics_course
Student_Garden_geostatistics_courseStudent_Garden_geostatistics_course
Student_Garden_geostatistics_course
 
DSP IEEE paper
DSP IEEE paperDSP IEEE paper
DSP IEEE paper
 
Principal Component Analysis
Principal Component AnalysisPrincipal Component Analysis
Principal Component Analysis
 
STL in C++
STL in C++STL in C++
STL in C++
 
HW2-1_05.doc
HW2-1_05.docHW2-1_05.doc
HW2-1_05.doc
 
Four data models in GIS
Four data models in GISFour data models in GIS
Four data models in GIS
 
Op ps
Op psOp ps
Op ps
 
Co&al lecture-08
Co&al lecture-08Co&al lecture-08
Co&al lecture-08
 
Basic MATLAB-Presentation.pptx
Basic MATLAB-Presentation.pptxBasic MATLAB-Presentation.pptx
Basic MATLAB-Presentation.pptx
 
«Дизайн продвинутых нереляционных схем для Big Data»
«Дизайн продвинутых нереляционных схем для Big Data»«Дизайн продвинутых нереляционных схем для Big Data»
«Дизайн продвинутых нереляционных схем для Big Data»
 
04_AJMS_453_22_compressed.pdf
04_AJMS_453_22_compressed.pdf04_AJMS_453_22_compressed.pdf
04_AJMS_453_22_compressed.pdf
 
Cs229 notes10
Cs229 notes10Cs229 notes10
Cs229 notes10
 
Machine Learning - Dataset Preparation
Machine Learning - Dataset PreparationMachine Learning - Dataset Preparation
Machine Learning - Dataset Preparation
 

Último

VTU technical seminar 8Th Sem on Scikit-learn
VTU technical seminar 8Th Sem on Scikit-learnVTU technical seminar 8Th Sem on Scikit-learn
VTU technical seminar 8Th Sem on Scikit-learnAmarnathKambale
 
Software Quality Assurance Interview Questions
Software Quality Assurance Interview QuestionsSoftware Quality Assurance Interview Questions
Software Quality Assurance Interview QuestionsArshad QA
 
How To Troubleshoot Collaboration Apps for the Modern Connected Worker
How To Troubleshoot Collaboration Apps for the Modern Connected WorkerHow To Troubleshoot Collaboration Apps for the Modern Connected Worker
How To Troubleshoot Collaboration Apps for the Modern Connected WorkerThousandEyes
 
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...Health
 
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdfLearn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdfkalichargn70th171
 
The Ultimate Test Automation Guide_ Best Practices and Tips.pdf
The Ultimate Test Automation Guide_ Best Practices and Tips.pdfThe Ultimate Test Automation Guide_ Best Practices and Tips.pdf
The Ultimate Test Automation Guide_ Best Practices and Tips.pdfkalichargn70th171
 
AI Mastery 201: Elevating Your Workflow with Advanced LLM Techniques
AI Mastery 201: Elevating Your Workflow with Advanced LLM TechniquesAI Mastery 201: Elevating Your Workflow with Advanced LLM Techniques
AI Mastery 201: Elevating Your Workflow with Advanced LLM TechniquesVictorSzoltysek
 
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...harshavardhanraghave
 
The Guide to Integrating Generative AI into Unified Continuous Testing Platfo...
The Guide to Integrating Generative AI into Unified Continuous Testing Platfo...The Guide to Integrating Generative AI into Unified Continuous Testing Platfo...
The Guide to Integrating Generative AI into Unified Continuous Testing Platfo...kalichargn70th171
 
How To Use Server-Side Rendering with Nuxt.js
How To Use Server-Side Rendering with Nuxt.jsHow To Use Server-Side Rendering with Nuxt.js
How To Use Server-Side Rendering with Nuxt.jsAndolasoft Inc
 
8257 interfacing 2 in microprocessor for btech students
8257 interfacing 2 in microprocessor for btech students8257 interfacing 2 in microprocessor for btech students
8257 interfacing 2 in microprocessor for btech studentsHimanshiGarg82
 
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...Steffen Staab
 
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...ICS
 
HR Software Buyers Guide in 2024 - HRSoftware.com
HR Software Buyers Guide in 2024 - HRSoftware.comHR Software Buyers Guide in 2024 - HRSoftware.com
HR Software Buyers Guide in 2024 - HRSoftware.comFatema Valibhai
 
Azure_Native_Qumulo_High_Performance_Compute_Benchmarks.pdf
Azure_Native_Qumulo_High_Performance_Compute_Benchmarks.pdfAzure_Native_Qumulo_High_Performance_Compute_Benchmarks.pdf
Azure_Native_Qumulo_High_Performance_Compute_Benchmarks.pdfryanfarris8
 
introduction-to-automotive Andoid os-csimmonds-ndctechtown-2021.pdf
introduction-to-automotive Andoid os-csimmonds-ndctechtown-2021.pdfintroduction-to-automotive Andoid os-csimmonds-ndctechtown-2021.pdf
introduction-to-automotive Andoid os-csimmonds-ndctechtown-2021.pdfVishalKumarJha10
 
5 Signs You Need a Fashion PLM Software.pdf
5 Signs You Need a Fashion PLM Software.pdf5 Signs You Need a Fashion PLM Software.pdf
5 Signs You Need a Fashion PLM Software.pdfWave PLM
 
Introducing Microsoft’s new Enterprise Work Management (EWM) Solution
Introducing Microsoft’s new Enterprise Work Management (EWM) SolutionIntroducing Microsoft’s new Enterprise Work Management (EWM) Solution
Introducing Microsoft’s new Enterprise Work Management (EWM) SolutionOnePlan Solutions
 
Direct Style Effect Systems - The Print[A] Example - A Comprehension Aid
Direct Style Effect Systems -The Print[A] Example- A Comprehension AidDirect Style Effect Systems -The Print[A] Example- A Comprehension Aid
Direct Style Effect Systems - The Print[A] Example - A Comprehension AidPhilip Schwarz
 
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️Delhi Call girls
 

Último (20)

VTU technical seminar 8Th Sem on Scikit-learn
VTU technical seminar 8Th Sem on Scikit-learnVTU technical seminar 8Th Sem on Scikit-learn
VTU technical seminar 8Th Sem on Scikit-learn
 
Software Quality Assurance Interview Questions
Software Quality Assurance Interview QuestionsSoftware Quality Assurance Interview Questions
Software Quality Assurance Interview Questions
 
How To Troubleshoot Collaboration Apps for the Modern Connected Worker
How To Troubleshoot Collaboration Apps for the Modern Connected WorkerHow To Troubleshoot Collaboration Apps for the Modern Connected Worker
How To Troubleshoot Collaboration Apps for the Modern Connected Worker
 
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
 
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdfLearn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
 
The Ultimate Test Automation Guide_ Best Practices and Tips.pdf
The Ultimate Test Automation Guide_ Best Practices and Tips.pdfThe Ultimate Test Automation Guide_ Best Practices and Tips.pdf
The Ultimate Test Automation Guide_ Best Practices and Tips.pdf
 
AI Mastery 201: Elevating Your Workflow with Advanced LLM Techniques
AI Mastery 201: Elevating Your Workflow with Advanced LLM TechniquesAI Mastery 201: Elevating Your Workflow with Advanced LLM Techniques
AI Mastery 201: Elevating Your Workflow with Advanced LLM Techniques
 
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
 
The Guide to Integrating Generative AI into Unified Continuous Testing Platfo...
The Guide to Integrating Generative AI into Unified Continuous Testing Platfo...The Guide to Integrating Generative AI into Unified Continuous Testing Platfo...
The Guide to Integrating Generative AI into Unified Continuous Testing Platfo...
 
How To Use Server-Side Rendering with Nuxt.js
How To Use Server-Side Rendering with Nuxt.jsHow To Use Server-Side Rendering with Nuxt.js
How To Use Server-Side Rendering with Nuxt.js
 
8257 interfacing 2 in microprocessor for btech students
8257 interfacing 2 in microprocessor for btech students8257 interfacing 2 in microprocessor for btech students
8257 interfacing 2 in microprocessor for btech students
 
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
 
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
 
HR Software Buyers Guide in 2024 - HRSoftware.com
HR Software Buyers Guide in 2024 - HRSoftware.comHR Software Buyers Guide in 2024 - HRSoftware.com
HR Software Buyers Guide in 2024 - HRSoftware.com
 
Azure_Native_Qumulo_High_Performance_Compute_Benchmarks.pdf
Azure_Native_Qumulo_High_Performance_Compute_Benchmarks.pdfAzure_Native_Qumulo_High_Performance_Compute_Benchmarks.pdf
Azure_Native_Qumulo_High_Performance_Compute_Benchmarks.pdf
 
introduction-to-automotive Andoid os-csimmonds-ndctechtown-2021.pdf
introduction-to-automotive Andoid os-csimmonds-ndctechtown-2021.pdfintroduction-to-automotive Andoid os-csimmonds-ndctechtown-2021.pdf
introduction-to-automotive Andoid os-csimmonds-ndctechtown-2021.pdf
 
5 Signs You Need a Fashion PLM Software.pdf
5 Signs You Need a Fashion PLM Software.pdf5 Signs You Need a Fashion PLM Software.pdf
5 Signs You Need a Fashion PLM Software.pdf
 
Introducing Microsoft’s new Enterprise Work Management (EWM) Solution
Introducing Microsoft’s new Enterprise Work Management (EWM) SolutionIntroducing Microsoft’s new Enterprise Work Management (EWM) Solution
Introducing Microsoft’s new Enterprise Work Management (EWM) Solution
 
Direct Style Effect Systems - The Print[A] Example - A Comprehension Aid
Direct Style Effect Systems -The Print[A] Example- A Comprehension AidDirect Style Effect Systems -The Print[A] Example- A Comprehension Aid
Direct Style Effect Systems - The Print[A] Example - A Comprehension Aid
 
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
 

Introduction to VTK

  • 1. 1 INTRODUCTION TO VTK Gustav Taxén, Ph. D. Associate Professor School of Computing Science and Communication Royal Institute of Technology, Stockholm gustavt@csc.kth.se
  • 2. 2 OVERVIEW Programming library Development of scivis apps Very powerful 1133 C++ classes (v 5.0) C++, Tcl/Tk, Python, and Java bindings
  • 3. 3 OVERVIEW Over-designed Very complex Limited on-line tutorial material Undergone semantic/syntactic changes Very steep learning curve!
  • 5. 5 DEFINITIONS Point ! Location in 3D space Attribute data " Information stored at points Book is vague Called point data in the code
  • 6. 6 DEFINITIONS Dataset = Structure + Attribute data Geometry (the points) Topology (how points are connected)
  • 7. 7 DEFINITIONS A topology is built up from cells There are different kinds of cells There are different kinds of datasets in VTK that organize cells in different ways Some datasets use only one or a couple of cell types Other are more general
  • 8. 8 CELL EXAMPLES This is a polyline cell It consists of 2 or more connected lines
  • 9. 9 CELL EXAMPLES This is a tetrahedron cell It consists of 3 triangles
  • 10. 10 CELL EXAMPLES This is a pixel cell It consists of one quad, aligned with one of the world coord system planes
  • 11. 11 CELLS There are 16 kinds of linear cells in VTK They interpolate attribute data linearly between points There are non-linear cells too They interpolate using polynomal basis functions
  • 12. 12 DATA SETS Dataset = Structure + Attribute data Some datasets impose a cell structure Others are more general
  • 13. 13 DATASETS This is an Image dataset This example uses pixel cells There are 5x6 = 30 points and 4x5 = 20 cells The image dataset can use line, pixel, or voxel cells
  • 14. 14 DATASETS The PolyData dataset consists of: a set of vertex cells a set of line cells a set of polygon cells a set of triangle strip cells It is used for unstructured data
  • 15. 15 CELL ARRAYS For datasets where lists of cells are involved (e.g., PolyData) you specify the cells using CellArray:s
  • 16. 16 EXAMPLE Let’s see how the data in this image is organized! The data describes a particle trajectory It is a line strip containing 9999 (colored) vertices
  • 17. 17 Points Positions vtkPoints Positions vtkPolyData Lines Points Point data Polygons Vertices Triangle strips We use a PolyData dataset. The geometry of the dataset are the locations of the vertices. They are specified as VTK points. A point always has 3 dimensions (x, y, z).
  • 18. 18 vtkCellArray Indices Points Positions vtkPoints Positions vtkPolyData Lines Points Point data Polygons Vertices Triangle strips Since this DataSet doesn’t impose a cell structure, we need to specifiy the topology explicitly, i.e., the cells of the dataset, i.e., what the relationship between the points is. THIS IMAGE IS VERY IMPORTANT – EVERYONE SHOULD UNDERSTAND IT BEFORE MOVING ON! A PolyData dataset can connect points in different ways. It can contain vertices, lines, polygons, and/or triangle strips. Since PolyData is an unstructured dataset, we need to specify cells explicitly. It must be done via CellArrays. There is one CellArray for the vertices, one for the lines, one for the polygons, and one for the tristrips. A CellArray is an integer-valued array containing point list indices. Together, these indices specify one or more cells. How the indices are combined into cells are determined by whether we assign the CellArray as the vertices, the lines, the polygons, or the trianglestrips of the dataset. The format of the CellArray is as follows: The first value is the number of indices for the first cell. Then follows the indices themselves. The next value is the number of indices for the second cell. Then follows the indices for the second cell, and so on. In our case, we choose to use ONE cell. This cell will contain 9999 indices - one for each point. If a line contains more than two indices it is automatically interpreted as a line strip. Since the data points are in order, the indices first index is 0, the second is 1, and so on up to 9998.
  • 19. 19 vtkCellArray Indices Points Positions vtkPoints Positions vtkFloatArray Scalars vtkPolyData Lines Points Point data Polygons Vertices Triangle strips vtkPointData Scalars Vectors Normals Tex coords Tensors The next step is to assign the scalar values to the points. The dataset contains ”attribute data”, which is VTK speak for ”values defined at point locations”. These values are the ones that are interpolated by VTK when we generate the image. In the API, the ”attribute data” is denoted as ”point data”. At each point, we can store a scalar, a 3D vector, a normal, a 2D tex coord, or a tensor. I’m not sure whether it’s OK to store more than one of these at each point. Here, we want to store scalars, which means that we need one floating-point value for each geometry point. This has been provided to us in the same data file that contains the particle trajectory data. ”Attribute data” (or ”Point data”) is stored in FloatArrays. If the data is multidimensional, it is interleaved in the array. For example, a 3D vector at each point would be stored as X0 Y0 Z0 X1 Y1 Z1, and so on. The point data is ”owned” by the polydata object. It has ”slots” for scalars, vectors, normals, etc. We can either use a pointer to a FloatArray in these slots, or we can choose to copy the data into the PointData object.
  • 20. 20 EXAMPLE A 3D vector field is visualized using a ”hedgehog” The field is defined at regularly spaced locations in a volume
  • 21. 21 vtkImageData Point data vtkFloatArray XYZ Dimensions: 4x4x4 vtkPointData Scalars Vectors Normals Tex coords Tensors tuple Since the data is regularly spaced, we can use a ImageData dataset. In VTK, ImageData can be both 2D and 3D, as long as it is regular and is aligned with the global coord axes. We specify that the number of samples in the dataset along each axis is 4x4x4. We then set a world-space spacing between each sample. This completely defines both the geometry and the topology. What remains to be done is to assign the ”attribute data” (or ”point data”) at each point. Again, the 3D vectors to be assigned to the points are stored in a FloatArray. Here, we need 3 floating-point values per geometry point. These 3 values are referred to as a tuple. All datasets in VTK use the vtkPointData class to assign attribute data to points. In this case, we want to store a vector at each point, so we use the ”vector” slot of the PointData class.
  • 22. 22 HOW IMAGES ARE CREATED vtkRenderWindow vtkRenderer vtkCamera vtkLight vtkActor
  • 23. 23 PROPS AND ACTORS Prop ! Something that can be drawn Actor ! A prop that can be transformed There are 2D and 3D actors Each actor has one property: Property ! Collection of settings for surface material, opacity, etc.
  • 24. 24 FILTERS AND MAPPERS Filter ! Object that converts a dataset into a different dataset or performs operations on a dataset Mapper ! Object responsible for converting datasets into a form suitable for actors
  • 25. 25 THE VTK PIPELINE Data set SOURCE MAPPER Data set FILTER Geometry ACTOR Geometry RENDERER Geometry WINDOW
  • 28. 28 FILTERS Dataset / Source Filter 1 Filter 2 Filter 3 Mapper 1Mapper 2
  • 30. 30 PORTS All pipeline objects have ports Whether an input port is repeatable, i.e., if you may connect more than one output to it depends on the object Errors are detected at run-time
  • 31. 31 PORTS There are two ways to connect objects The old syntax still works but is discouraged It doesn’t ”know” about multiple inputs The assignment intermingles both !
  • 32. 32 MEMORY MANAGEMENT VTK uses reference counting Don’t use new to create objects! vtkActor* actor = vtkActor::New(); ... actor->Delete();
  • 33. 33 MEMORY MANAGEMENT The object may or may not be deleted when you call Delete() If you have assigned the object to another object (e.g., via a port) it is not When VTK methods are used to assign, a reference counter is increased When Delete() is called the counter is decreased
  • 34. 34 MEMORY MANAGEMENT When reference counter reaches 0 the object is deleted BE CAREFUL! Not true garbage collection This code will break: vtkActor* actor = vtkActor::New(); vtkActor* pointer = actor; actor->Delete(); pointer->Render();