watershed issue

Tony Yu tsyu80 at gmail.com
Fri Dec 30 11:22:18 EST 2011


On Fri, Dec 30, 2011 at 8:01 AM, Tony Yu <tsyu80 at gmail.com> wrote:

>
>
> On Fri, Dec 30, 2011 at 5:39 AM, jip <jeanpatrick.pommier at gmail.com>wrote:
>
>> Dear Emmanuelle,
>>
>> Sorry for the delay.
>> I have rewritten a clearer script
>> <https://docs.google.com/open?id=0B-YDFMbEy1grODU1Y2U0OTgtMzk1MS00MzkxLTliOWItYmMyOTNlOGI3ODRj>I
>> hope.
>> First, it takes a 12bits image<https://docs.google.com/open?id=0B-YDFMbEy1grNWJlYTkwYzYtMjk0ZS00NGVlLWFjMzktMmU3OWU1ODgwMDhm>(cy3 in the archive), isolates a region andremoves the background<https://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 here<http://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
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/scikit-image/attachments/20111230/876f6e41/attachment.html>


More information about the scikit-image mailing list