[ImageJ-bugs] [Bug 1107] Cannot run commands from the ijpb/MorphoLibJ plugin in --headless mode using --jython script option

bugzilla at fiji.sc bugzilla at fiji.sc
Tue Jul 7 15:39:25 CDT 2015


http://fiji.sc/bugzilla/show_bug.cgi?id=1107

Curtis Rueden <ctrueden at wisc.edu> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |NEEDSINFO
                 CC|                            |ctrueden at wisc.edu

--- Comment #2 from Curtis Rueden <ctrueden at wisc.edu> ---
Thanks for the report, Greg.

Firstly, please note that there is a serious bug preventing Jython scripts from
working headlessly on Windows:

https://github.com/imagej/imagej/issues/114

If you are using Windows, as a workaround, you can use any other scripting
language besides Jython. Obviously we hope to fix this in the future, but
cannot promise a timeline right now.

Anyway, I'm guessing you are on a different OS, since you say the script
finishes successfully...

Secondly, note that ImageJ2's headless mode is an extension of ImageJ1 to work
headless in only certain cases. Some plugins will simply not work headless, due
to hardcoded usage of headless-unfriendly GUI elements. The typical symptom
there is java.awt.HeadlessException being thrown, which from your description I
assume you are not seeing either?

Off the top of my head, I do not have an easy answer for you for grabbing
handles to existing images while headless. (The WindowManager won't work
because it is unfortunately a UI element which needs to be overridden.)

Regarding the NullPointerException, that sounds like a likely culprit and it
would be helpful if you could paste the full stack trace of that message.

Looking at the Edge Detection plugin source code, I see several serious
potential issues with using them headless:

* The Conn_Tres is a PlugInFrame, which is a UI element.
* There are multiple calls to WindowManager.getCurrentImage(), which (IIRC) may
not work correctly headless.

In short, the headless mode is fraught with difficulty, especially when third
party plugins are involved. Your best bet is probably to install xvfb on your
headless machine and run your scripts that way, so that your scripts behave
better.

Or, if you are running these scripts on your local machine (i.e., not a
headless server or cluster somewhere), then why use --headless at all? Just
don't pass that flag.

I am marking this as NEEDSINFO in case you want to provide more detail on the
NullPointerException, or if you can isolate more specifics about how things go
wrong, what you expect to happen instead, etc. If xvfb and/or not using
--headless works for you instead though, then I would favor closing this issue
as "WONTFIX" since we don't have the resources this year to improve ImageJ's
legacy headless mode.

-- 
You are receiving this mail because:
You are the assignee for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://imagej.net/pipermail/imagej-bugs/attachments/20150707/2e6d36a7/attachment.html>


More information about the Imagej-bugs mailing list