Login  Register

Re: Fiji Headless Mode LoG Fails

Posted by dscho on Jul 23, 2013; 4:17pm
URL: http://imagej.273.s1.nabble.com/Fiji-Headless-Mode-LoG-Fails-tp5004103p5004109.html

Hi Olivier,

On Tue, 23 Jul 2013, Burri Olivier wrote:

> I've built a very simple macro that I want to call from Fiji's Headless
> mode.  It takes as arguments the path of an image and a number for the
> LoG filter, separated by a ';'.
>
> callMacro("thismacro", "imagepath;val_for_LoG"); works as expected and
> the images reflect the change in the val_for_LoG that I input
>
> But when I run
>
> ImageJ.exe  --headless -macro "mymacro" "arg1;arg2" -batch
> It runs properly and saves the image, but they are all the same, no
> matter what I put as my arg2.
>
> It seems that in headless mode, the run("FeatureJ Laplacian", "compute
> smoothing="+params);  line isn't called properly, or something similar.
> I know there is something in the params variable, as I append it to the
> filename, and that gets created properly.

Looking at the source code, I see that this line:

        https://github.com/fiji/fiji/blob/master/src-plugins/FeatureJ_/src/main/java/FJ_Laplacian.java#L29

calls this method:

        https://github.com/fiji/fiji/blob/master/src-plugins/FeatureJ_/src/main/java/FJ.java#L39

which in turn calls the WindowManager to return the current image.

Now, I am not quite clear how you call your macro (in sequence? in
parallel?), so I only have the *hunch* that there is a timing issue
between these two lines:

> [...]
> open(path+image);
> [...]
> run("FeatureJ Laplacian", "compute smoothing="+params);

The easiest way would be to output getTitle() and/or
getInfo("image.filename") after the open() statement.

OTOH it could also be the case that for some reason, "image" contains the
wrong name (I did not see any debug output of that variable except using
part of it for the output file name, so I guess that accounts for debug
output).

Ciao,
Dscho

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