Login  Register

Successful IJ.run()?

Posted by Juanjo Vega on Jun 17, 2010; 3:06pm
URL: http://imagej.273.s1.nabble.com/Successful-IJ-run-tp3687894.html

Hi everybody,

Is there any way to know if a "IJ.run()" command was completed or not?

I mean, I'm executing "Plot Profile" when a button is pressed. As "Plot
Profile" needs a selection, if no ROI was selected, ImageJ shows an
error message and does nothing. So I would like to check if the command
was successful and, if not, to select a tool.

The idea is something like:

IJ.run("Plot Profile");
if(IJ.<SUCCESSFUL?>()){
        IJ.setTool(ToolBar.LINE);
}

I tried "IJ.escapePressed()", but it didn't work, as I expected.

Sincerelly,

Juanjo Vega.