Fix label casting for numpy 1.7.

This commit is contained in:
Stefan van der Walt
2013-06-28 16:19:49 -05:00
parent 504ad94dc6
commit eb66e34351
+2 -1
View File
@@ -66,7 +66,8 @@ def remove_small_objects(ar, min_size=64, connectivity=1, in_place=False):
if out.dtype == bool:
selem = nd.generate_binary_structure(ar.ndim, connectivity)
ccs = nd.label(ar, selem)[0]
ccs = np.zeros_like(ar, dtype=np.int)
nd.label(ar, selem, output=ccs)
else:
ccs = out