Running Fiji from command line?

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

Running Fiji from command line?

nickxtsui
Dear Folks:
I want to run Fiji <http://fiji.sc/Fiji> from command-line, to do something
like batch image processing. I imagine by typing some command at some
console, some batch file can be launched to execute some macro. In this
case, the Fiji GUI will not show up, but the processing will be running
behind the scene.

Here is what I have done:

I simply tried the FIji headless <http://fiji.sc/wiki/index.php/Headless> ,
but when I tried* ./Build.sh misc/headless.jar *as the web suggested, the
console prompt returns could not find project for artifactID 'headless'; I
also tried Javassist <http://www.csg.ci.i.u-tokyo.ac.jp/~chiba/javassist/>,
pretty much just built it, but have not figure out how to use it.

Here is what I have encountered:

When I type* fiji --headless HelloWorldMacro.ijm*, nothing happened, where
inside the HelloWorldMacro.ijm is printf("Hello world!");

I am wondering, how should I run FIji from command line? What is the best
method for me to run Fiji using command line (I am on 64bit Windows 7 )? Is
what I have tried on the right track? If so, what additional work/changes
needed to make it work? Thanks a lot.

Nick

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

Re: Running Fiji from command line?

dscho
Hi Nick,

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

> I simply tried the FIji headless <http://fiji.sc/wiki/index.php/Headless> ,
> but when I tried* ./Build.sh misc/headless.jar *as the web suggested,

The website suggested doing that *only* if a headless.jar file is required
(e.g. because your Java environment does not allow run-time modification
of Java classes).

Unfortunately, the "./Build.sh misc/headless.jar" fell victim to some
serious restructuring designed to save me time maintaining Fiji, and I did
not have time yet to fix it.

> When I type* fiji --headless HelloWorldMacro.ijm*, nothing happened,
> where inside the HelloWorldMacro.ijm is printf("Hello world!");

As I suggested in my reply to your other mail, you could do one of two
things:

1) fiji --headless --console HelloWorldMacro.ijm

2) fiji --headless HelloWorldMacro.ijm > output.txt
   cat output.txt

The reason is the peculiar console handling on Windows: you can write a
program that is either a console program or a GUI program. As most of the
users want the latter (and never, never, ever see the console window at
all), we added some workarounds to output onto the console on demand, or
when a console is already available, but as you experienced, there are
cases when that logic does not work and requires the user to specify
--console explicitly.

Ciao,
Johannes

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