VTK: The Visualiza.on Toolkit Part II: Visualiza.on Model - - PowerPoint PPT Presentation

vtk the visualiza on toolkit
SMART_READER_LITE
LIVE PREVIEW

VTK: The Visualiza.on Toolkit Part II: Visualiza.on Model - - PowerPoint PPT Presentation

VTK: The Visualiza.on Toolkit Part II: Visualiza.on Model Han-Wei Shen The Ohio State University VTK Visualiza.on Model Graphics and Visualiza.on


slide-1
SLIDE 1

VTK: ¡The ¡Visualiza.on ¡Toolkit ¡

Part ¡II: ¡Visualiza.on ¡Model ¡ Han-­‑Wei ¡Shen ¡ The ¡Ohio ¡State ¡University ¡ ¡

slide-2
SLIDE 2

VTK ¡Visualiza.on ¡Model ¡

  • Graphics ¡and ¡Visualiza.on ¡Model ¡

– Graphics ¡model: ¡rendering ¡ – Visualiza.on ¡model: ¡transforma.on ¡and ¡ representa.on ¡ ¡

Data source Visualization Graphics

Data Flow System: Pipeline execution

slide-3
SLIDE 3

The ¡Role ¡of ¡Visualiza.on ¡Model ¡

  • ¡Conver.ng ¡data ¡from ¡its ¡original ¡form ¡into ¡graphical ¡form ¡ ¡
  • ¡Deal ¡with ¡the ¡issues ¡of ¡transforma)on ¡and ¡representa)on ¡
  • ¡Representa.on: ¡internal ¡data ¡structures ¡ ¡
  • ¡Transforma.on: ¡data ¡to ¡graphics ¡ ¡

¡ ¡Example: ¡stock ¡price ¡display ¡ ¡

Internal ¡(computa.onal) ¡representa.on: ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡Arrays ¡of ¡stock ¡prices ¡

Price[i] ¡= ¡17100, ¡16950, ¡17073, ¡17050,… ¡ ¡ Time[i] ¡= ¡10, ¡10:30, ¡11, ¡11:30, ¡12, ¡… ¡ ¡

Graphical ¡Representa.on: ¡ ¡x-­‑y ¡plot ¡ ¡

slide-4
SLIDE 4

3D ¡Plot ¡Example ¡ ¡

Quadric function:

f(x,y,z) = a0 x + a1 y + a2 z + a3 xy + a4 yz + a5 xz + a6 x2 + a7 y2 + a8 z2

slide-5
SLIDE 5

3D ¡Plot ¡Example ¡ ¡

Quadric function:

  • Evaluate ¡the ¡func.on ¡at ¡a ¡

pre-­‑determined ¡x,y,z ¡ samples ¡

f(x,y,z) = a0 x + a1 y + a2 z + a3 xy + a4 yz + a5 xz + a6 x2 + a7 y2 + a8 z2

slide-6
SLIDE 6

3D ¡Plot ¡Example ¡ ¡

Quadric function:

  • Evaluate ¡the ¡func.on ¡at ¡a ¡

pre-­‑determined ¡x,y,z ¡ samples ¡

  • Store ¡the ¡func.on ¡values ¡

into ¡a ¡3D ¡array ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡

f(x,y,z) = a0 x + a1 y + a2 z + a3 xy + a4 yz + a5 xz + a6 x2 + a7 y2 + a8 z2 X ¡ Y ¡ Z ¡ f ¡ 0 ¡ 0 ¡ 0 ¡ 1 ¡ 0 ¡ 0 ¡ 2 ¡ 0 ¡ 0 ¡ … ¡ … ¡ … ¡

slide-7
SLIDE 7

3D ¡Plot ¡Example ¡ ¡

Quadric function:

  • Evaluate ¡the ¡func.on ¡at ¡a ¡

pre-­‑determined ¡x,y,z ¡ samples ¡

  • Store ¡the ¡func.on ¡values ¡

