added test: labelled image must be of integer type

This commit is contained in:
Johannes Schönberger
2012-05-22 23:28:12 +02:00
parent 6b0c0e1948
commit 0027b91e84
+3
View File
@@ -186,6 +186,9 @@ def regionprops(image, properties='all'):
cdef np.ndarray[np.double_t, ndim=2] m, mu, nu
cdef double cr, cc, a, b, c
if not np.issubdtype(image.dtype, 'int'):
raise TypeError('labelled image must be of integer dtype')
# determine all properties if nothing specified
if properties == 'all':
properties = PROPS