VTK 3D Widgets - PowerPoint PPT Presentation

1 / 38
About This Presentation
Title:

VTK 3D Widgets

Description:

Dr. Terry Yoo: A2D2 awards (Algorithms, Adaptors, and Data Distribution) National Science Foundation. Visual Journal project. NIH National Center for Biomedical ... – PowerPoint PPT presentation

Number of Views:497
Avg rating:3.0/5.0
Slides: 39
Provided by: karthikk8
Category:
Tags: vtk | widgets

less

Transcript and Presenter's Notes

Title: VTK 3D Widgets


1
VTK 3D Widgets
Karthik Krishnan Will Schroeder Kitware, Inc.
2
Thanks
  • National Library of Medicine / NIH
  • Dr. Terry Yoo A2D2 awards (Algorithms, Adaptors,
    and Data Distribution)
  • National Science Foundation
  • Visual Journal project
  • NIH National Center for Biomedical Computing
  • NAMIC
  • DOE National Labs
  • Sandia
  • Livermore
  • Contributors
  • Will Schroeder
  • Karthik Krishnan
  • Lisa Avila
  • Brad King
  • Sebastien Barre
  • Dave Cole

3
Goals
  • Directly interact with data
  • Provide complex, potentially 3D interaction
    techniques
  • Probing
  • Annotation
  • Measurements

4
Interactor styles
  • Everybody has their favorite way of interacting
    with Data.

User Events
RenderWindow
Interactor
Interactor Style
Events
Actions
vtkCamera
Render()
5
Object Relationships
vtkRenderWindowInteractor
vtkInteractorObserver
vtkInteractorStyle
vtkAbstractWidget
6
Interactor Styles (contd..)
7
Interactor styles (usage)
  • Set the interactor style on the Render Window
    Interactor
  • vtkInteractorStyleTrackballCamera style
  • vtkInteractorStyleTrackballCameraNew()
  • renderWindowInteractor -gt SetInteractorStyle(
    style )

8
  • VTK Widgets

9
VTK - Widgets
  • Widgets are simply Interactive Props
  • VTK currently has widgets to perform
  • Measurements
  • Annotation and Labeling
  • Segmentation
  • Registration
  • Data interaction
  • Scene parameter manipulation Light, camera, etc.
  • Probing underlying data
  • Timer support
  • Multiple geometrical representations for the same
    widget
  • Reconfigurable key/mouse bindings
  • Grouping widgets

10
Visualization pipeline
11
Widgets are interactive props
vtkRenderWindow
vtkRenderWindowInteractor
User Interaction Events
Widget
Manipulate one or more props
vtkRenderer
Render()
Widget Representation
12
Widgets Design goals
  • Separate representation from event processing
  • Support distributed processing (client-server)
  • Reconfigurable bindings
  • Support hierarchical use of widgets
  • Grouping widgets
  • Timer, Hover support

13
Widgets Architecture
Behavior
Geometry
RenderWindow
Renderer
Events
Render()
vtkAbstractWidget
vtkWidgetRepresentation(type of vtkProp)
14
One widget, multiple geometries
Behavior
Geometry
vtkPointHandleRepresentation2D
vtkHandleWidget
vtkPointHandleRepresentation3D
vtkSphereHandleRepresentation
vtkPolygonalHandleRepresentation
15
Configurable bindings Event Translation
16
Event Translation
  • Re-configurable keyboard/mouse bindings
  • Example
  • vtkWidgetEventTranslator eventTranslator
    widget-gtGetEventTranslator()
  • eventTranslator-gtSetTranslation(
  • vtkCommandMiddleButtonPressEvent,
  • vtkWidgetEventSelect )
  • eventTranslator-gtSetTranslation(
  • vtkCommandMiddleButtonReleaseEvent,
  • vtkWidgetEventEndSelect )

17
Widget Assemblies
  • Create composite widgets from several individual
    widgets
  • Children listen to events from Parent. Hence
    parent can alter behavior of child

RenderWindow
Events
Parent
Events
Events
Child
Child
18
Widget Assemblies
  • Code reuse
  • Component framework
  • Change behaviour / geometry of Line widget by
    changing the handle widgets.

Line Widget
HandleWidget
HandleWidget
19
Timer support
  • Widgets may respond to timers
  • Hover widget
  • Balloon widget
  • Timer based hover annotations, Popups (text,
    thumbnails etc).

