From 375079e82f48456286c89d537da7f0324ce19380 Mon Sep 17 00:00:00 2001 From: andy Date: Tue, 27 Sep 2011 23:51:14 +0200 Subject: [PATCH] don't use np.empty_like with dtype argument to be numpy 1.5 compatible. --- scikits/image/util/dtype.py | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/scikits/image/util/dtype.py b/scikits/image/util/dtype.py index 7e86892a..b859f044 100644 --- a/scikits/image/util/dtype.py +++ b/scikits/image/util/dtype.py @@ -75,9 +75,7 @@ def _convert(image, dtype, prec_loss): # Do scaling/shifting calculations in floating point image = image.astype(np.float64) - out = np.empty_like(image, dtype=dtype) - - out[:] = round_fn((image - imin) * scale + shift) + out = round_fn((image - imin) * scale + shift).astype(dtype) return out