[vtkusers] vtkImagePlaneWidget: how to update plane's orientation?

Miguel Sotaquirá msotaquira at gmail.com
Fri Mar 23 01:42:32 EDT 2012


Hi everybody!

I've implemented a four pane viewer using the example found
at Examples/GUI/Qt/FourPaneViewer/QtVTKRenderWindows.cxx. This viewer
allows me to explore a 3-D volume using a set of three vtkImagePlaneWidgets
that can be interactively placed (translated, rotated) by the user using
mouse events.

What I want to do now after user interaction is to take one of these planes
and rotate it 90 degrees along its normal, and update the four panes
accordingly. In order to do so I'm using this workflow:

- Define a vtkTransform (transform) and SetMatrix as vtkImagePlaneWidget's
current orientation:
    vtkSmartPointer<vtkTransform> transform
= vtkSmartPointer<vtkTransform>::New();
    transform->PreMultiply();
    transform->SetMatrix(planeWidget->GetResliceAxes());

- Apply 90 degrees rotation around Y axis:
    transform->RotateY(90);

- Update planeWidget using methods SetOrigin, SetPoint1, SetPoint2 and
UpdatePlacement, where origin, point1, point2 are extracted from "transform"

When using this approach I get strange results: neither planeWidget's
origin nor its extension are well defined, and I'm not able to update the
four panes accordingly. The origin is located outside the 3-D volume, and
the extension does not cover the entire volume.

Am I missing something? How to correctly update planeWidget's orientation?
Thanks for your help,

Miguel
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20120323/c798651d/attachment.htm>


More information about the vtkusers mailing list