Posted by
dscho on
URL: http://imagej.273.s1.nabble.com/headless-not-working-tp5006126p5006137.html
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