Calling a Command and then waiting until images are chosen

I created a macro and I am trying to make it more accessible to the API of ImageJ so I am switching to it to a Plugin.

In the Macro I ran

run("Image Sequence...");
selectImage(1);
run("Set... ", "zoom=50 x=512 y=512");

The thread was automatically stopping by running Image Sequence and was waiting for user to select the image while in the Plugin by running
IJ.doCommand("Image Sequence...");
it didn’t work.

Hello Mourka -

Does WaitForUserDialog do what you want?

Thanks, mm

1 Like

I think it worked now by using

IJ.run("Image Sequence...");

instead of

IJ.doCommand("Image Sequence...");

There is different work in thread handling in both. I also don’t know if this is the right way to do it as I notice a second or two the stack window is blank until the image show up.