Skip to content

Commit

Permalink
Raise warning for sigma parameter and add to TODO for next release
Browse files Browse the repository at this point in the history
  • Loading branch information
ahojnnes committed Sep 16, 2013
1 parent 06e99a5 commit 88d84c7
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 12 deletions.
18 changes: 9 additions & 9 deletions TODO.txt
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
Version 0.10
------------
* Remove deprecated functions:
- ``skimage.filter.rank.*``
* Remove deprecated parameter ``epsilon`` of ``skimage.viewer.LineProfile``
* Remove backwards-compatability of ``skimage.measure.regionprops``
* Remove deprecated functions in `skimage.filter.rank.*`
* Remove deprecated parameter `epsilon` of `skimage.viewer.LineProfile`
* Remove backwards-compatability of `skimage.measure.regionprops`
* Remove {`ratio`, `sigma`} deprecation warnings of `skimage.segmentation.slic`

Version 0.9
-----------
* Remove deprecated functions
- ``skimage.filter.denoise_tv_chambolle``
- ``skimage.morphology.is_local_maximum``
- ``skimage.transform.hough``
- ``skimage.transform.probabilistic_hough``
- ``skimage.transform.hough_peaks``
- `skimage.filter.denoise_tv_chambolle`
- `skimage.morphology.is_local_maximum`
- `skimage.transform.hough`
- `skimage.transform.probabilistic_hough`
- `skimage.transform.hough_peaks`
10 changes: 7 additions & 3 deletions skimage/segmentation/slic_superpixels.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
from skimage.color import rgb2lab


def slic(image, n_segments=100, compactness=10., max_iter=10, sigma=0,
def slic(image, n_segments=100, compactness=10., max_iter=10, sigma=None,
multichannel=True, convert2lab=True, ratio=None):
"""Segments image using k-means clustering in Color-(x,y,z) space.
Expand Down Expand Up @@ -80,9 +80,13 @@ def slic(image, n_segments=100, compactness=10., max_iter=10, sigma=0,
>>> segments = slic(img, n_segments=100, ratio=20)
"""

if sigma is None:
warnings.warn('Default value of keyword `sigma` changed from ``1`` '
'to ``0``.')
sigma = 0
if ratio is not None:
msg = 'Keyword `ratio` is deprecated. Use `compactness` instead.'
warnings.warn(msg)
warnings.warn('Keyword `ratio` is deprecated. Use `compactness` '
'instead.')
compactness = ratio

image = img_as_float(image)
Expand Down

0 comments on commit 88d84c7

Please sign in to comment.