Hi all,
After extending Fiji with several action bars, I figures out, that some functions called via the action bar behave different compared to a call of the same command from the menu. 1.) pressing the cancel button in the called function window (e.g. a median image filter) results in the display of an "exception" message as follows. Can this be avoided somehow? java.lang.reflect.InvocationTargetException at sun.reflect.GeneratedMethodAccessor8.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:597) at ij.Command.runPlugIn(Command.java:146) at ij.Command.runCommand(Command.java:95) at ij.Executer.run(Executer.java:64) at ij.IJ.run(IJ.java:250) at ij.IJ.run(IJ.java:228) at ij.macro.Functions.doRun(Functions.java:582) at ij.macro.Functions.doFunction(Functions.java:83) at ij.macro.Interpreter.doStatement(Interpreter.java:219) at ij.macro.Interpreter.doStatements(Interpreter.java:207) at ij.macro.Interpreter.run(Interpreter.java:104) at ij.macro.Interpreter.run(Interpreter.java:74) at ij.macro.MacroRunner.run(MacroRunner.java:130) at java.lang.Thread.run(Thread.java:662) Caused by: java.lang.RuntimeException: Macro canceled at ij.Macro.abort(Macro.java:76) at ij.gui.GenericDialog.wasCanceled(GenericDialog.java:722) at ij.plugin.filter.RankFilters.showDialog(RankFilters.java:122) at ij.plugin.filter.PlugInFilterRunner.<init>(PlugInFilterRunner.java:60) at ij.IJ.runPlugIn(IJ.java:159) ... 16 more 2.) whenever the preview was activated, the cancel button does not revert the applied function (the median filter remains applied to the image. This is generally not a big deal, because you could use the undo function. But for some un-doable functions it implies starting from the beginning. Is there a possibility to include a specific line of code to circumvent this issue i.e. make the function working as if called from the menu? Thanks in advance for any answers and I wish you a merry x-mas and a good start in the new year. cheers, Jan -- ImageJ mailing list: http://imagej.nih.gov/ij/list.html |
Hi Jan,
which version of ImageJ are you using? There was a bug until 1.47a causing problems with preview, it should be fixed in the current version (Help>Update ImageJ). If the problem persists with the current version, let me know, please. I can't say anything about the ActionBar problem. In your action_bar configuration file, what does the section calling the command look like? Michael ________________________________________________________________ On Dec 20, 2012, at 12:53, Jan Brocher wrote: > Hi all, > > After extending Fiji with several action bars, I figures out, that some functions called via the action bar behave different compared to a call of the same command from the menu. > > 1.) pressing the cancel button in the called function window (e.g. a median image filter) results in the display of an "exception" message as follows. Can this be avoided somehow? > > java.lang.reflect.InvocationTargetException > at sun.reflect.GeneratedMethodAccessor8.invoke(Unknown Source) > at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) > at java.lang.reflect.Method.invoke(Method.java:597) > at ij.Command.runPlugIn(Command.java:146) > at ij.Command.runCommand(Command.java:95) > at ij.Executer.run(Executer.java:64) > at ij.IJ.run(IJ.java:250) > at ij.IJ.run(IJ.java:228) > at ij.macro.Functions.doRun(Functions.java:582) > at ij.macro.Functions.doFunction(Functions.java:83) > at ij.macro.Interpreter.doStatement(Interpreter.java:219) > at ij.macro.Interpreter.doStatements(Interpreter.java:207) > at ij.macro.Interpreter.run(Interpreter.java:104) > at ij.macro.Interpreter.run(Interpreter.java:74) > at ij.macro.MacroRunner.run(MacroRunner.java:130) > at java.lang.Thread.run(Thread.java:662) > Caused by: java.lang.RuntimeException: Macro canceled > at ij.Macro.abort(Macro.java:76) > at ij.gui.GenericDialog.wasCanceled(GenericDialog.java:722) > at ij.plugin.filter.RankFilters.showDialog(RankFilters.java:122) > at ij.plugin.filter.PlugInFilterRunner.<init>(PlugInFilterRunner.java:60) > at ij.IJ.runPlugIn(IJ.java:159) > ... 16 more > > 2.) whenever the preview was activated, the cancel button does not revert the applied function (the median filter remains applied to the image. This is generally not a big deal, because you could use the undo function. But for some un-doable functions it implies starting from the beginning. Is there a possibility to include a specific line of code to circumvent this issue i.e. make the function working as if called from the menu? > > Thanks in advance for any answers and I wish you a merry x-mas and a good start in the new year. > cheers, > Jan -- ImageJ mailing list: http://imagej.nih.gov/ij/list.html |
In reply to this post by gankaku
Hi Michael,
Thanks for the fast reply! I have the newest version of Fiji, so ImageJ 1.47g (not the current daily built). The section in the action bar file calling the command is for example: <button> label=Median bgcolor=#dadada icon=noicon arg=<macro> run("Median..."); </macro> if this is the part you were referring to (?) So, all the buttons principally only execute a normal macro command (i.e. run("........"); ). That should actually have the same effect as running the command in a normal macro or clicking the menu command, isn't it? -- ImageJ mailing list: http://imagej.nih.gov/ij/list.html |
Free forum by Nabble | Edit this page |