Visualization History Visual Programming Visualization History - - PowerPoint PPT Presentation

visualization history visual programming visualization
SMART_READER_LITE
LIVE PREVIEW

Visualization History Visual Programming Visualization History - - PowerPoint PPT Presentation

Visualization History Visual Programming Visualization History Visual Programming Visualization libraries Visualization libraries Haberlis Haberlis landmark landmark ConMan ConMan paper paper - -1985? 1985?


slide-1
SLIDE 1

Visualization History Visualization History

  • Visualization libraries

Visualization libraries

– – Embed into simulation code Embed into simulation code – – Outputs images (plots) during run Outputs images (plots) during run-

  • time.

time.

  • Post

Post-

  • process of restart dumps

process of restart dumps

– – Custom tools for custom data formats Custom tools for custom data formats – – Custom derived data, data Custom derived data, data mappers mappers

Visual Programming Visual Programming

  • Haberli’s

Haberli’s landmark landmark ConMan ConMan paper paper -

  • 1985?

1985?

  • Extension of Unix pipes.

Extension of Unix pipes.

  • Take a small specialized program

Take a small specialized program

– – Provide wrapper for remote procedure and Provide wrapper for remote procedure and shared memory shared memory – – Provide GUI for parameters ( Provide GUI for parameters (args args) of the ) of the program. program.

Early Visual Early Visual Prog Prog. . Env Env. .

  • Data Push models

Data Push models

– – aPe aPe -

  • Ohio State / OSC

Ohio State / OSC – – AVS AVS -

  • Advanced Visualization System

Advanced Visualization System

  • Stellar Computer

– – Khoros Khoros -

  • Univ. of New Mexico?
  • Univ. of New Mexico?

– – Iris Explorer Iris Explorer – – SGI / NAG SGI / NAG

  • Data Flow model

Data Flow model

Great concepts Great concepts

  • Very similar to

Very similar to Corba Corba support support

– – provides the shared memory communication provides the shared memory communication – – each “module” is it’s own process each “module” is it’s own process

  • Can reside on it’s own CPU
  • Can reside across the network
  • Tools to automatically convert a C, C++ or

Tools to automatically convert a C, C++ or Fortran program to a module. Fortran program to a module.

slide-2
SLIDE 2

Problems Problems

  • Data pushed to module A

Data pushed to module A

  • Data modified by A (a “

Data modified by A (a “mapper mapper”) and ”) and pushed to both modules B and C. pushed to both modules B and C.

  • Four copies of the data now exist

Four copies of the data now exist

Read A C B

Execution Model Execution Model

  • Each module has a set of parameters or

Each module has a set of parameters or state that controls its output. state that controls its output.

  • A change to Module B’s parameters only

A change to Module B’s parameters only requires re requires re-

  • executing B.

executing B.

  • A change to Module A’s parameters, will re

A change to Module A’s parameters, will re-

  • execute A and send new data

execute A and send new data to both B and C. to both B and C.

Read A C B

Data Push Data Push vs vs Data Pull Data Pull

  • Data Push

Data Push

– – Push data when changed Push data when changed

  • Data Pull

Data Pull

– – Only request data when needed Only request data when needed – – Break the data into chunks, and only request Break the data into chunks, and only request small chunks at a time. small chunks at a time.

  • Multiple windows (paths)

Multiple windows (paths)

  • Memory requirements reduced

Memory requirements reduced

Early Visual Early Visual Prog Prog. . Env Env. .

  • Data Pull Models

Data Pull Models

– – Data Explorer ( Data Explorer (Dx Dx) ) -

  • IBM

IBM

  • Data centric

– – AVS/Express AVS/Express – – Image Vision Image Vision -

  • SGI

SGI – – Java Advanced Imaging Java Advanced Imaging – – Vtk Vtk – – Much more complicate, Much more flexible Much more complicate, Much more flexible

slide-3
SLIDE 3

VTK VTK The Visualization Toolkit The Visualization Toolkit

William J. Schroeder William J. Schroeder President, Kitware, Inc. President, Kitware, Inc. Rensselaer SCOREC Research Associate Rensselaer SCOREC Research Associate www.kitware.com www.kitware.com www.vtk.org www.vtk.org will.schroeder@kitware.com will.schroeder@kitware.com

Modified by Roger Crawfis

