how to add shortcuts in a plugin

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

how to add shortcuts in a plugin

Dita Vizoso
Hi there,


I would like to be able to change the attributes of a plugin directly from
the keyboard, so I would like to be able to add the command for using the
particular keys within the plugin code.  Have searched in the plugin
reference literature but found no such thing.  It may well be that it is
there and I didn't find it (my Java skills are extremely limited) or it is
just not possible.

My particular problem is that I use the (excellent) plugin Microscope Scale
in order to measure areas in series of pictures taking from single
specimens.  The different structures are pictured at different scales, so I
have to change the scale via clicking (I already have a shortcut for the
plugin).  It adds up annoyingly, as we work through hundreds of stacks...

I've patched the problem by creating one plugin for each scale, but this
makes changing the set of scales (we work with different microscopes)
cumbersome, so I was wondering if there was a more elegant way of solving
the problem.


Thanks a million in advance,
Dita
--
---------------------------------------------------------------
Dita B. Vizoso

Zoologisches Institut der Universität Basel
Evolutionsbiologie
Vesalgasse 1
CH-4051 Basel
Switzerland

tel:++41 61 267 0376
fax:++41 61 267 0362

mailto:[hidden email]
http://evolution.unibas.ch/people/dita/

I'm worried about the state of our oceans.  Are you?
http://evolution.unibas.ch/people/dita/fish/fish.html

the Blue is back...!
http://evolution.unibas.ch/people/dita/the_blue/welcome.html
---------------------------------------------------------------
The greatest obstacle to discovery is not ignorance:
it is the illusion of knowledge.
                                -- Daniel  Boorstin
---------------------------------------------------------------
Reply | Threaded
Open this post in threaded view
|

Re: how to add shortcuts in a plugin

Gabriel Landini
On Wednesday 11 August 2010, you wrote:
> I've patched the problem by creating one plugin for each scale, but this
> makes changing the set of scales (we work with different microscopes)
> cumbersome, so I was wondering if there was a more elegant way of solving
> the problem.

Rather, why not use a single plugin that lets you choose the varous
magnifications.
Then record each of your magnifications in a separate macro (use the Macro
Recorder).
Then assign those macros to the keys you want.

I think, however that this is a recipe for disaster because it is likely that
you will forget to change the magnification in some image or use the incorrect
ones.

Instead I would spatially calibrate the images. If saved as tiff they will
retain the calibration.


Cheers,
G.
Reply | Threaded
Open this post in threaded view
|

Re: how to add shortcuts in a plugin

Dita Vizoso
Thanks, Gabriel - I have done something pretty much like that, it works
(sort of) well.

Would like to find a more elegant solution that incorporates the keywords
in the plugin.  Is it at all possible?

Dita


>Rather, why not use a single plugin that lets you choose the varous
>magnifications.
>Then record each of your magnifications in a separate macro (use the Macro
>Recorder).
>Then assign those macros to the keys you want.
>
>I think, however that this is a recipe for disaster because it is likely that
>you will forget to change the magnification in some image or use the incorrect
>ones.
>
>Instead I would spatially calibrate the images. If saved as tiff they will
>retain the calibration.
>
>
>Cheers,
>G.
Reply | Threaded
Open this post in threaded view
|

Re: how to add shortcuts in a plugin

Gabriel Landini
On Wednesday 11 August 2010 17:38:48 you wrote:
> Would like to find a more elegant solution that incorporates the keywords
> in the plugin.  Is it at all possible?

It might be possible, but perhaps it would be easier to use the Action Bar
plugin:

http://imagejdocu.tudor.lu/doku.php?id=plugin:utilities:action_bar:start

and assign a different magnification (as I suggested earlier) so each button
runs a macro setting the Microscope_Scale plugin choice.
So each button in the Action Bar will call the same Microscope_Scale plugin
but with a different magnification and set it to the current image.

Cheers
Gabriel
Reply | Threaded
Open this post in threaded view
|

Re: how to add shortcuts in a plugin

Dita Vizoso
>It might be possible, but perhaps it would be easier to use the Action Bar
>plugin:
>
>http://imagejdocu.tudor.lu/doku.php?id=plugin:utilities:action_bar:start
>
>and assign a different magnification (as I suggested earlier) so each button
>runs a macro setting the Microscope_Scale plugin choice.
>So each button in the Action Bar will call the same Microscope_Scale plugin
>but with a different magnification and set it to the current image.

I'll give it a try (the plugin looks quite nice anyway!).  Along the same
lines of my question, can one then add a keyboard shortcut to the buttons
directly?  We use several computers and it is best if all the keyboard
shortcuts could be set in one file.

Thanks!
Dita