blank images when macro run from script vs terminal

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

blank images when macro run from script vs terminal

Steve Huntley
I've written a macro that uses the Layers plugin
(http://www.optinav.com/Layers.htm) to turn an image stack into a single
image, the generated composite image is then saved to disk by the macro.

The macro works flawlessly when I run it by starting ImageJ from a
terminal command line using the -macro switch to reference the macro
script.  Now that it is working I want to incorporate it into a cgi
script to be called by a web server, using exactly the same settings as
used in the command line.  But when I start things from the cgi script,
the generated composite image is blank and the resulting saved file is
empty.  I can see ImageJ starting and loading the image stack as
expected, but the composite image window when the plugin creates it is
always blank.

My machine is a Mac Pro running Snow Leopard, and I'm using ImageJ
1.45k.  If it were Unix I would check the X Server related environment
variables set in my cgi script.  But I'm not so familiar with the Mac's
visual systems.  Knowing what little I know I can't imagine why it
should make a difference that I'm calling the macro from a script as
opposed to a terminal window.  Is there some OS configuration value or
environment variable that I should have set in my cgi script before
calling ImageJ?

Any hints would be appreciated.

Thanks,
Steve Huntley
Reply | Threaded
Open this post in threaded view
|

Re: blank images when macro run from script vs terminal

Steve Huntley
The answer, it seems, is that the HOME environment variable must be
set.  Why ImageJ needs this variable to be set in order to render an
image on a canvas, I can't imagine, but there you have it.

--Steve H.
Reply | Threaded
Open this post in threaded view
|

Re: blank images when macro run from script vs terminal

dscho
Hi Steve,

On Sun, 7 Aug 2011, Steve Huntley wrote:

> The answer, it seems, is that the HOME environment variable must be set.  
> Why ImageJ needs this variable to be set in order to render an image on
> a canvas, I can't imagine, but there you have it.

It is more likely that the JVM's AWT implementation requires that variable
to be set.

In any case: good that you found it, and thank you very much for sharing
the answer!

Ciao,
Johannes

P.S.: I frequently Google around with a problem description only to find
mailing list threads where the last mail is "Never mind! I found it!" with
no trace what "it" could have been. :-(