Just process the edge-touching and interior particles separately. You can get an image with only the edge-touching particles by XORing the image with all particles and the image with touching particles excluded.
This macro creates three images: one with all particles, one without edge-touching particles and one with only the edge-touching particles:
run("Blobs (25K)");
setThreshold(126, 255);
run("Analyze Particles...", "size=0.01-Infinity circularity=0.00-1.00 show=Masks clear");
rename("all");
run("Analyze Particles...", "size=0.01-Infinity circularity=0.00-1.00 show=Masks exclude clear");
rename("not touching");
imageCalculator("XOR create", "all","not touching");
rename("touching");
You can then analyze each of them separately and add a marker:
selectWindow("touching");
run("Analyze Particles...", "size=0.01-Infinity circularity=0.00-1.00 show=Outlines display clear in_situ");
for(row = 0; row < nResults; row++){
setResult("touching", row, "*");
}
selectWindow("not touching");
run("Analyze Particles...", "size=0.01-Infinity circularity=0.00-1.00 show=Outlines display in_situ");