into ¡a ¡3D ¡array ¡ ¡ ¡

  • Generate ¡a ¡3D ¡surface ¡

corresponding ¡to ¡f(x,y,z) ¡= ¡c ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡(this ¡is ¡called ¡an ¡isosurface) ¡ ¡

f(x,y,z) = a0 x + a1 y + a2 z + a3 xy + a4 yz + a5 xz + a6 x2 + a7 y2 + a8 z2

Find all (x,y,z) f(x,y,z) = c

X ¡ Y ¡ Z ¡ f ¡ 0 ¡ 0 ¡ 0 ¡ 1 ¡ 0 ¡ 0 ¡ 2 ¡ 0 ¡ 0 ¡ … ¡ … ¡ … ¡

slide-8
SLIDE 8

3D ¡Plot ¡Example ¡ ¡

Quadric function:

  • Evaluate ¡the ¡func.on ¡at ¡a ¡

pre-­‑determined ¡x,y,z ¡ samples ¡

  • Store ¡the ¡func.on ¡values ¡

into ¡a ¡3D ¡array ¡ ¡ ¡

  • Generate ¡a ¡3D ¡surface ¡

corresponding ¡to ¡f(x,y,z) ¡= ¡c ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡(this ¡is ¡called ¡an ¡isosurface) ¡ ¡

  • Display ¡the ¡surface ¡

f(x,y,z) = a0 x + a1 y + a2 z + a3 xy + a4 yz + a5 xz + a6 x2 + a7 y2 + a8 z2

Transformation (visualization)

Find all (x,y,z) f(x,y,z) = c

F[x][y][z] = f(x,y,z) X ¡ Y ¡ Z ¡ f ¡ 0 ¡ 0 ¡ 0 ¡ 1 ¡ 0 ¡ 0 ¡ 2 ¡ 0 ¡ 0 ¡ … ¡ … ¡ … ¡

slide-9
SLIDE 9

VTK ¡Visualiza.on ¡Model ¡

  • Func.on ¡model: ¡Transforma.on ¡

– steps ¡to ¡create ¡visualiza.on ¡(how ¡ ¡data ¡flow ¡through ¡ the ¡system) ¡

  • Object ¡model: ¡objects ¡that ¡par.cipate ¡in ¡the ¡func.on ¡

model ¡ ¡ – processes ¡and ¡internal ¡data ¡structures ¡

How ¡is ¡a ¡visualiza.on ¡process ¡described ¡in ¡VTK? ¡

Visualiza.on ¡pipeline: ¡ ¡It ¡describes ¡the ¡flow ¡of ¡data ¡from ¡its ¡

  • riginal ¡form ¡to ¡the ¡final ¡image ¡output ¡ ¡

Visualiza.on ¡Pipeline ¡= ¡ ¡ ¡ ¡Func.on ¡Model ¡+ ¡Object ¡Model ¡ ¡

slide-10
SLIDE 10

VTK ¡Func.on ¡Model ¡ ¡

Sample F(x,y,z)

Point Array

Extract Surface

Polygon

Display

  • ¡Func.on ¡model ¡is ¡to ¡Illustrate ¡

the ¡steps ¡to ¡create ¡visualiza.on ¡

: process : data : data flow direction

slide-11
SLIDE 11

VTK ¡Object ¡Model ¡

Describe ¡the ¡objects ¡that ¡par.cipate ¡in ¡the ¡func.on ¡ model ¡(visualiza.on ¡pipeline) ¡

slide-12
SLIDE 12

VTK ¡Object ¡Model ¡

Describe ¡the ¡objects ¡that ¡par.cipate ¡in ¡the ¡func.onal ¡ model ¡(visualiza.on ¡pipeline) ¡

  • Process ¡Object: ¡Operates ¡on ¡(transform) ¡the ¡data ¡objects ¡

