Actually, we should just check the image type early in the function and
abort if it's undesirable.
On Mar 4, 2013 7:09 AM, "Juan Nunez-Iglesias" <notifications@github.com>
wrote:

> In skimage/morphology/misc.py:
>
> > +           [ True,  True,  True, False, False]], dtype=bool)
> > +    >>> d = morphology.remove_small_connected_components(a, 6, in_place=True)
> > +    >>> d is a
> > +    True
> > +    """
> > +    structuring_element = nd.generate_binary_structure(ar.ndim, connectivity)
> > +    if in_place:
> > +        out = ar
> > +    else:
> > +        out = ar.copy()
> > +    if min_size == 0: # shortcut for efficiency
> > +        return out
> > +    if out.dtype == bool:
> > +        ccs = nd.label(ar, structuring_element)[0]
> > +    else:
> > +        ccs = out
>
>  ................ so if it's a type error, say it's a type error, if it's
> a value error say it's a value error .....?
>
> Well, at that point I might as well just let the errors propagate up, as I
> am currently doing. =) The idea, I think, is to only let the errors you
> don't understand propagate up, while the ones you do (and expect to be
> relatively common, such as someone giving us a float image), you generate a
> custom error message for.
>
> Hence why I want to use the second syntax @stefanv<https://github.com/stefanv>suggested, but he said it's not desired... So I want to know why.
>
> —
> Reply to this email directly or view it on GitHub<https://github.com/scikit-image/scikit-image/pull/446/files#r3219990>
> .
>