From 15c298915871f5d7b88776274b2d63c22efd1f91 Mon Sep 17 00:00:00 2001 From: Guillem Palou Visa Date: Fri, 17 Jan 2014 16:52:44 +0100 Subject: [PATCH] Added deprecation warning --- TODO.txt | 3 ++- skimage/segmentation/slic_superpixels.py | 7 ++++++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/TODO.txt b/TODO.txt index 4fe8e90d..bbf248be 100644 --- a/TODO.txt +++ b/TODO.txt @@ -1,7 +1,8 @@ Version 0.11 ------------ * Remove deprecated `reverse_map` parameter of `skimage.transform.warp` - +* Change depecrated `enforce_connectivity=False`on skimage.segmentation.slic + and set it to True as default Version 0.10 ------------ diff --git a/skimage/segmentation/slic_superpixels.py b/skimage/segmentation/slic_superpixels.py index bea7c7e2..9be5aa62 100644 --- a/skimage/segmentation/slic_superpixels.py +++ b/skimage/segmentation/slic_superpixels.py @@ -48,7 +48,7 @@ def slic(image, n_segments=100, compactness=10., max_iter=10, sigma=None, recommended. ratio : float, optional Synonym for `compactness`. This keyword is deprecated. - enforce_connectivity: bool, optional + enforce_connectivity: bool, optional (default False) Whether the generated segments are connected or not min_size_factor: float, optional Proportion of the minimum segment size to be removed with respect @@ -112,6 +112,11 @@ def slic(image, n_segments=100, compactness=10., max_iter=10, sigma=None, 'instead.') compactness = ratio + if enforce_connectivity is None: + warnings.warn('Deprecation: enforce_connectivity will default to' + ' True in future versions.') + enforce_connectivity = False + image = img_as_float(image) is_2d = False if image.ndim == 2: