[Scipy-svn] r6840 - trunk/scipy/ndimage

scipy-svn@scip... scipy-svn@scip...
Thu Oct 14 10:39:06 CDT 2010


Author: stefan
Date: 2010-10-14 10:39:06 -0500 (Thu, 14 Oct 2010)
New Revision: 6840

Modified:
   trunk/scipy/ndimage/measurements.py
Log:
BUG: ndimage: Integer check must take uints into account.

Modified: trunk/scipy/ndimage/measurements.py
===================================================================
--- trunk/scipy/ndimage/measurements.py	2010-10-14 15:38:36 UTC (rev 6839)
+++ trunk/scipy/ndimage/measurements.py	2010-10-14 15:39:06 UTC (rev 6840)
@@ -309,8 +309,8 @@
     # remap labels to unique integers if necessary, or if the largest
     # label is larger than the number of values.
 
-    if ((not numpy.issubdtype(labels.dtype, numpy.int)) or
-        (labels.min() < 0) or (labels.max() > labels.size)):
+    if not numpy.issubdtype(labels.dtype, (numpy.int, np.unsignedinteger)) or \
+           (labels.min() < 0) or (labels.max() > labels.size):
         unique_labels, new_labels = numpy.unique1d(labels, return_inverse=True)
 
         if centered:



More information about the Scipy-svn mailing list