From 69fb3fb7ba12055a0378330b26a3186e6638c615 Mon Sep 17 00:00:00 2001 From: Juan Nunez-Iglesias Date: Thu, 30 May 2013 13:37:59 +1000 Subject: [PATCH] Make means array contiguous for numpy <= 1.6.1 --- skimage/segmentation/slic_superpixels.py | 1 + 1 file changed, 1 insertion(+) diff --git a/skimage/segmentation/slic_superpixels.py b/skimage/segmentation/slic_superpixels.py index 1c9b8510..a4e949fd 100644 --- a/skimage/segmentation/slic_superpixels.py +++ b/skimage/segmentation/slic_superpixels.py @@ -117,6 +117,7 @@ def slic(image, n_segments=100, ratio=10., max_iter=10, sigma=1, means = np.concatenate([means_z[..., np.newaxis], means_y[..., np.newaxis], means_x[..., np.newaxis], means_color ], axis=-1).reshape(-1, 6) + means = np.ascontiguousarray(means) # we do the scaling of ratio in the same way as in the SLIC paper # so the values have the same meaning ratio = (ratio / float(max((step_z, step_y, step_x)))) ** 2