Login  Register

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

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

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