Pausing Macro for user input during batch process in ImageJ

Hi, I am very new to this. Can someone please help me? I am trying to batch process macro commands to all images in a folder. I would like to run Color Threshold and allow user to manually adjust slider and manually adjust selection with the drawing tools before continuing with the macro commands. The batch process works if I don’t pause and wait for the user input. - But during the batch process the images are never open so when I try to wait for user input, the image is not displayed so that I can manually adjust the selection in Color Threshold. The Color threshold dialog is open and I can adjust the slider and it does change my results, but my image is not open for me to see what i am doing. So I cannot use the drawing tools to adjust my selection. Why are my images not displaying when I run the Batch?

I’m not great at this, so it would help to describe your process and post your code.

That said, I think the problem is that you are running batch mode, which is specially designed to not open the images. In fact, if you write your macro, that is what setting batch mode does. You can write a macro that processes all images in a folder without ever having to switch to batch mode, however. Batch mode isn’t required to process a batch of images :slight_smile:

This is for an older version, but was in a hurry and it had the set batch mode command demonstrated.

Thank you for your direction. This helps!

I agree with @Research_Associate.
2 more things.

  • Pay attention to what is recorded by ImageJ wih the recorder : selectWindow(“Clipboard”); is what is recorded to select an image, but this won’t work in bach mode since the window is not created. Prefer selectImage(“Clipboard”);

  • Be careful when you use threshold sliders in processing several images of a series. It is weel known that this may introduce a bias since the choosen thresholds are user-dependant and may vary a lot depending on your mood, your tired… And different thresholds may result in different results !


thanks for your advice!