HELP - new macro batch does not increment i

fiji
#1

Hiya,
I am a beginner in the macro world and I want to do this very easy macro that opens an image > converts to WF (SIMcheck) > reslice > Z proj and save the images; and has to do this for all the images in the input folder.
The macro itself works and I used the DEBUG mode in ImageJ and realized that the counter does not increase at the end of the “for” and repeats the process for the same image over and over again…
I imagine it is a simple problem of placing a parenthesis, but I can’t make sense of it (apart from adding a line i=i+1 at the end… )

Here the macro:

Dialog.create("Batch Processing - RAW to WF OTF");
	Dialog.addCheckbox("Use Bio-Formats Importer ", true);
Dialog.show();
		Bio=Dialog.getCheckbox();
		
input = getDirectory("location where images are stored");


//select location where images are stored
output = getDirectory("Location for results");
list = getFileList(input);

{
setBatchMode(false);

//loop to sequentially open images
for (i=0; i<list.length; i+1)
{
	
full = input + list[i];
print(full);

		if (Bio==true){
		run("Bio-Formats Importer", "open=full autoscale color_mode=Composite view=Hyperstack stack_order=XYCZT");
				} 
		else {
		open(full);
		}

//Get the name without the extension
filename=getTitle();
ShortFileName=substring(filename, 0, lastIndexOf(filename,"."));
//rename
rename("RAW");
// process
selectWindow("RAW");
run("Raw SI Data to Pseudo-Widefield", "angles=1 phases=5 intensity rescale");
rename("WF_temp");

selectWindow("WF_temp");
run("Reslice [/]...", "output=0.125 start=Top");
rename("WF_Z");

selectWindow("WF_Z");
run("Z Project...", "projection=[Max Intensity]");
rename("WF_Z_MAX");
run("16 colors");
run("Scale Bar...", "width=1 height=4 font=14 color=White background=None location=[Lower Right] bold overlay");
	
// save
selectWindow("WF_Z_MAX");
rename(ShortFileName+"_RIN_PWF_Ztop_MAX");
print(ShortFileName+"_RIN_PWF_Ztop_MAX" + " done");
outWFZmax = output + ShortFileName + "_RIN_PWF_Ztop_MAX";
saveAs("PNG", outWFZmax);

selectWindow("WF_temp");
rename(ShortFileName+"_RIN_PWF");
print(ShortFileName+"_RIN_PWF" + " done");
outWF = output + ShortFileName + "_RIN_PWF ";
saveAs("tiff", outWF);

selectWindow("WF_Z");
rename(ShortFileName+"_RIN_PWF_Ztop");
print(ShortFileName+"_RIN_PWF_Ztop" + " done");
outWFZ = output + ShortFileName + "_RIN_PWF_Ztop";
saveAs("tiff", outWFZ);

run("Close All");
//number=number+1;
}
}




//setBatchMode(false);


print("All done - " + number + " images processed");

here the log

Blockquote
D:\SCIENCE\5 Experiments\DO14_telomere-distribution-eG1-S\PSF tests\2019-05-10_OTF\test folder\20190509_514_560_angle1_001.dv
Pseudo-Widefield from raw SI data (with Ratio Intensity Normalization).
20190509_514_560_angle1_001_RIN_PWF_Ztop_MAX done
20190509_514_560_angle1_001_RIN_PWF done
20190509_514_560_angle1_001_RIN_PWF_Ztop done
D:\SCIENCE\5 Experiments\DO14_telomere-distribution-eG1-S\PSF tests\2019-05-10_OTF\test folder\20190509_514_560_angle1_001.dv
Pseudo-Widefield from raw SI data (with Ratio Intensity Normalization).
20190509_514_560_angle1_001_RIN_PWF_Ztop_MAX done
20190509_514_560_angle1_001_RIN_PWF done
20190509_514_560_angle1_001_RIN_PWF_Ztop done
D:\SCIENCE\5 Experiments\DO14_telomere-distribution-eG1-S\PSF tests\2019-05-10_OTF\test folder\20190509_514_560_angle1_001.dv
Pseudo-Widefield from raw SI data (with Ratio Intensity Normalization).
20190509_514_560_angle1_001_RIN_PWF_Ztop_MAX done
20190509_514_560_angle1_001_RIN_PWF done
20190509_514_560_angle1_001_RIN_PWF_Ztop done
D:\SCIENCE\5 Experiments\DO14_telomere-distribution-eG1-S\PSF tests\2019-05-10_OTF\test folder\20190509_514_560_angle1_001.dv
Pseudo-Widefield from raw SI data (with Ratio Intensity Normalization).
20190509_514_560_angle1_001_RIN_PWF_Ztop_MAX done
20190509_514_560_angle1_001_RIN_PWF done
20190509_514_560_angle1_001_RIN_PWF_Ztop done
D:\SCIENCE\5 Experiments\DO14_telomere-distribution-eG1-S\PSF tests\2019-05-10_OTF\test folder\20190509_514_560_angle1_001.dv
Pseudo-Widefield from raw SI data (with Ratio Intensity Normalization).

Blockquote

Select only images of given format in folder containing other files
#2

Change this

to this

for (i=0; i<list.length; i=i+1)

otherwise the incremented value is not assigned to i

#3

aaah thanks! Duh! I wanted to change the i++ to i=i+1 and forgot to add the i=…
so stupid!
Thanks it works now!!
on to the next one.
Cheers

Debbi