Hie!
On normal execution of 'Morphological Segmentation' plugin from 'MorphoLibJ' works fine but on execution via macro with exact same settings leads to the following two exception error windows: 1) Exception Error Window: (Fiji Is Just) ImageJ 2.0.0-rc-61/1.51p; Java 1.8.0_66 [64-bit]; Mac OS X 10.12.5; 62MB of 2854MB (2%) java.lang.reflect.InvocationTargetException at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:497) at ij.macro.Functions.call(Functions.java:4131) at ij.macro.Functions.getStringFunction(Functions.java:272) at ij.macro.Interpreter.getStringTerm(Interpreter.java:1307) at ij.macro.Interpreter.getString(Interpreter.java:1286) at ij.macro.Interpreter.doStatement(Interpreter.java:294) at ij.macro.Interpreter.doStatements(Interpreter.java:231) at ij.macro.Interpreter.run(Interpreter.java:115) at ij.macro.Interpreter.run(Interpreter.java:86) at ij.macro.Interpreter.run(Interpreter.java:97) at ij.plugin.Macro_Runner.runMacro(Macro_Runner.java:155) at ij.IJ.runMacro(IJ.java:134) at ij.IJ.runMacro(IJ.java:123) at net.imagej.legacy.IJ1Helper$3.call(IJ1Helper.java:1052) at net.imagej.legacy.IJ1Helper$3.call(IJ1Helper.java:1048) at net.imagej.legacy.IJ1Helper.runMacroFriendly(IJ1Helper.java:999) at net.imagej.legacy.IJ1Helper.runMacro(IJ1Helper.java:1048) at net.imagej.legacy.plugin.IJ1MacroEngine.eval(IJ1MacroEngine.java:136) at org.scijava.script.ScriptModule.run(ScriptModule.java:159) at org.scijava.module.ModuleRunner.run(ModuleRunner.java:167) at org.scijava.module.ModuleRunner.call(ModuleRunner.java:126) at org.scijava.module.ModuleRunner.call(ModuleRunner.java:65) at org.scijava.thread.DefaultThreadService$3.call(DefaultThreadService.java:237) at java.util.concurrent.FutureTask.run(FutureTask.java:266) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) at java.lang.Thread.run(Thread.java:745) Caused by: java.lang.NullPointerException at inra.ijpb.plugins.MorphologicalSegmentation$CustomWindow.getResultDisplayOption(MorphologicalSegmentation.java:1450) at inra.ijpb.plugins.MorphologicalSegmentation.createResultImage(MorphologicalSegmentation.java:1763) ... 30 more 2) Exception Error Window: (Fiji Is Just) ImageJ 2.0.0-rc-61/1.51p; Java 1.8.0_66 [64-bit]; Mac OS X 10.12.5; 61MB of 2854MB (2%) java.lang.reflect.InvocationTargetException at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:497) at ij.macro.Functions.call(Functions.java:4131) at ij.macro.Functions.getStringFunction(Functions.java:272) at ij.macro.Interpreter.getStringTerm(Interpreter.java:1307) at ij.macro.Interpreter.getString(Interpreter.java:1286) at ij.macro.Interpreter.doStatement(Interpreter.java:294) at ij.macro.Interpreter.doStatements(Interpreter.java:231) at ij.macro.Interpreter.run(Interpreter.java:115) at ij.macro.Interpreter.run(Interpreter.java:86) at ij.macro.Interpreter.run(Interpreter.java:97) at ij.plugin.Macro_Runner.runMacro(Macro_Runner.java:155) at ij.IJ.runMacro(IJ.java:134) at ij.IJ.runMacro(IJ.java:123) at net.imagej.legacy.IJ1Helper$3.call(IJ1Helper.java:1052) at net.imagej.legacy.IJ1Helper$3.call(IJ1Helper.java:1048) at net.imagej.legacy.IJ1Helper.runMacroFriendly(IJ1Helper.java:999) at net.imagej.legacy.IJ1Helper.runMacro(IJ1Helper.java:1048) at net.imagej.legacy.plugin.IJ1MacroEngine.eval(IJ1MacroEngine.java:136) at org.scijava.script.ScriptModule.run(ScriptModule.java:159) at org.scijava.module.ModuleRunner.run(ModuleRunner.java:167) at org.scijava.module.ModuleRunner.call(ModuleRunner.java:126) at org.scijava.module.ModuleRunner.call(ModuleRunner.java:65) at org.scijava.thread.DefaultThreadService$3.call(DefaultThreadService.java:237) at java.util.concurrent.FutureTask.run(FutureTask.java:266) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) at java.lang.Thread.run(Thread.java:745) Caused by: java.lang.NullPointerException at inra.ijpb.plugins.MorphologicalSegmentation$CustomWindow.setResultDisplayOption(MorphologicalSegmentation.java:1441) at inra.ijpb.plugins.MorphologicalSegmentation.setDisplayFormat(MorphologicalSegmentation.java:1829) ... 30 more And following message is displayed in the log window: Error: Morphological Segmentation GUI not detected Macro code used is as follows: run("Morphological Segmentation"); call("inra.ijpb.plugins.MorphologicalSegmentation.setInputImageType", "object"); call("inra.ijpb.plugins.MorphologicalSegmentation.setGradientRadius", "1"); call("inra.ijpb.plugins.MorphologicalSegmentation.segment", "tolerance=10", "calculateDams=true", "connectivity=4"); call("inra.ijpb.plugins.MorphologicalSegmentation.setDisplayFormat", "Catchment basins"); call("inra.ijpb.plugins.MorphologicalSegmentation.createResultImage"); Thank you so much for your help. Best Regards, |
Hello there,
You need to add a wait in your macro after calling the plugin so the GUI has time to get loaded. Have a look at the example in the wiki (line 6): https://imagej.net/Morphological_Segmentation#Complete_macro_example: Cheers! On Wed, Jun 28, 2017 at 12:43 AM, GP <[hidden email]> wrote: > Hie! > > On normal execution of 'Morphological Segmentation' plugin from > 'MorphoLibJ' > works fine but on execution via macro with exact same settings leads to the > following two exception error windows: > > 1) Exception Error Window: > (Fiji Is Just) ImageJ 2.0.0-rc-61/1.51p; Java 1.8.0_66 [64-bit]; Mac OS X > 10.12.5; 62MB of 2854MB (2%) > > java.lang.reflect.InvocationTargetException > at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) > at > sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java: > 62) > at > sun.reflect.DelegatingMethodAccessorImpl.invoke( > DelegatingMethodAccessorImpl.java:43) > at java.lang.reflect.Method.invoke(Method.java:497) > at ij.macro.Functions.call(Functions.java:4131) > at ij.macro.Functions.getStringFunction(Functions.java:272) > at ij.macro.Interpreter.getStringTerm(Interpreter.java:1307) > at ij.macro.Interpreter.getString(Interpreter.java:1286) > at ij.macro.Interpreter.doStatement(Interpreter.java:294) > at ij.macro.Interpreter.doStatements(Interpreter.java:231) > at ij.macro.Interpreter.run(Interpreter.java:115) > at ij.macro.Interpreter.run(Interpreter.java:86) > at ij.macro.Interpreter.run(Interpreter.java:97) > at ij.plugin.Macro_Runner.runMacro(Macro_Runner.java:155) > at ij.IJ.runMacro(IJ.java:134) > at ij.IJ.runMacro(IJ.java:123) > at net.imagej.legacy.IJ1Helper$3.call(IJ1Helper.java:1052) > at net.imagej.legacy.IJ1Helper$3.call(IJ1Helper.java:1048) > at net.imagej.legacy.IJ1Helper.runMacroFriendly(IJ1Helper. > java:999) > at net.imagej.legacy.IJ1Helper.runMacro(IJ1Helper.java:1048) > at net.imagej.legacy.plugin.IJ1MacroEngine.eval( > IJ1MacroEngine.java:136) > at org.scijava.script.ScriptModule.run(ScriptModule.java:159) > at org.scijava.module.ModuleRunner.run(ModuleRunner.java:167) > at org.scijava.module.ModuleRunner.call(ModuleRunner.java:126) > at org.scijava.module.ModuleRunner.call(ModuleRunner.java:65) > at > org.scijava.thread.DefaultThreadService$3.call( > DefaultThreadService.java:237) > at java.util.concurrent.FutureTask.run(FutureTask.java:266) > at > java.util.concurrent.ThreadPoolExecutor.runWorker( > ThreadPoolExecutor.java:1142) > at > java.util.concurrent.ThreadPoolExecutor$Worker.run( > ThreadPoolExecutor.java:617) > at java.lang.Thread.run(Thread.java:745) > Caused by: java.lang.NullPointerException > at > inra.ijpb.plugins.MorphologicalSegmentation$CustomWindow. > getResultDisplayOption(MorphologicalSegmentation.java:1450) > at > inra.ijpb.plugins.MorphologicalSegmentation.createResultImage( > MorphologicalSegmentation.java:1763) > ... 30 more > > > 2) Exception Error Window: > (Fiji Is Just) ImageJ 2.0.0-rc-61/1.51p; Java 1.8.0_66 [64-bit]; Mac OS X > 10.12.5; 61MB of 2854MB (2%) > > java.lang.reflect.InvocationTargetException > at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) > at > sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java: > 62) > at > sun.reflect.DelegatingMethodAccessorImpl.invoke( > DelegatingMethodAccessorImpl.java:43) > at java.lang.reflect.Method.invoke(Method.java:497) > at ij.macro.Functions.call(Functions.java:4131) > at ij.macro.Functions.getStringFunction(Functions.java:272) > at ij.macro.Interpreter.getStringTerm(Interpreter.java:1307) > at ij.macro.Interpreter.getString(Interpreter.java:1286) > at ij.macro.Interpreter.doStatement(Interpreter.java:294) > at ij.macro.Interpreter.doStatements(Interpreter.java:231) > at ij.macro.Interpreter.run(Interpreter.java:115) > at ij.macro.Interpreter.run(Interpreter.java:86) > at ij.macro.Interpreter.run(Interpreter.java:97) > at ij.plugin.Macro_Runner.runMacro(Macro_Runner.java:155) > at ij.IJ.runMacro(IJ.java:134) > at ij.IJ.runMacro(IJ.java:123) > at net.imagej.legacy.IJ1Helper$3.call(IJ1Helper.java:1052) > at net.imagej.legacy.IJ1Helper$3.call(IJ1Helper.java:1048) > at net.imagej.legacy.IJ1Helper.runMacroFriendly(IJ1Helper. > java:999) > at net.imagej.legacy.IJ1Helper.runMacro(IJ1Helper.java:1048) > at net.imagej.legacy.plugin.IJ1MacroEngine.eval( > IJ1MacroEngine.java:136) > at org.scijava.script.ScriptModule.run(ScriptModule.java:159) > at org.scijava.module.ModuleRunner.run(ModuleRunner.java:167) > at org.scijava.module.ModuleRunner.call(ModuleRunner.java:126) > at org.scijava.module.ModuleRunner.call(ModuleRunner.java:65) > at > org.scijava.thread.DefaultThreadService$3.call( > DefaultThreadService.java:237) > at java.util.concurrent.FutureTask.run(FutureTask.java:266) > at > java.util.concurrent.ThreadPoolExecutor.runWorker( > ThreadPoolExecutor.java:1142) > at > java.util.concurrent.ThreadPoolExecutor$Worker.run( > ThreadPoolExecutor.java:617) > at java.lang.Thread.run(Thread.java:745) > Caused by: java.lang.NullPointerException > at > inra.ijpb.plugins.MorphologicalSegmentation$CustomWindow. > setResultDisplayOption(MorphologicalSegmentation.java:1441) > at > inra.ijpb.plugins.MorphologicalSegmentation.setDisplayFormat( > MorphologicalSegmentation.java:1829) > ... 30 more > > > And following message is displayed in the log window: > Error: Morphological Segmentation GUI not detected > > Macro code used is as follows: > > run("Morphological Segmentation"); > call("inra.ijpb.plugins.MorphologicalSegmentation.setInputImageType", > "object"); > call("inra.ijpb.plugins.MorphologicalSegmentation.setGradientRadius", > "1"); > call("inra.ijpb.plugins.MorphologicalSegmentation.segment", > "tolerance=10", > "calculateDams=true", "connectivity=4"); > call("inra.ijpb.plugins.MorphologicalSegmentation.setDisplayFormat", > "Catchment basins"); > call("inra.ijpb.plugins.MorphologicalSegmentation.createResultImage"); > > Thank you so much for your help. > Best Regards, > > > > > > > -- > View this message in context: http://imagej.1557.x6.nabble. > com/Re-Exception-Error-on-MorphologicalSegmentation- > Plugin-Execution-from-Macro-tp5018975.html > Sent from the ImageJ mailing list archive at Nabble.com. > > -- > ImageJ mailing list: http://imagej.nih.gov/ij/list.html > -- Ignacio Arganda-Carreras, Ph.D. Ikerbasque Research Fellow Departamento de Ciencia de la Computacion e Inteligencia Artificial Facultad de Informatica, Universidad del Pais Vasco Paseo de Manuel Lardizabal, 1 20018 Donostia-San Sebastian Guipuzcoa, Spain Phone : +34 943 01 73 25 Website: http://sites.google.com/site/iargandacarreras/ <http://biocomp.cnb.csic.es/~iarganda/index_EN.html> -- ImageJ mailing list: http://imagej.nih.gov/ij/list.html |
Hie! Thank you so much! adding wait() solved the problem. Best Regards, On Wed, Jun 28, 2017 at 7:46 AM, Ignacio Arganda-Carreras-2 [via ImageJ] <[hidden email]> wrote: Hello there, Gunjan Pandey
|
In reply to this post by Ignacio Arganda-Carreras-2
Hie!
In the macro above for some reason it always skips 'call("inra.ijpb.plugins.MorphologicalSegmentation.createResultImage");' part of the script. I have tried adding ' selectWindow("Morphological Segmentation"); ' before it but it doesn't seem to work. Could you please help me with this. Thanks again! |
Have you tried adding a wait as well before that command? Maybe the
segmentation is taking long as well. On Thu, Jun 29, 2017 at 5:31 PM, GP <[hidden email]> wrote: > Hie! > > In the macro above for some reason it always skips > 'call("inra.ijpb.plugins.MorphologicalSegmentation.createResultImage");' > part of the script. > I have tried adding ' selectWindow("Morphological Segmentation"); ' before > it but it doesn't seem to work. > > Could you please help me with this. > > Thanks again! > > > > > -- > View this message in context: http://imagej.1557.x6.nabble. > com/Re-Exception-Error-on-MorphologicalSegmentation- > Plugin-Execution-from-Macro-tp5018975p5019000.html > Sent from the ImageJ mailing list archive at Nabble.com. > > -- > ImageJ mailing list: http://imagej.nih.gov/ij/list.html > -- Ignacio Arganda-Carreras, Ph.D. Ikerbasque Research Fellow Departamento de Ciencia de la Computacion e Inteligencia Artificial Facultad de Informatica, Universidad del Pais Vasco Paseo de Manuel Lardizabal, 1 20018 Donostia-San Sebastian Guipuzcoa, Spain Phone : +34 943 01 73 25 Website: http://sites.google.com/site/iargandacarreras/ <http://biocomp.cnb.csic.es/~iarganda/index_EN.html> -- ImageJ mailing list: http://imagej.nih.gov/ij/list.html |
Hie! Yes, I did try putting wait again as well but it didn't work. Best Regards, On Fri 30. Jun 2017 at 02:00, Ignacio Arganda-Carreras-2 [via ImageJ] <[hidden email]> wrote: Have you tried adding a wait as well before that command? Maybe the -- Gunjan Pandey
|
In reply to this post by Ignacio Arganda-Carreras-2
Hie! I increased the wait time before create result image step (+100) than initial step and now it executes all steps. Best Regards, On Fri 30. Jun 2017 at 07:21, Gunjan Pandey <[hidden email]> wrote:
|
Free forum by Nabble | Edit this page |