From d7761bae546355e3b84d8ea48f3acd86c5efb743 Mon Sep 17 00:00:00 2001 From: Andreas Mueller Date: Thu, 29 Sep 2011 13:31:07 +0200 Subject: [PATCH] pep8 whitespace --- scikits/image/util/dtype.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/scikits/image/util/dtype.py b/scikits/image/util/dtype.py index b1b5600d..7a03fd5a 100644 --- a/scikits/image/util/dtype.py +++ b/scikits/image/util/dtype.py @@ -15,6 +15,7 @@ dtype_range = {np.uint8: (0, 255), integer_types = (np.uint8, np.uint16, np.int8, np.int16) + def _convert(image, dtype, prec_loss): """ Convert an image to the requested data-type. @@ -38,7 +39,7 @@ def _convert(image, dtype, prec_loss): if dtype_in == dtype: return image - + if dtype_in in prec_loss: log.warn('Possible precision loss, converting from ' '%s to %s' % (np.dtype(dtype_in), np.dtype(dtype))) @@ -82,6 +83,7 @@ def _convert(image, dtype, prec_loss): return out + def img_as_float(image): """Convert an image to double-precision floating point format. @@ -104,6 +106,7 @@ def img_as_float(image): prec_loss = () return _convert(image, np.float64, prec_loss) + def img_as_uint(image): """Convert an image to 16-bit unsigned integer format. @@ -126,6 +129,7 @@ def img_as_uint(image): prec_loss = (np.float32, np.float64) return _convert(image, np.uint16, prec_loss) + def img_as_int(image): """Convert an image to 16-bit signed integer format. @@ -148,6 +152,7 @@ def img_as_int(image): prec_loss = (np.float32, np.float64, np.uint16) return _convert(image, np.int16, prec_loss) + def img_as_ubyte(image): """Convert an image to 8-bit unsigned integer format.