[SciPy-user] Weird label behaviour in ndimage

Alexander Borghgraef alexander.borghgraef.rma@gmail....
Tue Sep 18 08:59:26 CDT 2007

Sorry about that, shortcut malfunction. Let me rephrase that:
Hi all,

 I'm doing some image treatment using the ndimage module, and I've been
playing a bit with the label
function. I've encountered something very strange:

  a = zeros((5,4))                # a is a numpy.ndarray of int32
  b = ndimage.label(a)[0]     # b is a numpy.ndarray of int32, and basically
identical to a
  ndimage.maximum(a)       # returns 0.0
  ndimage.maximum(b)       # returns the following error message:

/usr/lib/python2.4/site-packages/scipy/ndimage/measurements.py in
maximum(input, labels, index)
    195         if labels.shape != input.shape:
    196             raise RuntimeError, 'input and labels shape are not
--> 197     return _nd_image.statistics(input, labels, index, 4)

RuntimeError: data type not supported

Don't get this. Objects a and b are the same data type, contain the same
data type, print the same, can be
added or multiplied together, but one of both cannot be used as input for
image statistics functions. What
am I missing here?

Alex Borghgraef
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://projects.scipy.org/pipermail/scipy-user/attachments/20070918/00c744b1/attachment.html 

More information about the SciPy-user mailing list