[vtkusers] Problem with cursoring in vtkImagePlaneWidget
David Gobbi
dgobbi at atamai.com
Wed Sep 13 16:32:40 EDT 2006
Hi Peter,
Right now I'm working on a class called "vtkImageOrthoPlanes" that
listens to events from three vtkImagePlaneWidgets in order to make it so
that when one plane is rotated, the other two planes are rotated by the
same amount. I think that I can modify my class so that it will also
automatically move the focus from one plane to the next when the cursor
is moved between the planes. I will try to do this, and if it works, I
can add the class to VTK cvs.
In general it is difficult to have a cursor-type action move from on
plane to another, because once you click on a widget, that widget will
keep the focus until you release the mouse button. You shouldn't have
to move the plane with the middle mouse button in order to select it,
though, clicking the plane with the left mouse button should do the job.
- David
Peter Kok wrote:
>
> Hi there,
>
>
>
> I have a problem when I try to use the cursor in the
> vtkImagePlaneWidget. I have three imagePlaneWidgets, with the
> orientation to the x, y and z-axis. When I want to use the cursor in
> one of the planes, the plane seems to need some kind of focus for the
> cursor to work as desired. That is, I first need to select a plane by
> moving it slightly using the middle mouse button. When I then use the
> cursor, it works well, but only on that plane. If a plane doesn't have
> the focus, the cursor doesn't work, the displayed text is "Off image"
> and the edge turns to green.
>
>
>
> The code I use to set up the image planes is not extremely exciting:
>
>
>
> planeWidgetX = vtkImagePlaneWidget::New();
>
> planeWidgetX->DisplayTextOn();
>
> planeWidgetX->SetInput(checkers->GetOutput());
>
> planeWidgetX->SetPlaneOrientationToXAxes();
>
> planeWidgetX->SetSliceIndex((wholeExtent[0] + wholeExtent[1]) / 2);
>
> planeWidgetX->SetPicker(cellPicker);
>
> planeWidgetX->SetKeyPressActivationValue('x');
>
> planeWidgetX->GetPlaneProperty()->SetColor(1, 0, 0);
>
> planeWidgetX->SetWindowLevel(256, 128);
>
> planeWidgetX->GetColorMap()->PassAlphaToOutputOff();
>
> planeWidgetX->SetInteractor(iren);
>
> planeWidgetX->On();
>
>
>
> With similar code for the y- and z-plane. Does anyone have an idea of
> what the problem (and preferably also the solution) might be?
>
>
>
> Thanks,
>
>
>
> -Peter
>
>
>
> ------------------------------------------------------------------------
>
> _______________________________________________
> This is the private VTK discussion list.
> Please keep messages on-topic. Check the FAQ at: http://www.vtk.org/Wiki/VTK_FAQ
> Follow this link to subscribe/unsubscribe:
> http://www.vtk.org/mailman/listinfo/vtkusers
>
More information about the vtkusers
mailing list