[ImageJ-devel] Trying to integrate imagej-legacy into openmole...

Johannes Schindelin Johannes.Schindelin at gmx.de
Tue Oct 8 10:08:27 CDT 2013


Hi Mark,

On Tue, 8 Oct 2013, Mark Hammons wrote:

> So, I was curious, how do I start imagej in headless mode when i'm
> embedding it into another program?

To put that into context: we just met at the EuBIAS conference (Mark is a
developer of OpenMole, a software facilitating grid computing). The
question was how to call ImageJ1 macros in a headless manner.

In principle, after calling net.imagej.DefaultLegacyService.preinit()
(contained in ij-legacy.jar [*1*]) you can call IJ.runMacro(String) or
IJ.runMacroFile(String) [sic!] to evaluate macros even in headless mode:
the preinit() method will make sure that the headless mode is activated,
which lets quite a few plugins run in headless mode.

When chatting to you (how about Cc:ing your colleagues into this
conversation?), it became clear that you will need support for OSGi and
are willing to help us with that... Great! Thank you!

It also became apparent that you will need to call ImageJ 1.x macros in a
massively parallel way. So I promised that I will implement a function
that lets you call ImageJ 1.x macros via the LegacyService that
uses separate class loaders so that the ImageJ 1.x "instances" cannot
interfere with each other.

Hopefully I will be able to show you tangible code at most in a few weeks.
Feel free to bug me if you do not hear any progress record from me in the
next few days!

In the longer run, you will want to run scripts and macros via the
ScriptService of ImageJ2, but for that, I think we will need our "macro"
recorder which is still a bit off in the future.

Ciao,
Johannes

Footnote *1*: To be precise, "ij-legacy.jar" is my shortcut to "the
artifact of the Maven project hosted on http://maven.imagej.net/ (releases
are in content/repositories/releases/, snapshots in .../snapshots/)
identified by the GA net.imagej:ij-legacy. Currently, the latest release
version is 2.0.0-beta-7.3 while the snapshot version 2.0.0-SNAPSHOT is
"released" continously by our trusty Jenkins.



More information about the ImageJ-devel mailing list