Use of image calculator for multiple image analysis, help

Dear all,

I am far to be façiliar with java language.
I would like apply the following macro on thousand of photos, but I dont know how to make the macro généric even with the help of Image J tutorial.
With image calculator, I wanna use the processed photo (variable) and a Mask always the same.

Thanks a lot

dir1 = getDirectory("Choose Source Directory ");

list = getFileList(dir1);
for (i=0; i<list.length; i++) {
run("Split Channels");
Until now i am lost, I know thaht I have to fill "******" with something generic, but what
? I want keep only the (green) photo and discard the others.
selectWindow("**********.jpg (blue)");
selectWindow("***********.jpg (red)");
selectWindow("***********.jpg (green)");

run("Subtract Background...", "rolling=50 light");
run("Make Binary");
My second problem is to use the image calcultor with a variable photo (the previous green one) and a maskwhich is the same for all photo

imageCalculator("Multiply create", "*********.jpg (green)","mask statique.jpg");
selectWindow("Result of ******.jpg (green)");
run("Analyze Particles...", "summarize");


Use a variable to keep track of the current image title that you can get using the getTitle() macro function.

Just this morning, I wrote this post explaining it in a related discussion.

If you use something like
t= getTitle(*******) then you can write the macro for instance

selectWindow("t.jpg (blue):);

you would want that inside your loop and close to the top.

I’m not sure I understand your questions about the Image calculator.