Hi,

Regarding the bug you mentioned, I just proposed a fix:
https://github.com/scikit-image/scikit-image/issues/803

I found the bug by noticing that the variable "age" was incremented without being used.

Of course, as Emmanuelle mentioned, the bug is also in the CellProfiler code, who might be interested in the fix (CC-ed).

Kind Regards,

Kevin 

On Wednesday, May 20, 2015 at 3:13:55 PM UTC+1, Emmanuelle wrote:
Hi Daniel,

you might want to ask the question on the cell profiler mailing-list as
well since it's their implementation that was included in scikit-image
(cellprofiler-dev <cellprof...@broadinstitute.org>).

Cheers
Emmanuelle

On Wed, May 20, 2015 at 04:06:52PM +1000, Juan Nunez-Iglesias wrote:
> Hi Daniel,

> Actually there's a known bug [1]_ in the scikit-image implementation (which is
> originally from CellProfiler). I haven't figured it out yet, nor do I know what
> the exact differences are to the paper. (And most images are unaffected.) Are
> you looking to use the implementation or are you trying to implement your own
> as a learning strategy? If the latter, you might want to have a look at my own
> implementation [2]_ in gala, for which I tried to follow the paper exactly. But
> it's way slower.

> Juan.

> .. [1] https://github.com/scikit-image/scikit-image/issues/803
> .. [2] https://github.com/janelia-flyem/gala/blob/master/gala/morpho.py#L212

> On Wed, May 20, 2015 at 7:00 AM, Daniel Bliss <daniel....@gmail.com> wrote:

>     Hi all,

>     I'm trying to implement the watershed algorithm described in this paper in
>     Python.  Looking at the watershed function in skimage.morphology, it's not
>     clear to me whether this function is an exact implementation of Vincent &
>     Soille's method.  The docstring for morphology says, "Some ideas taken from
>     . . ." and lists an older (by one year) paper by Soille.  "Some ideas"
>     seems to suggest that the implementation is not exact, but where the
>     differences are is not clear.  I've read through the morphology source
>     code, as well as the C code it draws upon, but I'm getting tangled up
>     trying to translate between Vincent and Soille's description and the C/
>     Python code in skimage.  Can anyone provide a clear and complete
>     explanation of what exactly skimage.morphology.watershed does relative to
>     the Vincent and Soille 1991 method?

>     Many thanks,
>     Dan