Running headless Fiji as a "service" for macros

Hi all!

Quick Q that hopefully has a good answer.

We’re running IJ (Fiji) headless to use to run various macros.
The macros themselves take about 5 sec to run. However Fiji startup takes 10-15 sec. We’re running the macros with simple command line --headless -macro type shell exec. So the total time each time we try to run a script is 15-20 sec.

In order to make this faster, what I was wondering was whether it’s possible to have IJ running persistently, and then have it be told to run a script (from cmd line/exec) when needed, and then stay running after the script is finished?

I looked and googled around, and saw the -port option, but not sure if that’s whether that’s relevant/does what we need,



I have this very same question!, did you manage to get this to work?

In my case, I have a macro that takes around 2 seconds to finish that needs to be run on data as it arrives, 1 image per minute. However instantiating imageJ every time seems unnecessary, I would like to have an imagej instance running as a service all the time for this purpose, without closing it.

Any ideas?.


Sorry Julian - just seeing your question now!

In answer to your question, we never did manage to get IJ running in a background server type fashion, and had to deal with the long startup time.

In the end for our system, we actually moved all of our code and tests into a python implementation rather than continuing to use IJ. That was a much better fit for what we were trying to do, rather than continuing to try to use IJ in a way it wasn’t really designed for.