Themes Themes

  • Overview

Overview

  • Architecture

Architecture

  • Graphic Subsystem

Graphic Subsystem

  • Visualization Pipeline

Visualization Pipeline

  • Interaction

Interaction

  • Software Process

Software Process

  • Conclusion

Conclusion

Taxonomy of Visualization Taxonomy of Visualization Systems Systems

  • Toolkits / Libraries

Toolkits / Libraries

– – Components Components – – Little or no GUI Little or no GUI – – Meant to be integrated with other systems/toolkits Meant to be integrated with other systems/toolkits – – Programming required Programming required

  • Development Environments

Development Environments

– – Components Components – – GUI GUI-

  • assisted (visual) programming

assisted (visual) programming

  • Applications

Applications

– – Turn Turn-

  • key

key – – Minimal programming Minimal programming

What Is VTK? What Is VTK?

A visualization toolkit

– Designed and implemented using object-oriented principles – C++ class library (~700+ classes; ~425,000 LOC; <225,000 executable lines) – Automated Java, TCL, Python bindings – Portable across Unix, Windows, Mac OSX – Supports 3D/2D graphics, visualization, image processing, volume rendering – Focused on scientific visualization, some support for higher- dimensional visualization – Open-source (BSD-style, not GPL) – www.vtk.org

A visualization A visualization toolkit toolkit

– – Designed and implemented using object Designed and implemented using object-

  • oriented principles
  • riented principles

– – C++ class library (~700+ classes; ~425,000 LOC; <225,000 C++ class library (~700+ classes; ~425,000 LOC; <225,000 executable lines) executable lines) – – Automated Java, TCL, Python bindings Automated Java, TCL, Python bindings – – Portable across Unix, Windows, Mac OSX Portable across Unix, Windows, Mac OSX – – Supports 3D/2D graphics, visualization, image processing, volume Supports 3D/2D graphics, visualization, image processing, volume rendering rendering – – Focused on scientific visualization, some support for higher Focused on scientific visualization, some support for higher-

  • dimensional visualization

dimensional visualization – – Open Open-

  • source (BSD

source (BSD-

  • style, not GPL)

style, not GPL) – – www.vtk.org www.vtk.org

slide-4
SLIDE 4

VTK Is A Toolkit, Not a VTK Is A Toolkit, Not a System System

  • Embeddable

Embeddable

– – Plays with other software Plays with other software

  • Separable

Separable

– – Can pull out “pieces” Can pull out “pieces”

  • Adaptable

Adaptable

– – Not dependent on GUI Not dependent on GUI

  • X, Motif, Windows, Mac, Qt, FLTK, Tk, wxWindows,

etc. – – Not dependent on rendering library Not dependent on rendering library

  • OpenGL, others

History History

  • Precursor: GE Legacy System LYMB (circa 1983)

Precursor: GE Legacy System LYMB (circa 1983)

  • Proprietary software issues led to

Proprietary software issues led to

  • pen
  • pen-
  • source VTK project to create:

source VTK project to create:

– – Textbook Textbook – – Sample code Sample code

  • December ‘93 work begins on VTK

December ‘93 work begins on VTK text/software text/software

  • June 1998 Kitware forms:

June 1998 Kitware forms: VTK Commercial Support VTK Commercial Support

Things It Does Things It Does More Things: Image More Things: Image-

  • Processing

Processing

slide-5
SLIDE 5

Volume Rendering Volume Rendering Combined Volume/Surface Combined Volume/Surface Rendering Rendering Functionality Functionality

  • Graphics / Modeling

Graphics / Modeling

– – Smoothing, decimation, extrusion, Smoothing, decimation, extrusion, Delaunay Delaunay triangulation triangulation (2D/3D), etc. (2D/3D), etc.

  • Image Processing

Image Processing

– – 100’s of filters 100’s of filters – – Integrated 2D / 3D Integrated 2D / 3D

  • Visualization

Visualization

– – Scalar, vector, tensor fields (100’s of filters) Scalar, vector, tensor fields (100’s of filters) – – Probing, cutting, clipping, extraction Probing, cutting, clipping, extraction – – Volume rendering Volume rendering

  • Multi

Multi-

  • dimensional

dimensional

– – Projection, Projection, resampling resampling

How To Use It How To Use It

  • Choose programming language

Choose programming language

