dir = getDirectory("Choose a Directory");
for (i=0;i selectImage(i+1);
//create Lamp1 lysosome mask and analyse particles - change C3 to the channel that is used to visualize LAMP1
selectWindow("C3-" + title);
run("Subtract Background...", "rolling=50 slice");
run("Median...", "radius=0.5");
setAutoThreshold("Otsu dark no-reset");
setOption("BlackBackground", true);
//Make sure to check with a raw image if you agree with the mask
run("Convert to Mask", "method=Otsu background=Dark only black");
run("Analyze Particles...", "display exclude summarize overlay composite");
saveAs("CSV", dir+"Results" + title);
saveAs("CSV", dir+"Summary");