This post was updated on .
Hello,
may I ask if there is a simple way how to add new icons in IJ toolbar and associate an action to each of them. The idea behind is simple, just have an overlap segmentation and set of icons/numbers {0,20,40,60,80,100} in the toolbar. After each click the transparency of segmentation is changed. I went throw IJ api but I have not found anything suitable. Does anyone an advice? Thanks, Jirka -- Best regards, Jiri Borovec ---------------------------------------------------------------------------------------------------- Jiří Borovec <jiri.borovec@fel.cvut.cz> PhD student at CMP CTU, ISC member http://cmp.felk.cvut.cz/~borovji3 -- ImageJ mailing list: http://imagej.nih.gov/ij/list.html |
Hi Jiří,
On Tue, 18 Feb 2014, Jiří Borovec wrote: > may I ask if there is a simple way how to add new icons in IJ toolbar and > associate an action to each of them. The idea behind is simple, just have > an overlap segmentation and set of icons/numbers {0,20,40,60,80,100} in the > toolbar. After each click the transparency of segmentation is changed. I > went throw IJ api but I have not found anything suitable. Does anyone an > advice? There are three ways to do so: 1) use a macro (this used to be the old way, and for full backwards-compatibility you might need to do it that way because some users are stuck with older ImageJ 1.x versions due to some plugins no longer working): http://imagej.nih.gov/ij/developer/macro/macros.html#tools 2) implement a PlugInTool (added in 1.46d): http://jenkins.imagej.net/job/ImageJ1-javadoc/javadoc/ij/plugin/tool/PlugInTool.html 3) use Fiji's AbstractTool infrastructure (which inspired Wayne to add the slightly more limited PlugInTool infrastructure): http://jenkins.imagej.net/view/Fiji/job/Fiji-javadoc/javadoc/fiji/tool/AbstractTool.html Unfortunately, I still did not find time to document this better, so the source code may serve as a starting point: https://github.com/fiji/fiji/blob/master/src-plugins/fiji-lib/src/main/java/fiji/tool/AbstractTool.java The idea is that you define what your tool wants to override by implementing one or more of the following interfaces (in addition to extending AbstractTool): MouseListener, MouseMotionListener, MouseWheelListener, KeyListener, SliceListener, ToolWithOptions, ToolToggleListener. Examples for the different methods: 1) https://github.com/fiji/fiji/blob/master/src-plugins/VIB_/src/main/java/ROIBrush_.java#L17 2) http://imagej.nih.gov/ij/plugins/download/Example_Tool.java 3) https://github.com/fiji/fiji/blob/master/src-plugins/Script_Editor/src/main/resources/templates/Java/Bare_Tool.java Ciao, Dscho -- ImageJ mailing list: http://imagej.nih.gov/ij/list.html |
In reply to this post by Jirka
Jirka,
isn't that described in the "ImageJ Macro Language Programmer’s Reference Guide" authored by Jérôme Mutterer and Wayne Rasband. It is downloadable from the IJ website and accessible via: <http://rsb.info.nih.gov/ij/developer/macro/macros.html> HTH Herbie ::::::::::::::::::::::::::::::::::::: On 18.02.14 18:50, Jiří Borovec wrote: > Hello, > may I ask if there is a simple way how to add new icons in IJ toolbar and > associate an action to each of them. The idea behind is simple, just have > an overlap segmentation and set of icons/numbers {0,20,40,60,80,100} in the > toolbar. After each click the transparency of segmentation is changed. I > went throw IJ api but I have not found anything suitable. Does anyone an > advice? > > Thanks, Jirka > -- > Best regards, Jiri Borovec > ---------------------------------------------------------------------------------------------------- > Ing. Jiri Borovec, MSc <[hidden email]> > PhD student at CMP CTU, member ISC | tel.: +420 2 2435 7590 > http://cmp.felk.cvut.cz/~borovji3 | mob.: +420 728 480 285 > > -- > ImageJ mailing list: http://imagej.nih.gov/ij/list.html > -- ImageJ mailing list: http://imagej.nih.gov/ij/list.html |
In reply to this post by Jirka
Hi Jirka,
On Wed, 19 Feb 2014, Jiří Borovec wrote: > Thanks very much for your help. You are welcome. Thank you for your contributions! > Moreover may I ask you for an advice. From my point of view fiji and > imagej mail lists are independent even many people are signed in both of > them. So when I have question (like that one above) which is related to > both of them ImageJ/Fiji, should I ask in both mail lists or just one? > And if just one, which one? From my point of view, fiji-devel is really a mailing list intended to discuss Fiji development. With more and more plugins being developed in their own repositories, that means less and less reason to discuss things there. Historically, there was the concern that too many too technical details would be discussed on the ImageJ mailing list (and would scare users), but that never was the case. Also, it often turned out that a Fiji issue was actually an ImageJ issue (which is unsurprising given that Fiji Is Just ImageJ) and things were discussed on the wrong mailing list, or even independently on both mailing lists, confusing everyone. That is why there was an almost unanimous vote for closing the fiji-users mailing list a couple of years ago. Even more: on the ImageJ mailing list, most of the things discussed on the ImageJ mailing list are not directly involved with the development of the core of ImageJ, such as the quantification of fluorophores in an image, implementation details of colocalisation algorithms, choice of Java versions, etc. I would not hesitate, for that reason, to discuss things much more closely related to ImageJ on that list, even if they might use parts of some Fiji plugins/libraries. And finally, the policy to strip out each and every Cc:ed party from posts to the ImageJ mailing list makes it undesirable to cross-post to both the ImageJ and Fiji-devel mailing list. Therefore, I suggest going with the ImageJ mailing list by default, except in cases where you can think of a good reason not to. Ciao, Johannes -- ImageJ mailing list: http://imagej.nih.gov/ij/list.html |
Free forum by Nabble | Edit this page |