– – C++ C++ – – Tcl Tcl – – Python Python – – Java Java

  • Assemble components to build applications

Assemble components to build applications

slide-6
SLIDE 6

Typical Application (in C++) Typical Application (in C++)

vtkSphereSource vtkSphereSource *sphere = *sphere = vtkSphereSource()::New vtkSphereSource()::New(); (); // create data pipeline // create data pipeline vtkPolyDataMapper vtkPolyDataMapper * *sphereMapper sphereMapper = = vtkPolyDataMapper::New vtkPolyDataMapper::New(); (); sphereMapper sphereMapper SetInput(sphere SetInput(sphere GetOutput GetOutput()); ()); vtkActor vtkActor * *sphereActor sphereActor = = vtkActor::New vtkActor::New(); (); sphereActor sphereActor SetMapper(sphereMapper SetMapper(sphereMapper); ); // // mapper mapper connects the actor with pipeline connects the actor with pipeline vtkRenderer vtkRenderer * *renderer renderer = = vtkRenderer::New vtkRenderer::New(); (); // graphics library independent // graphics library independent vtkRenderWindow vtkRenderWindow * *renWin renWin = = vtkRenderWindow::New vtkRenderWindow::New(); (); renWin renWin AddRenderer(renderer AddRenderer(renderer); ); vtkRenderWindowInteractor vtkRenderWindowInteractor * *iren iren = = vtkRenderWindowInteractor::New vtkRenderWindowInteractor::New(); (); iren iren SetRenderWindow(renWin SetRenderWindow(renWin); ); renderer renderer AddActor(sphereActor AddActor(sphereActor); ); renderer renderer SetBackground(1,1,1); SetBackground(1,1,1); renWin renWin SetSize(300,300); SetSize(300,300); renWin renWin Render Render(); (); iren iren Start Start(); (); // being event loop // being event loop

Architecture Architecture

  • Compiled / Interpreted

Compiled / Interpreted

– – C++ core C++ core – – Tcl Tcl, Python, Java wrappers , Python, Java wrappers

  • Subsystems

Subsystems

– – Graphics Graphics – – Visualization pipeline Visualization pipeline

  • Image processing
  • 3D data processing

– – Interaction Interaction

VTK Architecture VTK Architecture

  • Compiled C++ core

Compiled C++ core

– – Performance Performance – – Code correctness Code correctness

  • Wrapper layer

Wrapper layer

– – Often interpreted (e.g. Often interpreted (e.g. Tcl Tcl) ) – – Can be compiled layer Can be compiled layer

  • Microsoft COM

C++ core Wrappers Wrapper layer generated automatically during build process

Tcl Interpreter Tcl Interpreter

  • source

source vtkInt.tcl vtkInt.tcl (define interpreter GUI) (define interpreter GUI)

slide-7
SLIDE 7

Code Comparison Code Comparison

  • C++

C++

vtkShrinkFilter vtkShrinkFilter * *sf sf; ; sf sf = = vtkShrinkFilter::New vtkShrinkFilter::New(); (); sf sf-

  • >SetShrinkFactor(0.8);

>SetShrinkFactor(0.8); vtkPolyDataMapper vtkPolyDataMapper *m; *m; m = m = vtkPolyDataMapper::Ne vtkPolyDataMapper::Ne ()

  • Tcl

Tcl

vtkShrinkFilter vtkShrinkFilter sf sf sf sf SetShrinkFactor SetShrinkFactor 0.8 0.8 vtkPolyDataMapper vtkPolyDataMapper m m m m SetInput SetInput [ [ sf sf GetOutput GetOutput ] ]

Graphics Subsystem Graphics Subsystem

  • Lights

Lights

  • Cameras

Cameras

  • Actors

Actors

  • Mappers

Mappers

  • Transforms

Transforms

  • Properties

Properties

  • Render Window

Render Window

  • Renderer

Renderer

The VTK Graphics Subsystem The VTK Graphics Subsystem

A VTK A VTK scene scene consists of: consists of:

  • vtkRenderWindow

vtkRenderWindow -

  • contains the final image

contains the final image

  • vtkRenderer

vtkRenderer -

  • draws into the render window

draws into the render window

  • vtkActor

vtkActor -

  • combines properties / geometry

combines properties / geometry

