Resolving Exception Error

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

Resolving Exception Error

GP
This post was updated on .
Hie!

I am ultra new to macro writing and wasn't able to find similar question to mine. Please redirect me to the post if its been already discussed. Thanks a ton in advance.
Here it is:

I have written macro code which includes the plugin "Find Connected Regions" to substack> z-project>crop images


run("Find Connected Regions", "allow_diagonal display_one_image display_results regions_for_values_over=100 minimum_number_of_points=1 stop_after=-1");
...


The macro works quite well when executed on individual image files but when opened via Batch mode I get Exception error and it influences the cropping in the resulting images.

When I run the whole macro on individual files an ROI window pops up with ROIs displayed but in batch mode its not visible.
To me the error seemed to be due to "uninitialized ROI manager". (Maybe not)

The file Exception error list includes the following:
java.lang.NullPointerException
    at ij.plugin.frame.RoiManager.getCount(RoiManager.java:1826)
    at ij.plugin.frame.RoiManager.addRoi(RoiManager.java:360)
    at ij.plugin.frame.RoiManager.addRoi(RoiManager.java:324)
    at de.biomedical_imaging.ij.steger.Lines_.addToRoiManager(Lines_.java:349)
    at de.biomedical_imaging.ij.steger.Lines_.setup(Lines_.java:144)
    at ij.plugin.filter.PlugInFilterRunner.<init>(PlugInFilterRunner.java:160)
    at ij.IJ.runUserPlugIn(IJ.java:219)
    at ij.IJ.runPlugIn(IJ.java:181)
    at ij.Executer.runCommand(Executer.java:137)
    at ij.Executer.run(Executer.java:63)
    at ij.IJ.run(IJ.java:297)
    at ij.macro.Functions.doRun(Functions.java:601)
    at ij.macro.Functions.doFunction(Functions.java:96)
    at ij.macro.Interpreter.doStatement(Interpreter.java:230)
    at ij.macro.Interpreter.doBlock(Interpreter.java:608)
    at ij.macro.Interpreter.doStatement(Interpreter.java:272)
    at ij.macro.Interpreter.doIf(Interpreter.java:966)
    at ij.macro.Interpreter.doStatement(Interpreter.java:248)
    at ij.macro.Interpreter.doIf(Interpreter.java:979)
    at ij.macro.Interpreter.doStatement(Interpreter.java:248)
    at ij.macro.Interpreter.doIf(Interpreter.java:979)
    at ij.macro.Interpreter.doStatement(Interpreter.java:248)
    at ij.macro.Interpreter.doIf(Interpreter.java:979)
    at ij.macro.Interpreter.doStatement(Interpreter.java:248)
    at ij.macro.Interpreter.doStatements(Interpreter.java:218)
    at ij.macro.Interpreter.run(Interpreter.java:115)
    at ij.macro.Interpreter.run(Interpreter.java:85)
    at ij.macro.Interpreter.runBatchMacro(Interpreter.java:155)
    at ij.plugin.BatchProcessor.runMacro(BatchProcessor.java:218)
    at ij.plugin.BatchProcessor.processFolder(BatchProcessor.java:195)
    at ij.plugin.BatchProcessor.run(BatchProcessor.java:92)
    at ij.IJ.runPlugIn(IJ.java:187)
    at ij.Executer.runCommand(Executer.java:137)
    at ij.Executer.run(Executer.java:63)
    at java.lang.Thread.run(Thread.java:745)
 
I tried to follow the thread:http://imagej.1557.x6.nabble.com/Problems-with-instance-of-Roi-manager-in-Javascript-td5015111.html 
but was not able to solve the issue.
Please let me know how to work around this problem and get rid of the exception error.
Thanks again,
Reply | Threaded
Open this post in threaded view
|

Re: Resolving Exception Handling Error

