On Fri, Dec 30, 2011 at 5:39 AM, jip <jeanpatrick.pommier@gmail.com> wrote:
Dear Emmanuelle,

Sorry for the delay.
I have rewritten a clearer script I hope.
First, it takes a 12bits image (cy3 in the archive), isolates a region and removes the background.
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 here, 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