– – vtkProp vtkProp, vtkProp3D are , vtkProp3D are superclasses superclasses – – vtkProperty vtkProperty

  • vtkLights

vtkLights -

  • illuminate actors

illuminate actors

  • vtkCamera

vtkCamera -

  • renders the scene

renders the scene

  • vtkMapper

vtkMapper -

  • represents geometry

represents geometry

– – vtkPolyDataGeometry vtkPolyDataGeometry, , vtkDataSetMapper vtkDataSetMapper are subclasses are subclasses

  • vtkTransform

vtkTransform -

  • position actors

position actors

Graphics Model Graphics Model

Instances of render window (vtkRenderWindow) Actor instances (vtkActor) Renderer instances (vtkRenderer)

slide-8
SLIDE 8

Visualization Pipeline Visualization Pipeline

  • Data objects

Data objects

  • Process objects

Process objects

  • Pipelines

Pipelines

  • Managing execution

Managing execution

The Visualization Pipeline The Visualization Pipeline

A sequence of A sequence of process objects process objects that operate on that operate on data objects data objects to generate geometry that can be rendered by the to generate geometry that can be rendered by the graphics engine or written to a file graphics engine or written to a file Data Filter Data

to graphics system

Data Data Filter Actor Actor Mapper Mapper Source

Visualization Model Visualization Model

  • Data Objects

Data Objects

– – represent data represent data – – provide access to data provide access to data – – compute information particular to data compute information particular to data (e.g., bounding box, derivatives) (e.g., bounding box, derivatives)

  • Process Objects

Process Objects

– – Ingest, transform, and output data objects Ingest, transform, and output data objects – – represent visualization algorithms represent visualization algorithms

vtkDataObject vtkDataObject / / vtkDataSet vtkDataSet

  • vtkDataObject

vtkDataObject represents a “blob” of data represents a “blob” of data

– – contain instance of contain instance of vtkFieldData vtkFieldData – – an array of arrays an array of arrays – – no geometric/topological structure no geometric/topological structure – – Superclass Superclass of all VTK data objects

  • f all VTK data objects
  • vtkDataSet

vtkDataSet has geometric/topological structure has geometric/topological structure

– – Consists of geometry (points) and topology (cells) Consists of geometry (points) and topology (cells) – – Has associated “attribute data” (e.g., scalars, vectors) as well Has associated “attribute data” (e.g., scalars, vectors) as well as field data as field data – – Convert data object to data set with Convert data object to data set with vtkDataObjectToDataSetFilter vtkDataObjectToDataSetFilter

slide-9
SLIDE 9

vtkDataObject vtkDataObject / / vtkDataSet vtkDataSet

Geometry & Topology Attribute Data Points & Cells Point Data Cell Data Array of arrays Field Data vtkDataObject vtkDataSet

Concept Implementation Structure Associate d Data

Dataset Model Dataset Model

  • A dataset is a data object with structure

A dataset is a data object with structure

  • Structure consists of

Structure consists of

– – points (x points (x-

  • y

y-

  • z coordinates)

z coordinates) – – cells (e.g., polygons, lines, cells (e.g., polygons, lines, voxels voxels) that are defined by ) that are defined by connectivity list referring to points ids connectivity list referring to points ids – – Access is via integer ID Access is via integer ID – – implicit representations implicit representations – – explicit representations explicit representations

Cell Points

vtkDataSet vtkDataSet Subclasses Subclasses

vtkPolyData vtkImageData vtkStructuredGrid vtkUnstructuredGrid vtkRectilinearGrid

Data Set Attributes Data Set Attributes

  • vtkDataSet

vtkDataSet also has point and cell attribute also has point and cell attribute data: data:

– – Scalars Scalars – – (multi (multi-

  • component)

component) – – Vectors Vectors -

  • 3

3-

  • vector

vector – – Tensors Tensors -

  • 3x3 symmetric matrix

3x3 symmetric matrix – – Normals Normals -

  • unit vector

unit vector – – Texture Coordinates Texture Coordinates 1 1-

  • 3D

3D – – Array of arrays (I.e. Array of arrays (I.e. FieldData FieldData) )

slide-10
SLIDE 10

Scalars (An Aside) Scalars (An Aside)

  • Scalars are represented by a

Scalars are represented by a vtkDataArray vtkDataArray

  • Scalars are typically single valued

