[vtkusers] (no subject)

Miguel Sotaquirá msotaquira at gmail.com
Sat Mar 10 12:22:41 EST 2012


Hi all,

I'm implementing a Qt-VTK application for visualizing a 3-D volume and
its corresponding x, y, z slice planes. This application is based on
QtVTKRenderWindows.cxx (Examples/GUI/Qt) of VTK's devel version.

In this application I have 4 QVTKWidget panels for visualizing the
three 2-D slices ("viewerX", "viewerY", "viewerZ") and the 3-D volume
("viewer3D"). What I'm trying to do now is to use vtkSeedWidget in
order to select a set of fiducial points from any of the 2-D
cut-planes. I've implemented a callback (based on
http://www.vtk.org/Wiki/VTK/Examples/Cxx/Widgets/vtkSeedWidget
example) and here's the snippet I'm using for placing widgets within
the "viewer3D" panel:

1 this->seedWidget = vtkSmartPointer<vtkSeedWidget>::New();
2 this->seedWidget->SetInteractor(this->ui->viewer3D->GetInteractor());
3 this->seedWidget->SetRepresentation(this->seedWidgetRepresentation);

4 this->seedWidgetCallback = vtkSmartPointer<vtkSeedCallback>::New();
5 this->seedWidgetCallback->SetWidget(this->seedWidget);

6 this->seedWidget->AddObserver(vtkCommand::PlacePointEvent,
this->seedWidgetCallback);
7 this->seedWidget->AddObserver(vtkCommand::InteractionEvent,
this->seedWidgetCallback);
8 this->seedWidget->On();

The problem I'm having is that seed placement worksonly when I set the
interactor (line 2 in previous snippet) to "viewer3D". Thus, I'm able
to place seed points only in the 3-D volume, but not in individual 2-D
slices. When changing this interactor to any of the other QVTKWidgets
(for example by setting
this->seedWidget->SetInteractor(this->ui->viewerX->GetInteractor()) I
get nothing,  is simply as if vtkSeedWidget wouln't be there.

How can I use vtkSeedWidget for placing seed points ONLY in the 2-D slices?

Thanks for any suggestions,

Miguel



More information about the vtkusers mailing list