[vtkusers] Disable mouse interaction on overlaid image

David Gobbi david.gobbi at gmail.com
Wed Apr 13 19:08:10 EDT 2016


Hi Jothy,

I've added a change so that SetCurrentImageToNthImage is public:
https://gitlab.kitware.com/vtk/vtk/merge_requests/1421/diffs

If you're not sure about how to get the changes with git, then you can
download the files here:
https://gitlab.kitware.com/vtk/vtk/raw/81d49118/Interaction/Style/vtkInteractorStyleImage.h
https://gitlab.kitware.com/vtk/vtk/raw/81d49118/Interaction/Style/vtkInteractorStyleImage.cxx

Please test to see if this solves the issue.

 - David




On Tue, Apr 12, 2016 at 6:18 PM, Jothybasu Selvaraj <jothybasu at gmail.com>
wrote:

> I would rather like to have this SetCurrentImageToNthImage to be public
> and user definable.
>
>
> Jothy
>
> On Wed, Apr 13, 2016 at 10:15 AM, Jothybasu Selvaraj <jothybasu at gmail.com>
> wrote:
>
>> Hi David
>>
>> I am not familiar with using Gitlab. So, I subclassed
>> vtkInteractorStyleImage and override SetCurrentImageToNthImage().
>>
>> Still it didn't work, because the layer number is hardcoded into StartWindowLevel()
>> with this->SetCurrentImageToNthImage(-1); So the mouse only interacts with
>> the last image. I changed it to "0" so that it pick the first image.
>>
>> It solves my problem. I only want to interact with the first image :).
>>
>>
>> Thank a lot for your inputs.
>>
>>
>> Cheers
>>
>> Jothy
>>
>> On Wed, Apr 13, 2016 at 8:42 AM, David Gobbi <david.gobbi at gmail.com>
>> wrote:
>>
>>> Hi Jothy,
>>>
>>> Can you try the code change in the following merge request to
>>> see if it fixes the problem?
>>>
>>> https://gitlab.kitware.com/vtk/vtk/merge_requests/1421
>>>
>>>  - David
>>>
>>>
>>> On Tue, Apr 12, 2016 at 4:05 PM, Jothybasu Selvaraj <jothybasu at gmail.com
>>> > wrote:
>>>
>>>> Yes, I use vtkInteractorStyleImage.
>>>>
>>>> Cheers
>>>>
>>>> Jothy
>>>>
>>>> On Tue, Apr 12, 2016 at 10:16 PM, David Gobbi <david.gobbi at gmail.com>
>>>> wrote:
>>>>
>>>>> Hi Jothy,
>>>>>
>>>>> Are you using vtkInteractionStyleImage?  I checked the code, and it
>>>>> doesn't
>>>>> seem to check the pickability of the image.  Specifically, I mean the
>>>>> code in
>>>>> SetCurrentImageToNthImage(), which is called by StartWindowLevel().
>>>>>
>>>>>  - David
>>>>>
>>>>> On Tue, Apr 12, 2016 at 12:44 AM, Jothybasu Selvaraj <
>>>>> jothybasu at gmail.com> wrote:
>>>>>
>>>>>> Dear All
>>>>>>
>>>>>> I an image overlaid on another image. I only want mouse interaction
>>>>>> such as window level change on only one image. How do I do that?
>>>>>>
>>>>>> I tried pickable off,on the second image but it doesn't work.
>>>>>>
>>>>>> Any help is highly appreciated!
>>>>>>
>>>>>>
>>>>>> Regards
>>>>>>
>>>>>> Jothy
>>>>>>
>>>>>
>>>>>
>>>>
>>>
>>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://public.kitware.com/pipermail/vtkusers/attachments/20160413/300a9b92/attachment.html>


More information about the vtkusers mailing list