Scalars are typically single valued

  • Scalars can also represent color

Scalars can also represent color

– – I (intensity) I (intensity) – – IA (intensity IA (intensity-

  • alpha:

alpha: alpha is opacity) alpha is opacity) – – RGB (red RGB (red-

  • green

green-

  • blue)

blue) – – RGBA (RGB + alpha) RGBA (RGB + alpha)

  • Scalars can be used to generate colors

Scalars can be used to generate colors

– – mapped through lookup table mapped through lookup table – – if unsigned char if unsigned char direct color specification direct color specification

Process Objects Process Objects

Source Mapper Filter 1 or more outputs 1 or more outputs 1 or more inputs 1 or more inputs

  • Process objects operate on data objects

Process objects operate on data objects

Pipeline Execution Model Pipeline Execution Model

direction of update (via Update()) Source Data Filter Data Mapper Render() direction of data flow (via Execute())

Creating Pipeline Topology Creating Pipeline Topology

  • aFilter

aFilter-

  • >

>SetInput SetInput( ( bFilter bFilter-

  • >

>GetOutput GetOutput()); ());

  • The Role of Type

The Role of Type-

  • Checking

Checking

– – SetInput SetInput() accepts dataset type or subclass () accepts dataset type or subclass – – C++ compile C++ compile-

  • time checking

time checking – – Interpreter run Interpreter run-

  • time checking

time checking

slide-11
SLIDE 11
  • Decimation, smoothing,

Decimation, smoothing, normals normals

  • Implemented in C++

Implemented in C++

Example Pipeline Example Pipeline

vtkSmoothPolyDataFilter vtkDecimatePro vtkBYUReader vtkPolyDataNormals vtkPolyDataMapper

Note: data objects are not shown they are implied from the output type of the filter

Create Reader & Decimator Create Reader & Decimator

vtkBYUReader vtkBYUReader * *byu byu = = vtkBYUReader::New vtkBYUReader::New(); (); byu byu-

  • >

>SetGeometryFileName("../../vtkdata/fran_cut.g SetGeometryFileName("../../vtkdata/fran_cut.g”); ”); vtkDecimatePro vtkDecimatePro * *deci deci = = vtkDecimatePro::New vtkDecimatePro::New(); (); deci deci-

  • >

>SetInput SetInput( ( byu byu-

  • >

>GetOutput GetOutput() ); () ); deci deci-

  • >

>SetTargetReduction SetTargetReduction( 0.9 ); ( 0.9 ); deci deci-

  • >

>PreserveTopologyOn PreserveTopologyOn(); (); deci deci-

  • >

>SetMaximumError SetMaximumError( 0.0002 ); ( 0.0002 );

Smoother & Graphics Objects Smoother & Graphics Objects

vtkSmoothPolyDataFilter vtkSmoothPolyDataFilter *smooth = *smooth = vtkSmoothPolyDataFilter::New vtkSmoothPolyDataFilter::New(); (); smooth smooth-

  • >

>SetInput(deci SetInput(deci-

  • >

>GetOutput GetOutput()); ()); smooth smooth-

  • >

>SetNumberOfIterations SetNumberOfIterations( 20 ); ( 20 ); smooth smooth-

  • >

>SetRelaxationFactor SetRelaxationFactor( 0.05 ); ( 0.05 ); vtkPolyDataNormals vtkPolyDataNormals * *normals normals = = vtkPolyDataNormals::New vtkPolyDataNormals::New(); (); normals normals-

  • >

>SetInput SetInput( smooth ( smooth-

  • >

>GetOutput GetOutput() ); () ); vtkPolyDataMapper vtkPolyDataMapper * *cyberMapper cyberMapper = = vtkPolyDataMapper::New vtkPolyDataMapper::New(); (); cyberMapper cyberMapper-

  • >

>SetInput SetInput( ( normals normals-

  • >

>GetOutput GetOutput() ); () ); vtkActor vtkActor * *cyberActor cyberActor = = vtkActor::New vtkActor::New(); (); cyberActor cyberActor-

  • >

>SetMapper SetMapper ( (cyberMapper cyberMapper); ); cyberActor cyberActor-

  • >

>GetProperty GetProperty() ()-

  • >

>SetColor SetColor ( 1.0, 0.49, 0.25 ); ( 1.0, 0.49, 0.25 ); cyberActor cyberActor-

  • >

