scikits-image/scikits-image — pull request #121 by tonysyu (2012-02-04 19:35:09+00:00)
Title: Dtype convert updates

Multiple changes to `skimage.util.dtype.convert`. Note: this PR does not implement the proposed clipping change for conversion from int to uint.

Summary:

* Fix casting error (only arises in development versions of Numpy)

* Add tests for full coverage.

* Assert that float images are between 0 and 1.

* Fix test which used a float image exceeding 0 to 1 range.

* Rename `_convert` to `convert` since this function will be used internally to convert to types not supported by `img_as_float`, `img_as_byte`, etc. For example, `match_template` is implemented in Cython with float32 values for speed. I did not really make `convert` public (i.e. I did not add it to `__all__`), but I'm inclined to do so (although the name might be a bit ambiguous for a public method).