[vtkusers] How to override event bindings for vtkImageViewer2? (was Re: How to disable rotation)

kent williams nkwmailinglists at gmail.com
Mon Jun 22 14:06:08 EDT 2009


I was attempting to answer Tina Zhang's question, because I thought I
knew most of the answer; turns out the method I thought would work
dead-ends before it gets where she wants to go.

My first response was 'Oh, you just get a handle on the
InteractorStyle and configure it to suppress rotation!'

But it turns out, there are two problems with this idea.

1) The vtkInteractorStyleImage has no methods to e.g. suppress the
rotation action.
2) You could write your own class with vtkInteractorStyleImage and
redefine the event handlers, but ... there's no method to set the
InteractorStyle for vtkImageViewer2.  You can get it but you can't set
it!

I think I hit this dead end a year or so ago, and started using
vtkinria3d, because their analog to vtkImageViewer2 DOES let you
suppress and redefine the event bindings.

The fact of the matter is that despite all the things using
vtkImageViewer2 does to you, its stock configuration doesn't fit every
possible application, and it seems resistant to customization, so much
so that I think most people throw up their hands and either hack the
vtkImageViewer2 source code into their own custom class, or just give
up.

On Mon, Jun 22, 2009 at 12:08 PM, Tina Zhang<zhang.tina.t at gmail.com> wrote:
> Hi,
>
> I'm using ImageViewer2 to display dicom images; how would I disable rotation
> but keep zoom and pan?
>
> -Tina
>
> _______________________________________________
> Powered by www.kitware.com
>
> Visit other Kitware open-source projects at
> http://www.kitware.com/opensource/opensource.html
>
> Please keep messages on-topic and check the VTK 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