>GetProperty GetProperty() ()-

  • >

>SetRepresentationToWireframe SetRepresentationToWireframe(); ();

More Graphics Objects More Graphics Objects

vtkRenderer vtkRenderer *ren1 = *ren1 = vtkRenderer::New vtkRenderer::New(); (); vtkRenderWindow vtkRenderWindow * *renWin renWin = = vtkRenderWindow::New vtkRenderWindow::New(); (); renWin renWin-

  • >

>AddRenderer AddRenderer( ren1 ); ( ren1 ); vtkRenderWindowInteractor vtkRenderWindowInteractor * *iren iren = = vtkRenderWindowInteractor vtkRenderWindowInteractor ::New(); ::New(); iren iren-

  • >

>SetRenderWindow SetRenderWindow( ( renWin renWin ); ); ren1 ren1-

  • >

>AddActor AddActor( ( cyberActor cyberActor ); ); ren1 ren1-

  • >

>SetBackground SetBackground( 1, 1, 1 ); ( 1, 1, 1 ); renWin renWin-

  • >

>SetSize SetSize( 500, 500 ); ( 500, 500 ); iren iren-

  • >Start();

>Start();

slide-12
SLIDE 12

Results Results

Before (52,260 triangles) After Decimation and Smoothing (7,477 triangles)

Parallel Processing Parallel Processing

  • Why ?

Why ? – – we have to we have to

  • Shared memory

Shared memory

  • Distributed execution

Distributed execution

– – MPI MPI – – Abstracted to support other communication Abstracted to support other communication

  • Parallel Mechanisms

Parallel Mechanisms

– – Task Task – – Data Data – – Pipeline Pipeline

  • Scalable

Scalable

– – Petabyte Petabyte example on 2048 LANL machine ( example on 2048 LANL machine (Martin et al. Martin et al. IEEE CG&A July 2001 IEEE CG&A July 2001) ) (A (A petabyte petabyte is is 2 to the 50th power 2 to the 50th power (1,125,899,906,842,624) bytes. A (1,125,899,906,842,624) bytes. A petabyte petabyte is equal to is equal to 1,024 terabytes. 1,024 terabytes. ) )

Examples Examples

  • Modeling turbulence (Ken Jansen Rensselaer)

Modeling turbulence (Ken Jansen Rensselaer)

– – 8.5 million 8.5 million tetrahedra tetrahedra (per time step) (per time step) – – 150 million 150 million tetrahedra tetrahedra (soon) (soon)

Large Data Management Large Data Management

  • Visible Woman CT Data

870 MBytes 1734 Slices at 512x512x2

  • Visible Woman CT Data

Visible Woman CT Data

870 870 MBytes MBytes 1734 Slices at 512x512x2 1734 Slices at 512x512x2

  • Bell-Boeing V-2 2 tiltrotor

140 Gbytes

  • Bell-Boeing V-2 2 tiltrotor

140 Gbytes

slide-13
SLIDE 13

Streaming Pipeline Streaming Pipeline

  • Basic idea: handle any size data on any size computer

Basic idea: handle any size data on any size computer

  • Data is broken into pieces, and pieces processed one

Data is broken into pieces, and pieces processed one at a time through pipeline at a time through pipeline

– – Piece size based on memory limits Piece size based on memory limits – – Can avoid system swap Can avoid system swap – – Supports parallel processing Supports parallel processing – – Issues Issues

  • How to create pieces
  • Mapping output from input
  • Results invariance

Filter

Pieces Pieces

Imaging: i,j,k extents. Imaging: i,j,k extents. Graphics Graphics

xMin xMax yMin yMin xMin xMax yMin yMin zMin zMax image->SetUpdateExtent(0, 128, 0, 128, 0, 90); image->Update(); data->SetUpdateExtent(0, 2); data->Update();

Piece = 0 NumberOfPieces = 2

Interaction Interaction

  • Command / Observer callback mechanism

Command / Observer callback mechanism

  • Interactor

Interactor Styles Styles

  • 3D Widgets

3D Widgets

vtkRenderWindowInteractor vtkRenderWindowInteractor

Key features: Key features:

  • SetRenderWindow

SetRenderWindow – – the single render the single render window to interact with window to interact with

  • Key and mouse bindings (

Key and mouse bindings (Interactor Interactor Style) Style)

  • Light Follow Camera (a headlight)

