Posted by
Olivier Burri on
URL: http://imagej.273.s1.nabble.com/Fiji-Headless-Mode-LoG-Fails-tp5004103.html
Dear ImageJ/FIJI Users
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.
Anyone know how I could solve this?
Best
Oli
Macro below
macro "As headless" {
args = split(getArgument(), ";");
sep = File.separator;
fullpath = args[0];
fullpath = replace(fullpath, "/", sep);
params = parseFloat(args[1]);
print(args[1], params);
path = substring(fullpath, 0, lastIndexOf(fullpath, sep));
print(path);
image = substring(fullpath, lastIndexOf(fullpath,sep), lengthOf(fullpath));
open(path+image);
run("FeatureJ Laplacian", "compute smoothing="+params);
name = substring(image, 0, lengthOf(image)-4);
saveAs("TIFF", path+name+" with LoG_"+params+".tif");
}
--
ImageJ mailing list:
http://imagej.nih.gov/ij/list.html