¡ ¡ ¡ ¡ ¡-­‑ ¡Example: ¡genera.ng ¡surfaces ¡from ¡F(x,y,z) ¡ ¡

slide-13
SLIDE 13

VTK ¡Object ¡Model ¡

Describe ¡which ¡objects ¡operate ¡on ¡the ¡func.onal ¡ model ¡(visualiza.on ¡pipeline) ¡

  • Process ¡Object: ¡Operates ¡on ¡(transform) ¡the ¡data ¡objects ¡

¡ ¡ ¡ ¡ ¡-­‑ ¡Example: ¡genera.ng ¡surfaces ¡from ¡F(x,y,z) ¡ ¡

  • ¡Data ¡Object: ¡Represent ¡informa)on ¡and ¡methods ¡to ¡create, ¡

access, ¡and ¡delete ¡the ¡informa.on ¡ ¡ ¡ ¡ ¡ ¡-­‑ ¡Example: ¡the ¡3D ¡point ¡array ¡F(x,y,z) ¡ ¡

slide-14
SLIDE 14

Visualization model

Process ¡Objects ¡

  • Source: ¡ ¡Interface ¡to ¡external ¡data ¡sources ¡

¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡or ¡generate ¡data ¡procedurally ¡

Graphics model Filter Mapper Actor Renderer Source

slide-15
SLIDE 15

Visualization model

Process ¡Objects ¡

  • Source: ¡ ¡Interface ¡to ¡external ¡data ¡sources ¡

¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡or ¡generate ¡data ¡procedurally ¡

  • ¡ ¡Filter: ¡ ¡ ¡ ¡ ¡Transform ¡the ¡data ¡input ¡ ¡

Graphics model Filter Mapper Actor Renderer Source

slide-16
SLIDE 16

Visualization model

Process ¡Objects ¡

  • Source: ¡ ¡Interface ¡to ¡external ¡data ¡sources ¡

¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡or ¡generate ¡data ¡procedurally ¡

  • ¡ ¡Filter: ¡ ¡ ¡ ¡ ¡Transform ¡the ¡data ¡input ¡ ¡
  • ¡ ¡Mapper: ¡ ¡The ¡sink ¡of ¡the ¡func.onal ¡model, ¡ ¡

¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡interface ¡with ¡the ¡graphics ¡model ¡

Graphics model Filter Actor Renderer Source Mapper

slide-17
SLIDE 17

Process ¡Objects ¡(cont’d) ¡

Sample F(x,y,z) Extract Surface Display

Point Array Polygon

Source Filter Mapper + Graphics Model

Objects

slide-18
SLIDE 18

Data ¡Objects ¡

Data ¡Object: ¡Dataset ¡ ¡

  • ¡ ¡Structures: ¡how ¡the ¡informa.on ¡is ¡organized ¡
  • ­‑ ¡Topology ¡
  • ­‑ ¡Geometry ¡ ¡
  • ¡ ¡Aeributes: ¡store ¡the ¡informa.on ¡we ¡want ¡ ¡

¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡to ¡visualize. ¡ ¡e.g. ¡func.on ¡values ¡

slide-19
SLIDE 19

Data ¡Objects: ¡structures ¡

  • Topology: ¡ ¡
  • ­‑ ¡Invariant ¡under ¡geometric ¡transforma.on ¡ ¡

¡(rota.on, ¡transla.on, ¡scaling ¡etc) ¡

  • ­‑ ¡Topological ¡structures: ¡Cells ¡ ¡
  • ¡Geometry: ¡ ¡
  • ­‑ ¡The ¡instan.a.on ¡of ¡the ¡topology ¡
  • ­‑ ¡Geometric ¡ ¡structures: ¡cells ¡with ¡ ¡

¡ ¡ ¡ ¡ ¡ ¡posi.ons ¡in ¡3D ¡space ¡ ¡

slide-20
SLIDE 20

