Login  Register

handling exceptions in ImageJ macro

Posted by nickxtsui on Feb 14, 2014; 9:50pm
URL: http://imagej.273.s1.nabble.com/handling-exceptions-in-ImageJ-macro-tp5006529.html

Dear ImageJ folks:
I am wondering is there a way to throw and handle exceptions in ImageJ?

Say, I have a macro script, and it was run within some software, which I believe uses the ImageJ headless option, so I don't know much behind the scene since the ImageJ UI does not show. But the software does log the information using re-directory mechanism, so I can go to the log to see more information. So I am wondering is there anything I can do in the macro to throw an exception whenever one occurs? Something like try-catch statement in C++?

I know with ImageJ UI displaying, I can pretty much trace where the error is in the macro script, but the way that ImageJ is launched in the software is not known to me, so it is possible that even if the debugging is done with ImageJ UI showing, I might still run into problems when using the software.

I hope there is something I can try. Thanks!
Best,
Nick