--headless not working?

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

--headless not working?

nickxtsui
Dear Folks:
I am using Fiji on Win7 64. I setup the headless mode, and I use
print("Hello world!");   as test.

In command line, everything looks right when >fiji HelloWorldMacro.ijm
is typed. A window pops up showing "Hellow world!"; However, the
prompt is not responding when I type >fiji --headless
HelloWorldMacro.ijm. There is no error message showing up, just
nothing.

Anyone has any idea where I am doing wrong? Thanks!

Regards,

Nick

--
ImageJ mailing list: http://imagej.nih.gov/ij/list.html
Reply | Threaded
Open this post in threaded view
|

Re: --headless not working?

dscho
Hi Nick,

On Tue, 14 Jan 2014, Nick X. Tsui wrote:

> I am using Fiji on Win7 64. I setup the headless mode, and I use
> print("Hello world!");   as test.
>
> In command line, everything looks right when >fiji HelloWorldMacro.ijm
> is typed. A window pops up showing "Hellow world!"; However, the
> prompt is not responding when I type >fiji --headless
> HelloWorldMacro.ijm. There is no error message showing up, just
> nothing.
>
> Anyone has any idea where I am doing wrong? Thanks!

On Windows, you might need to use the --console option to make it show up.
Alternatively, use redirection (fiji --headless hello.ijm > output.txt).

Ciao,
Johannes

--
ImageJ mailing list: http://imagej.nih.gov/ij/list.html
Reply | Threaded
Open this post in threaded view
|

Re: --headless not working?

dscho
Hi Nick,

On Wed, 15 Jan 2014, Nick X. Tsui wrote:

> Thanks a lot for the reply. Here is what I have run as commen-line:
> *fiji --headless HelloWorldMacro.ijm > output.txt -- console*
>
> This time it did response, and here is what I saw on the screen (see the
> inserted  screen shot). It looks like "Hellow world!" is printed at the
> end, but I have no idea how to explain so much messages which seems pretty
> redundant for me.
>
> On the other hand, nothing saved in output.txt file.

Hmm. That means that the redirection is broken somehow. Unless you really
need to call this in a headless setup (i.e. where you have no screen
attached), how about using ImageJ's -batch flag instead?

> How do I get rid of the message and how can I save my results in the
> output.txt?

To save results in an output file from macros, see

        http://imagej.nih.gov/ij/macros/SaveTextFileDemo.txt

(Please note that the example in the current form forgets to close() the
file, resulting in problems especially on Windows where you cannot have
more than 512 files opened simultaneously across *all* processes, see
http://msdn.microsoft.com/en-us/library/kdfaxaay%28vs.71%29.aspx)

> Or can I only see Hello World! printed on the screen?

As I said, passing the --console flag worked for me.

> PS: Wayne Rasband told me the better place for this kinda topic is Fiji
> devel mailing list, that is why I did not copy my reply to ImageJ mailng
> list.

I am really surprised, because

- there was a public vote about closing the fiji-users list in favor of
  the ImageJ mailing list (because *exactly* the same things had been
  discussed on both) and the result was overwhelmingly in favor of closing
  fiji-users: out of around 20 votes, there was only one in disfavor.

- the ImageJ mailing list is about discussing issues revoling around
  ImageJ, yes? And Fiji Is Just ImageJ (or as close as I can make it)

- Wayne set a strong precedent by being polite and helpful on this mailing
  list so that now the biggest strength of ImageJ is not the software, or
  any given plugin, but its community. And where better to ask for the
  community's help than the ImageJ mailing list?

- given that there are discussions on the ImageJ mailing list about
  Photoshop, image processing ethics, new microscopes, hiding windows,
  developing Java code in Netbeans, etc, I can really think of things that
  have substantially less to do with ImageJ than discussing how to run it
  headlessly (for which Fiji is the only option so far), keeping in mind
  all the other things that are perfectly accepted on the mailing list.

- from my memory, there have been at least five different questions about
  headless operation on the ImageJ mailing list last year, so it appears
  that this is a topic pretty relevant to ImageJ users, and forcing me to
  answer all of those questions in a way that Google cannot find my answer
  diverts my time away from writing useful ImageJ plugins.

- as you can see from my answers to your question above, your problem
  might best be addressed not by Fiji's headless mode but by pure ImageJ
  macros. Now, I cannot think of any better place to discuss such things
  than the ImageJ mailing list!

So: color me surprised! I completely and wholeheartedly disagree that the
issue you raised would be better discussed somewhere else than right here:
the ImageJ mailing list.

Ciao,
Johannes

--
ImageJ mailing list: http://imagej.nih.gov/ij/list.html
Reply | Threaded
Open this post in threaded view
|

Re: --headless not working?

nickxtsui
In reply to this post by dscho
Dear Johanness and ImageJ users/developers:
I think the additional option, --console, did make the difference, and here
is what is displayed on the screen (see inserted image). So I can see the
"Hello world!" is displayed at the end of the execution on the screen.
However, there are so much messages that do not make much sense to me. Is
there any way to silence the console so that it only displays "Hello
world!"?
Also, the redirection seems not working, nothing is saved in output.txt.
Thanks a lot.
Nick



[image: Inline image 1]





On Wed, Jan 15, 2014 at 1:54 PM, Johannes Schindelin <
[hidden email]> wrote:

> Hi Nick,
>
> On Tue, 14 Jan 2014, Nick X. Tsui wrote:
>
> > I am using Fiji on Win7 64. I setup the headless mode, and I use
> > print("Hello world!");   as test.
> >
> > In command line, everything looks right when >fiji HelloWorldMacro.ijm
> > is typed. A window pops up showing "Hellow world!"; However, the
> > prompt is not responding when I type >fiji --headless
> > HelloWorldMacro.ijm. There is no error message showing up, just
> > nothing.
> >
> > Anyone has any idea where I am doing wrong? Thanks!
>
> On Windows, you might need to use the --console option to make it show up.
> Alternatively, use redirection (fiji --headless hello.ijm > output.txt).
>
> Ciao,
> Johannes
>
--
ImageJ mailing list: http://imagej.nih.gov/ij/list.html

headlessScreenshot.jpg (558K) Download Attachment