Bug fix: spatial vs image dimension comparison reversed

This commit is contained in:
Juan Nunez-Iglesias
2013-05-20 17:05:59 +10:00
parent 5a43e03061
commit 55fe6ce2d6
+1 -1
View File
@@ -85,7 +85,7 @@ def slic(image, n_segments=100, ratio=10., max_iter=10, sigma=1,
warnings.warn(RuntimeWarning(msg))
multichannel = True
elif multichannel is None:
multichannel = (spatial_dims == image.ndim + 1)
multichannel = (spatial_dims + 1 == image.ndim)
if ((not multichannel and image.ndim not in [2, 3]) or
(multichannel and image.ndim not in [3, 4]) or
(multichannel and image.shape[-1] != 3)):