Light Follow Camera (a headlight)

  • Picking interaction

Picking interaction

slide-14
SLIDE 14

Interactor Interactor Style(s) Style(s)

  • Button 1

Button 1 – – rotate rotate

  • Button 2

Button 2 – – translate (<Shift> Button 1 on translate (<Shift> Button 1 on PC) PC)

  • Button 3

Button 3 – – zoom zoom

  • Keypress

Keypress e or q e or q – – exit exit

  • Keypress

Keypress f f – – “fly “fly-

  • to” point under mouse

to” point under mouse

  • Keypress

Keypress s/w s/w – – surface/ surface/wireframe wireframe

  • Keypress

Keypress p p – – pick pick

  • Keypress

Keypress r r – – reset camera reset camera

  • Keypress

Keypress 3 3 – – toggle stereo toggle stereo

Switch styles: Keypress j – joystick; t - trackball style

Picking Picking

  • vtkPropPicker

vtkPropPicker -

  • hardware

hardware-

  • assisted picking of

assisted picking of vtkProps vtkProps

  • vtkPicker

vtkPicker -

  • pick based on prop3D’s bounding box

pick based on prop3D’s bounding box (software ray cast) (software ray cast)

  • vtkPointPicker

vtkPointPicker -

  • pick points (closest point to camera

pick points (closest point to camera within tolerance within tolerance -

  • software ray cast)

software ray cast)

  • vtkCellPicker

vtkCellPicker -

  • pick cells (software ray cast)

pick cells (software ray cast)

  • vtkWorldPointPicker

vtkWorldPointPicker -

  • get x

get x-

  • y

y-

  • z coordinate; does not

z coordinate; does not pick prop (hardware assisted) pick prop (hardware assisted)

Example: Picking and Style Example: Picking and Style

vtkRenderWindowInteractor vtkRenderWindowInteractor * *iren iren = = vtkRenderWindowInteractor::New vtkRenderWindowInteractor::New(); (); vtkInteractorStyleFlight vtkInteractorStyleFlight *style = *style = vtkInteractorStyleFlight::New vtkInteractorStyleFlight::New(); (); vtkCellPicker vtkCellPicker *picker = *picker = vtkCellPicker::New vtkCellPicker::New(); (); iren iren-

  • >

>SetInteractorStyle(flight SetInteractorStyle(flight); ); iren iren-

  • >

>SetPicker(picker SetPicker(picker); ); (Note: defaults are automatically created, you rarely (Note: defaults are automatically created, you rarely ever need to do this) ever need to do this)

Command / Observer Callbacks Command / Observer Callbacks

  • Observers

Observers observe

  • bserve events on a particular VTK

events on a particular VTK instance instance

– – Use Use AddObserver AddObserver() to watch for events () to watch for events – – The observer is implicit; you actually add the command The observer is implicit; you actually add the command

  • When an observer sees the event it is interested in,

When an observer sees the event it is interested in, it invokes a it invokes a command command via the command’s Execute() via the command’s Execute() method method

  • The events originate from instances that invoke

The events originate from instances that invoke events on themselves (and may pass call data) events on themselves (and may pass call data)

– – This This-

  • >

>InvokeEvent(vtkCommand::ProgressEvent,NULL InvokeEvent(vtkCommand::ProgressEvent,NULL); );

slide-15
SLIDE 15

Command / Observer Command / Observer

vtkObject vtkCommand vtkCommand vtkCommand Registered observers

this->InvokeEvent()

3D Widgets 3D Widgets

  • Added since VTK 4.0 release

Added since VTK 4.0 release

– – Requires nightly / VTK 4.2 release Requires nightly / VTK 4.2 release

  • Subclass of

Subclass of vtkInteractorObserver vtkInteractorObserver

– – Interactor Interactor observers watches events invoked on

  • bservers watches events invoked on

vtkRenderWindowInteractor vtkRenderWindowInteractor – – Events are caught and acted on Events are caught and acted on – – Events can be prioritized and ordered Events can be prioritized and ordered – – The handling of a particular event can be The handling of a particular event can be aborted aborted

Some 3D Widgets Some 3D Widgets

  • vtkPointWidget

vtkPointWidget

  • vtkLineWidget

