running script in headless mode partially

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

running script in headless mode partially

maikelb
Hi all,

I have written a javascript for Fiji/ImageJ that requires some user input parameters via the GenericDialog class. I can run the script from the terminal (Mac os x) using the following code:

java -jar /path/to/Fiji.app -macro /path/to/script

However, adding --headless as follows does exactly the same (so it does not run headless):

java -jar /path/to/Fiji.app --headless -macro /path/to/script

Anyway, I would like to ONLY show the GenericDialog and keep the rest of the windows hidden. Do I fix this in the script or with specific terminal commands? Any tips would be greatly appreciated!

Regards,

Maikel

Reply | Threaded
Open this post in threaded view
|

Re: running script in headless mode partially

ctrueden
Hi Maikel,

> java -jar /path/to/Fiji.app -macro /path/to/script

This invocation should not work. You should see an error:
"Error: Invalid or corrupt jarfile /path/to/Fiji.app"

To run a script headless, you should write:

  /path/to/Fiji.app/Contents/MacOS/ImageJ-macosx --headless /path/to/script

See http://imagej.net/Headless for details.

> I would like to ONLY show the GenericDialog and keep the rest of the
> windows hidden.

If you need to show any dialogs, then headless is not the solution. The
term "headless" means that there is no graphical display whatsoever. It is
intended primarily for remote servers with no monitor attached.

This is the first time I've heard of someone wanting to show an input
dialog, but not the ImageJ main window. Why do you want to do this?

Regards,
Curtis

On Tue, May 12, 2015 at 8:22 AM, maikelb <[hidden email]> wrote:

> Hi all,
>
> I have written a javascript for Fiji/ImageJ that requires some user input
> parameters via the GenericDialog class. I can run the script from the
> terminal (Mac os x) using the following code:
>
> java -jar /path/to/Fiji.app -macro /path/to/script
>
> However, adding --headless as follows does exactly the same (so it does not
> run headless):
>
> java -jar /path/to/Fiji.app --headless -macro /path/to/script
>
> Anyway, I would like to ONLY show the GenericDialog and keep the rest of
> the
> windows hidden. Do I fix this in the script or with specific terminal
> commands? Any tips would be greatly appreciated!
>
> Regards,
>
> Maikel
>
>
>
>
>
> --
> View this message in context:
> http://imagej.1557.x6.nabble.com/running-script-in-headless-mode-partially-tp5012822.html
> Sent from the ImageJ mailing list archive at Nabble.com.
>
> --
> ImageJ mailing list: http://imagej.nih.gov/ij/list.html
>

--
ImageJ mailing list: http://imagej.nih.gov/ij/list.html