Reputation: 1
I am trying to write a macro for ImageJ that processes the images in the specified folder through the OrientationJ Vector Field plugin, and then saves the outputted results tables into a separate folder. The issue is that when I run the macro, the OrientationJ Vector Field's dialogue box pops up however the results are not saved anywhere. I am not sure what I am doing incorrectly, and it would be much appreciated if someone could help me. The code for my macro is shown below, thanks.
dir1 = getDirectory("Choose Source Directory ");
dir2 = getDirectory("Choose Destination Directory ");
list = getFileList(dir1);
setBatchMode(true);
for (i=0; i<list.length; i++) {
showProgress(i+1, list.length);
filename = dir1 + list[i];
if (endsWith(filename, "tif")) {
open(filename);
run("8-bit");
run("OrientationJ Vector Field");
run("OrientationJ Vector Field", "tensor=2.0 gradient=0 radian=on vectorgrid=50 vectorscale=80.0 vectortype=0 vectoroverlay=off vectortable=on ");
saveAs("Results", dir2+list[i]+".csv");
close();
}
}
Upvotes: 0
Views: 188
Reputation: 1
Update: Issue has been resolved by manually updating OrientationJ to 2.0.5 (from May 2020). In the older versions, the vector field did not work from a macro. The latest version can be found on the OrientationJ website: http://bigwww.epfl.ch/demo/orientationj/
Fiji does not have the latest version of O.J. included and so the latest version needs to manually be installed.
Upvotes: 0
Reputation: 328
Did you try using another ImageJ-plugin, such as "Orientations_"? https://www.gluender.de/Miscellanea/MiscTexts/UtilitiesText.html#Gl-2020-1 ImageJ-Macro call: run( "Orientations ", "local diameter=16 indicator" );
Upvotes: 0