From KitwarePublic
Jump to: navigation, search



3D widget for tracing on planar props.
vtkImageTracerWidget is different from other widgets in three distinct ways:
  • 1) any sub-class of vtkProp can be input rather than just vtkProp3D, so that vtkImageActor can be set as the prop and then traced over
  • 2) the widget fires pick events at the input prop to decide where to move its handles
  • 3) the widget has 2D glyphs for handles instead of 3D spheres as is done in other sub-classes of vtk3DWidget.
This widget is primarily designed for manually tracing over image data.

Classes Used

  • vtkImageTracerWidget
  • vtkImageTracerRepresentation
  • vtkImageTracerRepresentation3D

Class Diagram

3DWidgets class arch imagetracer.jpg

Using the widget (example code)

vtkImageTracerWidget * imageTracerWidget = vtkImageTracerWidget::New();
vtkImageTracerRepresentation * imageTracerRep = imageTracerWidget->GetRepresentation();

Basic event handling is automatically generated so no need to set up a callback/event translator unless you need to change the way the events are handled. In such a case use GetEventTranslator() which returns a pointer to the vtkWidgetEventTranslator in use. Thereafter, you can set event handling directly to this translator.

Anything affecting the widgets representation can be accessed using the imageTracerRep as shown above, such as PlaceWidget(double bounds[6]).

To set a representation other than the default vtkImageTracerRepresentation, instead of calling imageTracerWidget->GetRepresentation(), which instatiates the default representation if none exists, use SetRepresentation(vtkImageTracerRepresentation *r) to pass an instance of a representation inheriting from vtkImageTracerRepresentation.

KWWidgets: [Welcome | Site Map]