20
Handle Framework
  • Handles are often fundamental building blocks of
    other widgets
  • vtkLineWidget2
  • vtkDistanceWidget
  • vtkAngleWidget
  • vtkBiDimensionalWidget
  • vtkSeedWidget
  • vtkParallelopipedWidget
  • Need multiple representations for handles
  • Need a framework for constraints on handles
  • To plane
  • To surface
  • To a terrain
  • To a region.

21
Various handle representations (geometries)
vtkPointHandleRepresentation2D
vtkHandleWidget
vtkPointHandleRepresentation3D
vtkSphereHandleRepresentation
vtkPolygonalHandleRepresentation
22
Constraints Point Placers
  • To map 2D display positions to 3D world
    coordinates. Does a 2D display position map to
  • Focal Plane ?
  • Point on a surface ?
  • Point on a plane / image ?
  • Out of bounds ?
  • Allows a variety of constraints to be placed the
    placement of widgets.

23
Widgets
  • Handles

24
Widgets (cont.)
  • vtkSliderWidget
  • 2D
  • 3D
  • vtkBorderWidget
  • Widgets with rectangular borders
  • vtkTextWidget
  • Position size text

25
Widgets (cont.)
  • BalloonWidget
  • Text and/or image in rectangular popup

26
Widgets (cont.)
  • vtkCameraWidget
  • Keyframe playback camera
  • vtkCaptionWidget
  • Text with leader

27
Widgets (cont.)
  • vtkCheckerboardWidget
  • Interleave two images
  • vtkRectilinearWipeWidget
  • Window pane(2x2 checkerboard)with movable focus

28
Widgets (cont.)
  • vtkContourWidget
  • 2D (on plane)
  • 3D (move contours through slices in a volume)

29
Widgets (cont.)
  • vtkDistanceWidget
  • Measure distance between points
  • vtkAngleWidget
  • Measure angles

30
Widgets (cont.)
  • vtkSeedWidget
  • Add one or more seeds / markers
  • vtkAffineWidget
  • Translate
  • Scale
  • Rotate
  • Shear images

31
Widgets (cont.)
  • vtkBiDimensionalWidget
  • Tumor response (RECIST vs WHO)

32
Widgets (cont.)
  • Box
  • Implicit Plane

33
Widgets (cont.)
  • Finite Plane
  • Line

34
Widgets (cont.)
  • vtkSphereWidget
  • vtkScalarBarWidget

35
Slider Widget Example
  • vtkSliderRepresentation2D sliderRep
    vtkSliderRepresentation2DNew()
  • sliderRep-gtSetValue(0.25)
  • sliderRep-gtSetTitleText("Spike Size")
  • sliderRep-gtGetPoint1Coordinate()-gtSetCoordinateS
    ystemToNormalizedDisplay()
  • sliderRep-gtGetPoint1Coordinate()-gtSetValue(0.2,0
    .15)
  • sliderRep-gtGetPoint2Coordinate()-gtSetCoordinateS
    ystemToNormalizedDisplay()
  • sliderRep-gtGetPoint2Coordinate()-gtSetValue(0.8,0
    .15)
  • sliderRep-gtSetSliderLength(0.02)
  • sliderRep-gtSetSliderWidth(0.03)
  • sliderRep-gtSetEndCapLength(0.01)
  • sliderRep-gtSetEndCapWidth(0.03)
  • sliderRep-gtSetTubeWidth(0.005)
  • vtkSliderWidget sliderWidget
    vtkSliderWidgetNew()
  • sliderWidget-gtSetInteractor(iren)
  • sliderWidget-gtSetRepresentation(sliderRep)
  • sliderWidget-gtSetAnimationModeToAnimate()
  • vtkSlider2DCallback callback
    vtkSlider2DCallbackNew()

36
Slider Widget Example (Cont.)
  • class vtkSlider2DCallback public vtkCommand
  • public
  • static vtkSlider2DCallback New()
  • return new vtkSlider2DCallback
  • virtual void Execute(vtkObject caller,
    unsigned long, void)
  • vtkSliderWidget sliderWidget
  • reinterpret_castltvtkSliderWidgetgt(caller)
  • this-gtGlyph-gtSetScaleFactor(static_castltvtkS
    liderRepresentation gt(sliderWidget-gtGetRepresenta
    tion())-gtGetValue())
  • vtkSlider2DCallback()Glyph(0)
  • vtkGlyph3D Glyph

37
vtkPointPlacer
38
Widget Sets
  • Grouping widgets on multiple render windows,
    relieving the application of the responsibility
    of doing so.

Event
RenderWindow
Widget
Event
Event
Event
RenderWindow
WidgetSet
Widget
Event
RenderWindow
Event
Widget
Write a Comment
User Comments (0)
About PowerShow.com