Rasband, Wayne (NIH/NIMH) [E]
> On Nov 30, 2016, at 10:44 AM, GP <[hidden email]> wrote:
>
> Hie!
>
> I am ultra new to macro writing and wasn't able to find similar question to
> mine. Please redirect me to the post if its been already discussed. Thanks a
> ton in advance.
> Here it is:
>
> I have written macro code which includes the plugin "Find Connected Regions"
> to substack> z-project>crop images
>
> *
> run("Find Connected Regions", "allow_diagonal display_one_image
> display_results regions_for_values_over=100 minimum_number_of_points=1
> stop_after=-1");
> ...
> *
> The macro works quite well when executed on individual image files but when
> opened via Batch mode I get Exception error and it influences the cropping
> in the resulting images.,

The latest ImageJ daily build (1.51i9) fixes a bug that caused plugins that used the ROI Manager to fail if they were called from a batch mode macro. Note that the ROI Manager is not displayed in batch mode macros unless it is opened using run("ROI Manager…") prier to entering batch mode.

-wayne


> When I run the whole macro on individual files an ROI window pops up with
> ROIs displayed but in batch mode its not visible.
> To me the error seemed to be due to "uninitialized ROI manager". (Maybe not)
>
> The file Exception error list includes the following:
> java.lang.NullPointerException
>    at ij.plugin.frame.RoiManager.getCount(RoiManager.java:1826)
>    at ij.plugin.frame.RoiManager.addRoi(RoiManager.java:360)
>    at ij.plugin.frame.RoiManager.addRoi(RoiManager.java:324)
>    at
> de.biomedical_imaging.ij.steger.Lines_.addToRoiManager(Lines_.java:349)
>    at de.biomedical_imaging.ij.steger.Lines_.setup(Lines_.java:144)
>    at
> ij.plugin.filter.PlugInFilterRunner.<init>(PlugInFilterRunner.java:160)
>    at ij.IJ.runUserPlugIn(IJ.java:219)
>    at ij.IJ.runPlugIn(IJ.java:181)
>    at ij.Executer.runCommand(Executer.java:137)
>    at ij.Executer.run(Executer.java:63)
>    at ij.IJ.run(IJ.java:297)
>    at ij.macro.Functions.doRun(Functions.java:601)
>    at ij.macro.Functions.doFunction(Functions.java:96)
>    at ij.macro.Interpreter.doStatement(Interpreter.java:230)
>    at ij.macro.Interpreter.doBlock(Interpreter.java:608)
>    at ij.macro.Interpreter.doStatement(Interpreter.java:272)
>    at ij.macro.Interpreter.doIf(Interpreter.java:966)
>    at ij.macro.Interpreter.doStatement(Interpreter.java:248)
>    at ij.macro.Interpreter.doIf(Interpreter.java:979)
>    at ij.macro.Interpreter.doStatement(Interpreter.java:248)
>    at ij.macro.Interpreter.doIf(Interpreter.java:979)
>    at ij.macro.Interpreter.doStatement(Interpreter.java:248)
>    at ij.macro.Interpreter.doIf(Interpreter.java:979)
>    at ij.macro.Interpreter.doStatement(Interpreter.java:248)
>    at ij.macro.Interpreter.doStatements(Interpreter.java:218)
>    at ij.macro.Interpreter.run(Interpreter.java:115)
>    at ij.macro.Interpreter.run(Interpreter.java:85)
>    at ij.macro.Interpreter.runBatchMacro(Interpreter.java:155)
>    at ij.plugin.BatchProcessor.runMacro(BatchProcessor.java:218)
>    at ij.plugin.BatchProcessor.processFolder(BatchProcessor.java:195)
>    at ij.plugin.BatchProcessor.run(BatchProcessor.java:92)
>    at ij.IJ.runPlugIn(IJ.java:187)
>    at ij.Executer.runCommand(Executer.java:137)
>    at ij.Executer.run(Executer.java:63)
>    at java.lang.Thread.run(Thread.java:745)
>
> I tried to follow the
> thread:http://imagej.1557.x6.nabble.com/Problems-with-instance-of-Roi-manager-in-Javascript-td5015111.html 
> but was not able to solve the issue.
> Please let me know how to work around this problem and get rid of the
> exception error.
> Thanks again,
>
> --
> View this message in context: http://imagej.1557.x6.nabble.com/Resolving-Exception-Handling-Error-tp5017659.html
> Sent from the ImageJ mailing list archive at Nabble.com.



--
ImageJ mailing list: http://imagej.nih.gov/ij/list.html