[ImageJ-devel] ImageJ2 in headless mode

Curtis Rueden ctrueden at wisc.edu
Tue Jul 31 16:45:43 CDT 2012


Hi Raghuram,

I am terribly sorry for leaving this message unanswered for so long.


> 1)Xvfb didnt work on our server (ubuntu 12.04, hosted in our departmental
> datacenter) for some reason. It always fails saying cannot start xvfb.


I think your best bet for the time being would be to debug these Xvfb
problems. It is the most surefire way to run ImageJ1 headless. The only
thing to watch out for is dialog boxes popping up waiting for user input on
the server side, with no way to close them. Hopefully your macros can avoid
doing such things.

Alternately, you could try Fiji in headless mode using the --headless
command line flag; it is quite good in many circumstances, but there are
certain macros that simply cannot work that way, since they rely on the
Java GUI (even if nothing is explicitly shown onscreen, sometimes dialogs
are being constructed and manipulated invisibly).


> 2) So we started dabbling with ImageJ2 beta1 and now the beta that was
> released yesterday. But have had not success in getting it to run in
> headless mode either.


We plan to create a tutorial for ImageJ2 headless, but the API is still in
flux and we have simply not had time yet. Hopefully very soon though! Both
beta2 and beta3 made improvements in the API to use headless.

What you will never be able to do with ImageJ2 though is run legacy ImageJ1
plugins (and some macros) fully headless, no matter what. The reason is
that the ImageJ1 compatibility layer keeps an invisible ImageJ1 window
around, which it uses to execute those things. And that window cannot ever
be fully headless. The solution, moving forward, will be to have an
ImageJ2-specific script or plugin that has no dependence on any explicit
GUI elements.

If you are really eager to get started with ImageJ2 programming, I would be
happy to go into more detail about it, but it may be easier to wait till we
have some documentation online about it.

Regards,
Curtis


On Sat, May 19, 2012 at 12:32 PM, raghuram sudhaakar <rs96 at buffalo.edu>wrote:

> Hello Curtis,
> I have been using imageJ (v1) for an automated grading process. A
> colleague and I developed a macro which runs well and until now we have
> been using it on our personal machines. We are trying to host it on a local
> server so the macro can be used by other colleagues as well, but are stuck
> trying to run in headless mode
>
> 1)Xvfb didnt work on our server (ubuntu 12.04, hosted in our departmental
> datacenter) for some reason. It always fails saying cannot start xvfb.
>
> 2) So we started dabbling with ImageJ2 beta1 and now the beta that was
> released yesterday. But have had not success in getting it to run in
> headless mode either.
>
> Some quick pointers on how to get this done will be great and very useful
> for the upcoming summer session.
>
> thanks
> raghuram
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://imagej.net/pipermail/imagej-devel/attachments/20120731/51699917/attachment-0001.html>


More information about the ImageJ-devel mailing list