Login  Register

ImageJ macro calling, e.g. exec("bash_script &"); // in background.

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

ImageJ macro calling, e.g. exec("bash_script &"); // in background.

Nikolaus Szeverenyi
3 posts
Anyone know how to pass the & symbol in an ImageJ macro using a line like:
exec("bash_script &");

I am using ImageJ to run FLIRT registration software on NIFTI images from
a macro on a Linux platform.

This approach works fine until I put the & to make it run FLIRT in
background (and hopefully use more processors).  Seems like the & is a
special symbol in the ImageJ macro language -- somehow interprets & and no
longer runs the script.  Tried various tricks like \& , but I am just
guessing at this point.

Thanks,

Nick

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

Re: ImageJ macro calling, e.g. exec("bash_script &"); // in background.

Pariksheet Nanda
50 posts
That shouldn't work.
The `&` symbol is specific to bash and similar *nix shells.
On the other hand, ImageJ (Java rather) doesn't run bash when it
processes exec() in the ImageJ macro.

I don't know of a simple way to do what you want, i.e. launch a
non-blocking exec process from an ImageJ macro.

> Nick

Pariksheet

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

Re: ImageJ macro calling, e.g. exec("bash_script &"); // in background.

Niko Ehrenfeuchter
44 posts
On 03.07.2013 03:09, Pariksheet Nanda wrote:
> That shouldn't work.
> The `&` symbol is specific to bash and similar *nix shells.
> On the other hand, ImageJ (Java rather) doesn't run bash when it
> processes exec() in the ImageJ macro.
>
> I don't know of a simple way to do what you want, i.e. launch a
> non-blocking exec process from an ImageJ macro.

Well, just create a wrapper script that you call directly from within
the macro and that does itself launch the background job execution.

Cheers
Niko

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