From 5a43e0306100fc8f5109000f6708a265853bf972 Mon Sep 17 00:00:00 2001 From: Juan Nunez-Iglesias Date: Mon, 20 May 2013 16:55:07 +1000 Subject: [PATCH] Bug fix: add z dimension regardless of multichannel --- skimage/segmentation/slic_superpixels.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/skimage/segmentation/slic_superpixels.py b/skimage/segmentation/slic_superpixels.py index 43639f16..35e00a34 100644 --- a/skimage/segmentation/slic_superpixels.py +++ b/skimage/segmentation/slic_superpixels.py @@ -93,7 +93,7 @@ def slic(image, n_segments=100, ratio=10., max_iter=10, sigma=1, image = img_as_float(image) if not multichannel: image = gray2rgb(image) - elif image.ndim == 3: + if image.ndim == 3: # See 2D RGB image as 3D RGB image with Z = 1 image = image[np.newaxis, ...] if not isinstance(sigma, coll.Iterable):