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-process of restart dumps Post-process of restart dumps – Custom tools for custom data formats Custom tools for custom data formats – Custom derived data, data mappers Custom derived data, data mappers
Visualization History. Visualization libraries Embed into simulation code Outputs images (plots) during run-time. Post-process of restart dumps Custom tools for custom data formats Custom derived data, data mappers. Visual Programming. Haberli’s landmark ConMan paper -1985? - PowerPoint PPT Presentation
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Visualization HistoryVisualization History
• Visualization librariesVisualization libraries– Embed into simulation codeEmbed into simulation code– Outputs images (plots) during run-time.Outputs images (plots) during run-time.
• Post-process of restart dumpsPost-process of restart dumps– Custom tools for custom data formatsCustom tools for custom data formats– Custom derived data, data mappersCustom derived data, data mappers
Visual ProgrammingVisual Programming
• Haberli’s landmark ConMan paper -Haberli’s landmark ConMan paper -1985?1985?
• Extension of Unix pipes.Extension of Unix pipes.• Take a small specialized programTake a small specialized program
– Provide wrapper for remote procedure and Provide wrapper for remote procedure and shared memoryshared memory
– Provide GUI for parameters (args) of the Provide GUI for parameters (args) of the program.program.
Early Visual Prog. Env.Early Visual Prog. Env.
• Data Push modelsData Push models– aPe - Ohio State / OSC aPe - Ohio State / OSC – AVS - Advanced Visualization SystemAVS - Advanced Visualization System
• Stellar Computer– Khoros - Univ. of New Mexico?Khoros - Univ. of New Mexico?– Iris Explorer – SGI / NAGIris Explorer – SGI / NAG
• Data Flow modelData Flow model
Great conceptsGreat concepts
• Very similar to Corba supportVery similar to Corba support– provides the shared memory provides the shared memory
communicationcommunication– each “module” is it’s own processeach “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+Tools to automatically convert a C, C++ or Fortran program to a module.+ or Fortran program to a module.
ProblemsProblems
• Data pushed to module AData pushed to module A• Data modified by A (a “mapper”) and Data modified by A (a “mapper”) and
pushed to both modules B and C.pushed to both modules B and C.• Four copies of the data now existFour copies of the data now exist
Read
A
CB
Execution ModelExecution Model
• Each module has a set of parameters Each module has a set of parameters or state that controls its output.or state that controls its output.
• A change to Module B’s parameters A change to Module B’s parameters only requires re-executing B.only requires re-executing B.
• A change to Module A’s parameters, A change to Module A’s parameters, will re-execute A and send new data will re-execute A and send new data to both B and C.to both B and C.
Read
A
CB
Data Push vs Data PullData Push vs Data Pull
• Data PushData Push– Push data when changedPush data when changed
• Data PullData Pull– Only request data when neededOnly request data when needed– Break the data into chunks, and only Break the data into chunks, and only
request small chunks at a time.request small chunks at a time.
• Multiple windows (paths)Multiple windows (paths)• Memory requirements reducedMemory requirements reduced
Early Visual Prog. Env.Early Visual Prog. Env.
• Data Pull ModelsData Pull Models– Data Explorer (Dx) - IBMData Explorer (Dx) - IBM
Taxonomy of Visualization Taxonomy of Visualization SystemsSystems• Toolkits / LibrariesToolkits / Libraries
– ComponentsComponents– Little or no GUILittle or no GUI– Meant to be integrated with other systems/toolkitsMeant to be integrated with other systems/toolkits– Programming requiredProgramming required
• Development EnvironmentsDevelopment Environments– ComponentsComponents– GUI-assisted (visual) programmingGUI-assisted (visual) programming
A visualization A visualization toolkittoolkit– Designed and implemented using object-oriented principlesDesigned and implemented using object-oriented principles
– C++ class library (~700+ classes; ~425,000 LOC; C++ class library (~700+ classes; ~425,000 LOC; <225,000 executable lines)<225,000 executable lines)
– Focused on scientific visualization, some support for Focused on scientific visualization, some support for higher-dimensional visualizationhigher-dimensional visualization
– Open-source (BSD-style, not GPL)Open-source (BSD-style, not GPL)
– www.vtk.orgwww.vtk.org
A visualization A visualization toolkittoolkit– Designed and implemented using object-oriented principlesDesigned and implemented using object-oriented principles
– C++ class library (~700+ classes; ~425,000 LOC; C++ class library (~700+ classes; ~425,000 LOC; <225,000 executable lines)<225,000 executable lines)
– Focused on scientific visualization, some support for Focused on scientific visualization, some support for higher-dimensional visualizationhigher-dimensional visualization
– Open-source (BSD-style, not GPL)Open-source (BSD-style, not GPL)
– www.vtk.orgwww.vtk.org
VTK Is A Toolkit, Not a VTK Is A Toolkit, Not a SystemSystem• EmbeddableEmbeddable
– Plays with other softwarePlays with other software
• SeparableSeparable– Can pull out “pieces”Can pull out “pieces”
• AdaptableAdaptable– Not dependent on GUINot dependent on GUI
• X, Motif, Windows, Mac, Qt, FLTK, Tk, wxWindows, etc.
– Not dependent on rendering libraryNot dependent on rendering library• OpenGL, others
HistoryHistory
• Precursor: GE Legacy System LYMB (circa 1983)Precursor: GE Legacy System LYMB (circa 1983)
• Proprietary software issues led to Proprietary software issues led to open-source VTK project to create:open-source VTK project to create:– TextbookTextbook– Sample codeSample code
• December ‘93 work begins on VTK December ‘93 work begins on VTK text/softwaretext/software
• June 1998 Kitware forms: June 1998 Kitware forms: VTK Commercial SupportVTK Commercial Support
Things It DoesThings It Does
More Things: Image-More Things: Image-ProcessingProcessing
vtkActorvtkActor *sphereActor = vtkActor::New(); *sphereActor = vtkActor::New(); sphereActorsphereActorSetMapper(sphereMapper); SetMapper(sphereMapper); // mapper connects the actor with // mapper connects the actor with
The VTK Graphics The VTK Graphics SubsystemSubsystemA VTK A VTK scenescene consists of: consists of:• vtkRenderWindow - contains the final imagevtkRenderWindow - contains the final image• vtkRenderer - draws into the render windowvtkRenderer - draws into the render window• vtkActor - combines properties / geometryvtkActor - combines properties / geometry
– vtkProp, vtkProp3D are superclasses vtkProp, vtkProp3D are superclasses – vtkPropertyvtkProperty
– vtkPolyDataGeometry, vtkDataSetMapper are vtkPolyDataGeometry, vtkDataSetMapper are subclassessubclasses
• vtkTransform - position actorsvtkTransform - position actors
Graphics ModelGraphics Model
Instances of render window (vtkRenderWindow)
Actor instances(vtkActor)
Renderer instances(vtkRenderer)
Visualization PipelineVisualization Pipeline
• Data objectsData objects
• Process objectsProcess objects
• PipelinesPipelines
• Managing executionManaging execution
The Visualization PipelineThe Visualization Pipeline
A sequence of A sequence of process objectsprocess objects that operate on that operate on data data objectsobjects to generate geometry that can be rendered to generate geometry that can be rendered by the graphics engine or written to a fileby the graphics engine or written to a file
Data
Filter
Data to graphicssystem
Data
Data Filter Actor
ActorMapper
Mapper
Source
Visualization ModelVisualization Model
• Data ObjectsData Objects– represent datarepresent data– provide access to dataprovide access to data– compute information particular to datacompute information particular to data
• Process ObjectsProcess Objects– Ingest, transform, and output data objectsIngest, transform, and output data objects– represent visualization algorithmsrepresent visualization algorithms
vtkDataObject / vtkDataObject / vtkDataSetvtkDataSet• vtkDataObject represents a “blob” of datavtkDataObject represents a “blob” of data
– contain instance of vtkFieldDatacontain instance of vtkFieldData– an array of arraysan array of arrays– no geometric/topological structureno geometric/topological structure– Superclass of all VTK data objectsSuperclass of all VTK data objects
• vtkDataSet has geometric/topological structurevtkDataSet 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) Has associated “attribute data” (e.g., scalars, vectors)
as well as field dataas well as field data– Convert data object to data set with Convert data object to data set with
• A dataset is a data object with structureA dataset is a data object with structure
• Structure consists ofStructure consists of– points (x-y-z coordinates)points (x-y-z coordinates)– cells (e.g., polygons, lines, voxels) that are defined cells (e.g., polygons, lines, voxels) that are defined
by connectivity list referring to points idsby connectivity list referring to points ids– Access is via integer IDAccess is via integer ID– implicit representationsimplicit representations– explicit representationsexplicit representations
Cell
Points
vtkDataSet SubclassesvtkDataSet Subclasses
vtkPolyData
vtkImageData
vtkStructuredGrid
vtkUnstructuredGrid
vtkRectilinearGrid
Data Set AttributesData Set Attributes
• vtkDataSet also has point and cell vtkDataSet also has point and cell attribute data:attribute data:– ScalarsScalars – (multi-component) – (multi-component)– VectorsVectors - 3-vector - 3-vector – TensorsTensors - 3x3 symmetric matrix - 3x3 symmetric matrix– NormalsNormals - unit vector - unit vector– Texture CoordinatesTexture Coordinates 1-3D 1-3D– Array of arrays (I.e. FieldData)Array of arrays (I.e. FieldData)
Scalars (An Aside)Scalars (An Aside)
• Scalars are represented by a vtkDataArray Scalars are represented by a vtkDataArray • Scalars are typically single valuedScalars are typically single valued• Scalars can also represent colorScalars can also represent color
– I (intensity)I (intensity)– IA (intensity-alpha: IA (intensity-alpha: alpha is opacity)alpha is opacity)– RGB (red-green-blue)RGB (red-green-blue)– RGBA (RGB + alpha)RGBA (RGB + alpha)
• Scalars can be used to generate colorsScalars can be used to generate colors– mapped through lookup tablemapped through lookup table– if unsigned char if unsigned char direct color specification direct color specification
Process ObjectsProcess Objects
Source
Mapper
Filter1 or more outputs
1 or more outputs
1 or more inputs
1 or more inputs
• Process objects operate on data Process objects operate on data objectsobjects
• The Role of Type-CheckingThe Role of Type-Checking– SetInput() accepts dataset type or subclassSetInput() accepts dataset type or subclass– C++ compile-time checkingC++ compile-time checking– Interpreter run-time checkingInterpreter run-time checking
• Decimation, smoothing, normalsDecimation, smoothing, normals• Implemented in C++Implemented in C++
Example PipelineExample Pipeline
vtkSmoothPolyDataFilter
vtkDecimatePro
vtkBYUReader
vtkPolyDataNormals
vtkPolyDataMapper
Note: data objects are notshown they are impliedfrom the output type of thefilter
• ScalableScalable– Petabyte example on 2048 LANL machine (Petabyte example on 2048 LANL machine (Martin et al. Martin et al.
IEEE CG&A July 2001IEEE CG&A July 2001))(A petabyte is (A petabyte is 2 to the 50th power 2 to the 50th power (1,125,899,906,842,624) bytes. A petabyte is equal to (1,125,899,906,842,624) bytes. A petabyte is equal to 1,024 terabytes.1,024 terabytes. ) )
ExamplesExamples
• Modeling turbulence (Ken Jansen Modeling turbulence (Ken Jansen Rensselaer)Rensselaer)– 8.5 million tetrahedra (per time step)8.5 million tetrahedra (per time step)– 150 million tetrahedra (soon)150 million tetrahedra (soon)
Large Data ManagementLarge Data Management
• Visible Woman CT DataVisible Woman CT Data 870 MBytes 1734 Slices at 512x512x2870 MBytes 1734 Slices at 512x512x2
• Visible Woman CT DataVisible Woman CT Data 870 MBytes 1734 Slices at 512x512x2870 MBytes 1734 Slices at 512x512x2
• Bell-Boeing V-2 2 tiltrotor 140 Gbytes
• Bell-Boeing V-2 2 tiltrotor 140 Gbytes
Streaming PipelineStreaming Pipeline• Basic idea: handle any size data on any size Basic idea: handle any size data on any size
computercomputer
• Data is broken into pieces, and pieces processed Data is broken into pieces, and pieces processed one at a time through pipelineone at a time through pipeline– Piece size based on memory limitsPiece size based on memory limits– Can avoid system swapCan avoid system swap– Supports parallel processingSupports parallel processing– IssuesIssues
• How to create pieces• Mapping output from input• Results invariance
on PC)on PC)• Button 3 – zoomButton 3 – zoom• Keypress e or q – exitKeypress e or q – exit• Keypress f – “fly-to” point under mouseKeypress f – “fly-to” point under mouse• Keypress s/w – surface/wireframeKeypress s/w – surface/wireframe• Keypress p – pickKeypress p – pick• Keypress r – reset cameraKeypress r – reset camera• Keypress 3 – toggle stereoKeypress 3 – toggle stereo
Switch styles: Keypress j – joystick; t - trackball style
PickingPicking
• vtkPropPicker - hardware-assisted picking of vtkPropsvtkPropPicker - hardware-assisted picking of vtkProps
• vtkPicker - pick based on prop3D’s bounding box vtkPicker - pick based on prop3D’s bounding box (software ray cast)(software ray cast)
• vtkPointPicker - pick points (closest point to camera vtkPointPicker - pick points (closest point to camera within tolerance - software ray cast)within tolerance - software ray cast)
• vtkCellPicker - pick cells (software ray cast)vtkCellPicker - pick cells (software ray cast)
• vtkWorldPointPicker - get x-y-z coordinate; does not vtkWorldPointPicker - get x-y-z coordinate; does not pick prop (hardware assisted)pick prop (hardware assisted)
Example: Picking and Example: Picking and StyleStylevtkRenderWindowInteractor *iren = vtkRenderWindowInteractor *iren =
(Note: defaults are automatically created, you (Note: defaults are automatically created, you rarely ever need to do this)rarely ever need to do this)
Command / Observer Command / Observer CallbacksCallbacks• Observers Observers observeobserve events on a particular VTK events on a particular VTK
instanceinstance– Use AddObserver() to watch for eventsUse AddObserver() to watch for events– The observer is implicit; you actually add the commandThe observer is implicit; you actually add the command
• When an observer sees the event it is interested When an observer sees the event it is interested in, it invokes a in, it invokes a commandcommand via the command’s via the command’s Execute() methodExecute() 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->InvokeEvent(vtkCommand::ProgressEvent,NULL);This->InvokeEvent(vtkCommand::ProgressEvent,NULL);
• Subclass of vtkInteractorObserverSubclass of vtkInteractorObserver– Interactor observers watches events Interactor observers watches events
invoked on vtkRenderWindowInteractorinvoked on vtkRenderWindowInteractor– Events are caught and acted onEvents are caught and acted on– Events can be prioritized and orderedEvents can be prioritized and ordered– The handling of a particular event can be The handling of a particular event can be
• The Quality DashboardThe Quality Dashboard– Managing open-source developmentManaging open-source development– The importance of feedbackThe importance of feedback