BUG: Recast label output to satisfy ndimage on 32-bit platforms.

This commit is contained in:
Stefan van der Walt
2013-03-01 18:00:58 +02:00
parent 9e10ea75e5
commit 6e0112f449
+5 -1
View File
@@ -214,4 +214,8 @@ def label(input, DTYPE_t neighbors=8, DTYPE_t background=-1):
else:
data[i, j] = data_p[forest[i, j]]
return data
# Work around a bug in ndimage's type checking on 32-bit platforms
if data.dtype == np.int32:
return data.view(np.int32)
else:
return data