ImageJ: open several image windowless with a macro
Posted: Mon Feb 20, 2017 8:01 am
I'm trying to edit all .ids-files from a directory using a ImageJ macro (with the loci_tools.jar installed):
The problem is that when loading the files with the macro, the open dialog in the graphical user interface shows up and the macro will not continue until I manually choose a file.
I was suggested to use the Bio-Formats Windowless Importer, but it seems that I can't specify all the options, like I did in the macro above. Since I need the macro to work properly irrespective of previously used import settings this doesn't seem to be an option.
Any suggestions are greatly appreciated!
- Code: Select all
input = "/home/user/inputfolder/";
output = "/home/user/outputfolder/";
function action(input, output, filename) {
print(input + filename);
run("Bio-Formats Importer", "open= ["+ (input + filename) +"] autoscale color_mode=Custom view=Hyperstack stack_order=XYCZT series_0_channel_0_red=0 series_0_channel_0_green=255 series_0_channel_0_blue=0 series_0_channel_1_red=255 series_0_channel_1_green=0 series_0_channel_1_blue=0 series_0_channel_2_red=0 series_0_channel_2_green=0 series_0_channel_2_blue=255");
close();
}
setBatchMode(true);
list = getFileList(input);Bio-Formats Windowless Importer
for (i = 0; i < list.length; i++)
action(input, output, list[i]);
setBatchMode(false);
The problem is that when loading the files with the macro, the open dialog in the graphical user interface shows up and the macro will not continue until I manually choose a file.
I was suggested to use the Bio-Formats Windowless Importer, but it seems that I can't specify all the options, like I did in the macro above. Since I need the macro to work properly irrespective of previously used import settings this doesn't seem to be an option.
Any suggestions are greatly appreciated!