Pull request: morphology fix

Stéfan van der Walt stefan at sun.ac.za
Tue Oct 18 18:50:34 EDT 2011


On Tue, Oct 18, 2011 at 12:53 PM, Tony Yu <tsyu80 at gmail.com> wrote:
> I'm definitely in favor of not requiring specific input dtypes.
> Unfortunately, I believe a lot of extensions assume uint8 (at least those in
> the cmorph.pyx do). Since img_as_uint casts values to uint16, should these
> functions be written to use uint16? Also, are there ways to write fast
> Cython extensions without specifying dtypes?

Unfortunately, I don't know of any way to write type-agnostic code
with Cython (it is very high on my wish-list).  I've even considered
whether we should use C++ to template code, and then simply wrap that
in Cython.

Does anyone here have experience with such approaches?

As for this specific problem, I think it's best to use uint16 or float
as computation types where possible.

Regards
Stéfan



More information about the scikit-image mailing list