¡VTK ¡Cell ¡Types ¡

(a) vertex (b) Polyvertex (c) line (d) polyline (e) triangle (e) Quadrilateral (e) Polygon (f) Tetrahedron (f) Hexahedron

And more

slide-21
SLIDE 21

VTK ¡Data ¡Aeributes ¡

  • The ¡informa.on ¡stored ¡at ¡each ¡corner ¡of ¡the ¡

cell ¡

– Scalars: ¡temperature, ¡pressure, ¡etc ¡ – Vector: ¡velocitys ¡ – Normals: ¡surface ¡direc.ons ¡ – Texture ¡coordinates: ¡graphics ¡specific ¡ – Tensors: ¡matrices ¡ ¡

slide-22
SLIDE 22

VTK ¡Datasets ¡

A Collection of structures and attributes

Structured Grid Rectilinear Grid Unstructured Points Structured Grid Polygonal Grid Unstructured Grid

slide-23
SLIDE 23

Pipeline ¡Connec.ons ¡ ¡

  • Type-­‑Checking: ¡the ¡type ¡of ¡input ¡data ¡and ¡the ¡

expected ¡input ¡to ¡a ¡filter ¡should ¡match, ¡which ¡can ¡be ¡ checked ¡at ¡compile, ¡link, ¡or ¡run ¡.me ¡ ¡

  • ¡Mul.plicity: ¡a ¡filter ¡can ¡have ¡one ¡or ¡mul.ple ¡output, ¡

and ¡each ¡output ¡can ¡have ¡mul.ple ¡fan-­‑out, ¡that ¡is, ¡ ¡ connected ¡to ¡one ¡or ¡mul.ple ¡downstream ¡processes ¡ ¡

Filter Data Filter Data Data Filter Data Data

slide-24
SLIDE 24

Pipeline ¡Execu.on ¡ ¡

  • A ¡visualiza.on ¡pipeline ¡is ¡ohen ¡executed ¡mul.ple ¡

.mes, ¡when ¡the ¡algorithm ¡parameters ¡are ¡changed ¡ for ¡example. ¡ ¡

  • How ¡a ¡visualiza.on ¡pipeline ¡is ¡executed ¡is ¡very ¡much ¡

related ¡to ¡the ¡performance ¡ ¡

  • A ¡process ¡object ¡should ¡re-­‑execute ¡only ¡if ¡changes ¡
  • ccur ¡to ¡its ¡input ¡

– Demand-­‑driven ¡approach: ¡when ¡the ¡output ¡of ¡the ¡process ¡ is ¡needed ¡ ¡ – Event-­‑driven ¡approach: ¡when ¡changes ¡to ¡the ¡process ¡or ¡to ¡ the ¡input ¡data ¡

slide-25
SLIDE 25

Pipeline ¡Synchroniza.on ¡ ¡

  • Pipeline ¡synchroniza.on ¡– ¡synchroniza.on ¡is ¡

needed ¡between ¡the ¡processes ¡in ¡the ¡ visualiza.on ¡pipeline ¡ ¡

– Explicit ¡execu.on: ¡a ¡centralized ¡execu.ve ¡is ¡used ¡to ¡ track ¡changes ¡and ¡coordinate ¡network ¡execu.on ¡ ¡ – Implicit ¡execu.on: ¡

  • ¡each ¡process ¡propagate ¡the ¡execu.on ¡request ¡to ¡its ¡

upstream ¡processes, ¡un.l ¡the ¡request ¡reaches ¡the ¡source ¡of ¡ the ¡pipeline ¡

  • The ¡source ¡process ¡then ¡examine ¡its ¡input ¡and ¡output ¡to ¡

decide ¡whether ¡it ¡should ¡execute ¡ ¡

  • Then ¡recursively ¡push ¡the ¡command ¡for ¡checking ¡down ¡to ¡

the ¡pipeline ¡ ¡

VTK uses this