vtkLineWidget

  • vtkPlaneWidget

vtkPlaneWidget

  • vtkBoxWidget

vtkBoxWidget

  • vtkSphereWidget

vtkSphereWidget

  • Widgets often provide auxiliary functionality (e.g.,

Widgets often provide auxiliary functionality (e.g.,

  • btaining transforms,
  • btaining transforms, polydata

polydata, implicit functions, , implicit functions, etc.) etc.)

  • More than one widget at a time can be used

More than one widget at a time can be used

vtkBoxWidget vtkBoxWidget

slide-16
SLIDE 16

vtkPlaneWidget vtkPlaneWidget vtkLineWidget vtkLineWidget vtkPointWidget vtkPointWidget vtkImplicitPlaneWidget vtkImplicitPlaneWidget

slide-17
SLIDE 17

vtkImagePlaneWidget vtkImagePlaneWidget vtkScalarBarWidget vtkScalarBarWidget vtkSphereWidget vtkSphereWidget Example Usage ( Example Usage (Tcl Tcl) )

vtkLineWidget vtkLineWidget lineWidget lineWidget vtkPolyData vtkPolyData seeds seeds lineWidget lineWidget SetInput SetInput [pl3d [pl3d GetOutput GetOutput] ] lineWidget lineWidget AlignWithYAxisOn AlignWithYAxisOn lineWidget lineWidget PlaceWidget PlaceWidget lineWidget lineWidget GetPolyData GetPolyData seeds seeds ……. ……. ……… ……… lineWidget lineWidget SetInteractor SetInteractor iren iren lineWidget lineWidget AddObserver AddObserver StartInteractionEvent StartInteractionEvent BeginInteraction BeginInteraction lineWidget lineWidget AddObserver AddObserver InteractionEvent InteractionEvent GenerateStreamlines GenerateStreamlines

slide-18
SLIDE 18

Software Process Software Process

  • The Quality Dashboard

The Quality Dashboard

– – Managing open Managing open-

  • source development

source development – – The importance of feedback The importance of feedback

  • Tools

Tools

– – CVS CVS – – CMake CMake – – Doxygen Doxygen – – DART DART

Development Process Development Process

  • Standard C++ Style / Methodology

Standard C++ Style / Methodology

  • Documentation embedded in code (use

Documentation embedded in code (use Doxygen Doxygen to generated HTML) to generated HTML)

  • Use CVS source code control system

Use CVS source code control system

– – Allows simultaneous edits Allows simultaneous edits – – Merges files, flags conflicts Merges files, flags conflicts

  • Automatic wrapper generator (look at

Automatic wrapper generator (look at SWIG) SWIG)

  • Daily regression testing

Daily regression testing

  • Cross

Cross-

  • Platform Make (build environment)

Platform Make (build environment)

  • Open source, runs everywhere

Open source, runs everywhere

  • Simple “makefiles”

Simple “makefiles” CMakeLists.txt CMakeLists.txt

  • Generates native build files

Generates native build files

– – Makefiles on Unix/Linux Makefiles on Unix/Linux – – Projects/workspaces on MSVC Projects/workspaces on MSVC

  • www.cmake.org

www.cmake.org

Insight Toolkit (ITK) Insight Toolkit (ITK)

C++ Toolkit

Medical Image Processing Registration Segmentation

slide-19
SLIDE 19

ITK ITK

  • C++ Library

C++ Library

– – Uses Generic Programming Concepts (i.e. heavily Uses Generic Programming Concepts (i.e. heavily templated templated) ) – – N N-

  • Dimensional Images / Meshes

Dimensional Images / Meshes – – Complex Pixel Types Complex Pixel Types – – BSD BSD-

  • style open

style open-

  • source license

source license

  • Data Flow Architecture

Data Flow Architecture

– – Streaming Streaming

  • CABLE Interpreted Language Bindings

CABLE Interpreted Language Bindings

  • Development Process

Development Process

– – CMake CMake Build Environment Build Environment – – CVS Source Code Control CVS Source Code Control – – DART Testing System DART Testing System – – Doxygen Doxygen Documentation System Documentation System – – GNATS Bug Tracking GNATS Bug Tracking – – Web ( Web (itk.org itk.org), Mailing lists (mailman), etc. ), Mailing lists (mailman), etc.

  • www.itk.org

www.itk.org