Login  Register

Re: Using ImageJ in another java pp in the existing jre, and batch mode on linux

Posted by Jared Hodge on Feb 12, 2010; 7:36pm
URL: http://imagej.273.s1.nabble.com/Using-ImageJ-in-another-java-pp-in-the-existing-jre-and-batch-mode-on-linux-tp3689390p3689395.html

After a little more testing, I think this perceived difference in their
behavior may be due to windows being so much slower to start up the GUI
than Linux (at least for my test systems).  It takes about 3 seconds to
start the GUI under windows and about 1 second under Linux.  The macro
I'm running only takes just over a second to complete, and then I guess
the "System.exit" is reached before the GUI even started on Windows.

 

Either way, this seems like a bug, or am I just not doing something
right?  How do I completely suppress the display of the results window?

 

The macro component that seems to be doing the output is run("Analyze
Particles...").  Is this component broken for batch-mode?

-Jared

 

From: Jared Hodge
Sent: Friday, February 12, 2010 10:44 AM
To: '[hidden email]'
Subject: Using ImageJ in another java pp in the existing jre, and batch
mode on linux

 

Hi, I'm new to ImageJ, so forgive me if this has been addressed before.
I have a java application where I am wanting to use ImageJ.  I would
think running it in my existing jre would be the most efficient way to
process lots of images.  I mostly want to just be able to run macros,
which I'm can do by calling ij.IJ runMacro.  The problem is I want them
to run without any feedback to the monitor (similar to -batch, but
actually processing the script I pass in), but runMacro displays a
"results" GUI on the screen.  Also, if I ever construct an "ij.ImageJ"
in my jre to display the GUI, all macros thereafter display even more
stuff on the screen, even if I've closed the ImageJ GUI (until I restart
my application).  Looking at the code a bit, it looks like the run
method which shuts down the ImageJ GUI is not cleaning up the static
references to itself in the IJ object.

 

I've also noticed a difference in the behavior of macros on Windows and
Linux.  On Windows if I run a batch script, no results are displayed to
the screen.  On Linux, the GUI briefly pops up a "results" window, which
I think tends to slow things down as rather annoying.  Is this a bug?
My test case of my application above is on Linux, so I'm not sure if
these are related.

 

Thanks for any help.

-Jared