On Fri, Dec 30, 2011 at 8:01 AM, Tony Yu tsyu80@gmail.com wrote:
On Fri, Dec 30, 2011 at 5:39 AM, jip jeanpatrick.pommier@gmail.comwrote:
Dear Emmanuelle,
Sorry for the delay. I have rewritten a clearer script https://docs.google.com/open?id=0B-YDFMbEy1grODU1Y2U0OTgtMzk1MS00MzkxLTliOWItYmMyOTNlOGI3ODRjI hope. First, it takes a 12bits imagehttps://docs.google.com/open?id=0B-YDFMbEy1grNWJlYTkwYzYtMjk0ZS00NGVlLWFjMzktMmU3OWU1ODgwMDhm(cy3 in the archive), isolates a region andremoves the backgroundhttps://docs.google.com/open?id=0B-YDFMbEy1grNDZjOWZjZjAtMGVmMS00ZTM2LTgwYzctMjZkM2JiMjFmYjBh . Regional maxima are found to get markers for watershed. Three kind of maps are also prepared. Each map, with the markers image, is submitted to the watershed algorithm.Segmentation is performed with watershed as indicated herehttp://scikits-image.org/docs/dev/auto_examples/plot_watershed.html#example-plot-watershed-py, as follow: segmentation=watershed(map,markers,mask) map:grayscale image markers:label image mask:binary image
There's a small typo here: watershed should be called as:
watershed(map, makers, mask=mask)
More specifically, in your code, you have:
sk.morphology.watershed(bassin_hi,markers,top>30)
but it should be called as:
sk.morphology.watershed(bassin_hi,markers,mask=top>30)
Without specifying `mask=`, you're setting the connectivity parameter in watershed. Even with this correction, something seems to be off since watershed seems to return blank images. Without the masks, it gives what I would expect. I'm not sure what's going on the masked output.
-Tony
Actually, I think this masked output is correct: All the markers seem to land in the masked-out regions.
mask = top > 30 print np.any(marker * mask)
False
-Tony