From 24bab75dc340b2ca109e4301eebe25bbfd27ace9 Mon Sep 17 00:00:00 2001 From: Juan Nunez-Iglesias Date: Fri, 17 Jun 2016 17:56:52 -0400 Subject: [PATCH] Check types with issubdtype --- skimage/feature/texture.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/skimage/feature/texture.py b/skimage/feature/texture.py index 0669de37..689baa5c 100644 --- a/skimage/feature/texture.py +++ b/skimage/feature/texture.py @@ -116,8 +116,7 @@ def greycomatrix(image, distances, angles, levels=None, symmetric=False, "other than uint8. The resulting matrix will be at " "least levels ** 2 in size.") - if (image.dtype in (np.int8, np.int16, np.int32, np.int64) and - np.any(image < 0)): + if np.issubdtype(image.dtype, np.signedinteger) and np.any(image < 0): raise ValueError("Negative-valued images are not supported.") if levels is None: