[Scipy-svn] r2965 - trunk/Lib/ndimage

scipy-svn at scipy.org scipy-svn at scipy.org
Sat May 5 05:26:27 EDT 2007


Author: stefan
Date: 2007-05-05 04:26:12 -0500 (Sat, 05 May 2007)
New Revision: 2965

Modified:
   trunk/Lib/ndimage/measurements.py
Log:
Fix scalar conversion on 64-bit platforms.


Modified: trunk/Lib/ndimage/measurements.py
===================================================================
--- trunk/Lib/ndimage/measurements.py	2007-05-05 09:11:47 UTC (rev 2964)
+++ trunk/Lib/ndimage/measurements.py	2007-05-05 09:26:12 UTC (rev 2965)
@@ -116,7 +116,11 @@
         if labels.shape != input.shape:
             raise RuntimeError, 'input and labels shape are not equal'
     if index is not None:
-        index = numpy.asarray(index)
+        if numpy.isscalar(index):
+            index = numpy.asarray(index,dtype=numpy.uint32)
+        else:
+            index = numpy.asarray(index)
+
         if numpy.issubsctype(index.dtype,numpy.int64) or \
                numpy.issubsctype(index.dtype,numpy.uint64):
             raise ValueError("Index values cannot be of type int64/uint64.")




More information about the Scipy-svn mailing list