Hello, I would like to a inquire about a problem I encountered using the analyze particles and watershed function to segment overlapping particles. Although I use exactly the same settings the analyze particles function encounters on a picture without watershed segmentation all particles, while I run the analyze particles function with watershed a particle is mysteriously missed. I checked, but the error is definitely not due to any exclusion of particles because of size constraints nor edge exclusion. Maybe you have an explanation for this...
You can find the two overlayed pictures here:
without watershed:
http://dl.dropbox.com/u/10373933/without%20watershed.jpgwith watershed:
http://dl.dropbox.com/u/10373933/with%20watershed.jpgThe particle missed while running particle analysis without watershed is number 519 on the no watershed picture.
The partial macro code we use is the following, with the watershed either activated or not:
// input parameter values
dir1 = getDirectory("Choose Picture Source Directory ");
dir2 = getDirectory("Choose Results Destination Directory ");
thresh = getNumber("Choose Black and White threshold value ", 140);
min = round(getString("Choose minimum cell size:", 100));
max = round(getString("Choose maximum cell size:", 10000));
overlay = getBoolean("Produce overlaid picture ?");
....
// threshold and invert composite picture
selectWindow("Result of "+replace(list[i],".JPG",""));
setThreshold(0, thresh, "black & white");
run("Convert to Mask");
run("Invert");
// use watershed algorithm to divide overlapping cells
run("Watershed");
// run particle analysis
run("Set Measurements...", "mean standard deviation min max area perimeter center fit invert redirect="+list[i]+" decimal=3");
selectWindow("Result of "+replace(list[i],".JPG",""));
run("Analyze Particles...", "size="+min+"-"+max+" circularity=0.00-1.00 show=Outlines exclude include");
selectWindow(list[i]);
close();
Is it a bug or do I miss something?
Thanks a lot for helping!
Best regards,
Frank