Linking events in skimage.viewer

Tony Yu tsyu80 at gmail.com
Sun Dec 22 09:20:44 EST 2013


On Wed, Dec 18, 2013 at 5:36 AM, Nadav Horesh <nadavh.horesh at gmail.com>wrote:

> Thank you Juan. IIt looks like the event caught by the CanvasToolBase
> are not whtn I am looking for (mouse click and keyboard events)
>


Hi Nadav,

I'm not sure I follow. The canvas tools use matplotlib events because the
image canvas is drawn with matplotlib. The `CanvasToolBase` class shows an
example of using the tool's `connect_event` to connect to "key_press_event"
(keyboard events). The `LineTool` class shows an example connecting to
keyboard events through "button_press_event".

Note that this event system is only for the image canvas. If another widget
(e.g. a slider) has focus, then the events are handled by Qt's
infrastructure.

Cheers,
-Tony




>
> Thank you again,
>
>   Nadav
>
> 2013/12/18 Juan Nunez-Iglesias <jni.soma at gmail.com>:
> > Hi Nadav,
> >
> > I don't have much experience with interactive tools, but I think this is
> the
> > right place to start for examples:
> >
> https://github.com/scikit-image/scikit-image/blob/master/skimage/viewer/canvastools/linetool.py
> >
> > You'll see that the LineProfile plugin uses the LineTool canvas tool:
> >
> https://github.com/scikit-image/scikit-image/blob/master/skimage/viewer/plugins/lineprofile.py
> >
> > Hopefully this helps, otherwise @tonysyu might be able to step in and
> offer
> > a bit more guidance.
> >
> > Juan.
> >
> >
> >
> >
> > On Wed, Dec 18, 2013 at 7:13 PM, Nadav Horesh <nadavh.horesh at gmail.com>
> > wrote:
> >>
> >> I
> >> I started to build an interactive image exploration utility based on
> >> matplotlib.  Recently, following a link on this list, I encountered
> >> skimage.viewer, and found that the plugins architecture matches my
> needs.
> >> I could not find how to link keyboard and mouse events (and maybe
> buttons)
> >> to plugins. Any suggestions?
> >>
> >> I am using version 0.93 on linux (I can install the pre 0.10, if needed)
> >>
> >>  Thanks,
> >>
> >>     Nadav
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/scikit-image/attachments/20131222/e89c66eb/attachment.html>


More information about the scikit-image mailing list