[vtkusers] VtkImageViewer2 disabling window level

Leonardo M. Ramé l.rame at griensu.com
Tue Oct 19 12:00:07 EDT 2010


On 2010-10-19 12:19:03 -0300, Leonardo M. Ramé wrote:
> Hi, I'm creating an image viewer based on VTKImageViewer2, and I want to
> create a Toolbox where the user picks an option, like "circle" or "box",
> then drag that to the image to show it.
> 
> My problem is, whenever the user drags anything to the viewer, it does
> Window/Level. How can I disable WindowLevel?
> 

Thanks for your answers, I created this vtkInteractorStyle subclassing
from vtkInteractorStyleImage.

Before going further, I only want to show a message when the user press
the left mouse button, but continue with the default interaction style
(i.e.: window leveling).

class DCMInteractorStyle : public vtkInteractorStyleImage
{
  public:
    static DCMInteractorStyle* New();
    vtkTypeMacro(DCMInteractorStyle, vtkInteractorStyleImage);

    virtual void OnLeftButtonDown()
    {
      std::cout << "Pressed left mouse button." << std::endl;
      // Forward events
      vtkInteractorStyleImage::OnLeftButtonDown();
    }
};

vtkStandardNewMacro(DCMInteractorStyle);

Aparently, the line vtkInteractorStyleImage::OnLeftButtonDown(); is not
called. What am I doing wrong?.

-- 
Leonardo M. Ramé
http://leonardorame.blogspot.com



More information about the vtkusers mailing list