I wrote the code as follows in ImageJ. But the image window is not created in open.
I want to load all the tif files into the folder and see them.
I wrote the code as follows in ImageJ. But the image window is not created in open.
I want to load all the tif files into the folder and see them.
The problem is the line setBatchMode(true);
If you delete that line, or set it to false
, your script will open all the files in the folder in a way that you can see them. BatchMode allows a script to run without drawing the window and is intended for use in an automated script.
dir1 = getDirectory("Choose Source Directory");
list = getFileList(dir1);
for (i = 0; i < list.length; i++) {
showProgress(i+1,list.length);
filename = dir1 + list[i];
if(endsWith(filename, "tif"));
{
open(filename);
}
}