From fdc2b8dc938a443ebc8ecd51cc3d7f31af1d1145 Mon Sep 17 00:00:00 2001 From: Juan Nunez-Iglesias Date: Wed, 9 Apr 2014 19:41:50 +1000 Subject: [PATCH 1/2] Remove is_gray and is_rgb --- skimage/color/__init__.py | 6 +----- skimage/color/colorconv.py | 26 -------------------------- skimage/color/tests/test_colorconv.py | 12 ------------ 3 files changed, 1 insertion(+), 43 deletions(-) diff --git a/skimage/color/__init__.py b/skimage/color/__init__.py index a471fd82..6b589480 100644 --- a/skimage/color/__init__.py +++ b/skimage/color/__init__.py @@ -44,9 +44,7 @@ from .colorconv import (convert_colorspace, rgb_from_ahx, ahx_from_rgb, rgb_from_hpx, - hpx_from_rgb, - is_rgb, - is_gray) + hpx_from_rgb) from .colorlabel import color_dict, label2rgb @@ -100,8 +98,6 @@ __all__ = ['convert_colorspace', 'ahx_from_rgb', 'rgb_from_hpx', 'hpx_from_rgb', - 'is_rgb', - 'is_gray', 'color_dict', 'label2rgb', 'deltaE_cie76', diff --git a/skimage/color/colorconv.py b/skimage/color/colorconv.py index e2c7af17..4ab1e38f 100644 --- a/skimage/color/colorconv.py +++ b/skimage/color/colorconv.py @@ -90,32 +90,6 @@ def guess_spatial_dimensions(image): raise ValueError("Expected 2D, 3D, or 4D array, got %iD." % image.ndim) -@deprecated() -def is_rgb(image): - """Test whether the image is RGB or RGBA. - - Parameters - ---------- - image : ndarray - Input image. - - """ - return (image.ndim == 3 and image.shape[2] in (3, 4)) - - -@deprecated() -def is_gray(image): - """Test whether the image is gray (i.e. has only one color band). - - Parameters - ---------- - image : ndarray - Input image. - - """ - return image.ndim in (2, 3) and not is_rgb(image) - - def convert_colorspace(arr, fromspace, tospace): """Convert an image array to a new color space. diff --git a/skimage/color/tests/test_colorconv.py b/skimage/color/tests/test_colorconv.py index c7393355..4bc01e78 100644 --- a/skimage/color/tests/test_colorconv.py +++ b/skimage/color/tests/test_colorconv.py @@ -35,7 +35,6 @@ from skimage.color import (rgb2hsv, hsv2rgb, lab2rgb, rgb2lab, xyz2luv, luv2xyz, luv2rgb, rgb2luv, - is_rgb, is_gray, lab2lch, lch2lab, guess_spatial_dimensions ) @@ -355,17 +354,6 @@ def test_gray2rgb_rgb(): assert_equal(x, y) -def test_is_rgb(): - color = data.lena() - gray = data.camera() - - assert is_rgb(color) - assert not is_gray(color) - - assert is_gray(gray) - assert not is_gray(color) - - if __name__ == "__main__": from numpy.testing import run_module_suite run_module_suite() From 82e6135e2f8a77fd1ead0e4adede4a8e59456650 Mon Sep 17 00:00:00 2001 From: Juan Nunez-Iglesias Date: Wed, 9 Apr 2014 19:42:29 +1000 Subject: [PATCH 2/2] Remove finished entry from TODO.txt --- TODO.txt | 2 -- 1 file changed, 2 deletions(-) diff --git a/TODO.txt b/TODO.txt index 10dfe117..6a5a4ca2 100644 --- a/TODO.txt +++ b/TODO.txt @@ -23,8 +23,6 @@ Version 0.10 * Remove deprecated parameter `depth` in `skimage.segmentation.random_walker` * Remove deprecated logger function in `skimage/__init__.py` * Remove deprecated function `filter.median_filter` -* Remove deprecated `skimage.color.is_gray` and `skimage.color.is_rgb` - functions * Enable doctests of experimental `skimage.feature.brief` * Remove deprecated `skimage.segmentation.visualize_boundaries` * Remove deprecated `skimage.morphology.greyscale_*`