Process>Batch>Macro, "There are no images open"

Hello,

I’m trying to run a macro for a batch of images, the macro I’m using is:

//run("Brightness/Contrast...");
setMinAndMax(156, 275);
run("Close");
setAutoThreshold("Default");
//run("Threshold...");
setThreshold(0, 150);
run("Close");
//setThreshold(0, 150);
setOption("BlackBackground", false);
run("Make Binary", "thresholded remaining black");

However when I press process I get the pop up error saying: “There are no images open”. I was under the impression that since you specify the input/output folders, the program should open all the images itself? I’m really not sure where is the problem.

Welcome to the forum, @Xscape!

What format are your input files? It might be that ImageJ is not recognizing them as images to be opened when you run Process > Batch > Macro….

You can have a look at the Batch Processing wiki page for other options to do batch processing:

1 Like

They are in .tif format

Why do you use run("Close"); calls in your macro? If you close the image, the subsequent command will have no more image to work on, and hence complain.

EDIT: I see that the macro recorder is now recording run("Close"); also when you close one of the dialog windows. I guess this is a bug in the recording behavior. @Wayne any comments?

Oddly enough, deleting all the run(“Close”); seems to have fixed my problems

EDIT: and yes, those commands were placed by the recorder when closing the dialog windows, thanks!

1 Like

same to me. Thanks!!