From 8ecadf175c7b8212e7520a477dfc932d2f9e92b9 Mon Sep 17 00:00:00 2001 From: Ankit Agrawal Date: Fri, 7 Jun 2013 11:16:26 +0800 Subject: [PATCH] Replacing every occurence of substract* with subtract* --- skimage/filter/rank/__init__.py | 8 ++++---- skimage/filter/rank/_crank16.pyx | 6 +++--- skimage/filter/rank/_crank16_percentiles.pyx | 6 +++--- skimage/filter/rank/_crank8.pyx | 6 +++--- skimage/filter/rank/_crank8_percentiles.pyx | 6 +++--- skimage/filter/rank/percentile_rank.pyx | 16 ++++++++-------- skimage/filter/rank/rank.pyx | 10 +++++----- skimage/filter/rank/tests/test_rank.py | 2 +- 8 files changed, 30 insertions(+), 30 deletions(-) diff --git a/skimage/filter/rank/__init__.py b/skimage/filter/rank/__init__.py index 8f632469..906566b7 100644 --- a/skimage/filter/rank/__init__.py +++ b/skimage/filter/rank/__init__.py @@ -1,8 +1,8 @@ from .rank import (autolevel, bottomhat, equalize, gradient, maximum, mean, - meansubstraction, median, minimum, modal, morph_contr_enh, + meansubtraction, median, minimum, modal, morph_contr_enh, pop, threshold, tophat, noise_filter, entropy, otsu) from .percentile_rank import (percentile_autolevel, percentile_gradient, - percentile_mean, percentile_mean_substraction, + percentile_mean, percentile_mean_subtraction, percentile_morph_contr_enh, percentile, percentile_pop, percentile_threshold) from .bilateral_rank import bilateral_mean, bilateral_pop @@ -14,7 +14,7 @@ __all__ = ['autolevel', 'gradient', 'maximum', 'mean', - 'meansubstraction', + 'meansubtraction', 'median', 'minimum', 'modal', @@ -28,7 +28,7 @@ __all__ = ['autolevel', 'percentile_autolevel', 'percentile_gradient', 'percentile_mean', - 'percentile_mean_substraction', + 'percentile_mean_subtraction', 'percentile_morph_contr_enh', 'percentile', 'percentile_pop', diff --git a/skimage/filter/rank/_crank16.pyx b/skimage/filter/rank/_crank16.pyx index 232d6812..e704afe0 100644 --- a/skimage/filter/rank/_crank16.pyx +++ b/skimage/filter/rank/_crank16.pyx @@ -126,7 +126,7 @@ cdef inline dtype_t kernel_mean(Py_ssize_t * histo, float pop, return (0) -cdef inline dtype_t kernel_meansubstraction(Py_ssize_t * histo, +cdef inline dtype_t kernel_meansubtraction(Py_ssize_t * histo, float pop, dtype_t g, Py_ssize_t bitdepth, @@ -341,12 +341,12 @@ def mean(cnp.ndarray[dtype_t, ndim=2] image, bitdepth, 0, 0, 0, 0) -def meansubstraction(cnp.ndarray[dtype_t, ndim=2] image, +def meansubtraction(cnp.ndarray[dtype_t, ndim=2] image, cnp.ndarray[cnp.uint8_t, ndim=2] selem, cnp.ndarray[cnp.uint8_t, ndim=2] mask=None, cnp.ndarray[dtype_t, ndim=2] out=None, char shift_x=0, char shift_y=0, Py_ssize_t bitdepth=8): - _core16(kernel_meansubstraction, image, selem, mask, out, shift_x, shift_y, + _core16(kernel_meansubtraction, image, selem, mask, out, shift_x, shift_y, bitdepth, 0, 0, 0, 0) diff --git a/skimage/filter/rank/_crank16_percentiles.pyx b/skimage/filter/rank/_crank16_percentiles.pyx index 15dabe72..f4a4c9b2 100644 --- a/skimage/filter/rank/_crank16_percentiles.pyx +++ b/skimage/filter/rank/_crank16_percentiles.pyx @@ -103,7 +103,7 @@ cdef inline dtype_t kernel_mean(Py_ssize_t * histo, float pop, return (0) -cdef inline dtype_t kernel_mean_substraction(Py_ssize_t * histo, +cdef inline dtype_t kernel_mean_subtraction(Py_ssize_t * histo, float pop, dtype_t g, Py_ssize_t bitdepth, @@ -269,7 +269,7 @@ def mean(cnp.ndarray[dtype_t, ndim=2] image, bitdepth, p0, p1, 0, 0) -def mean_substraction(cnp.ndarray[dtype_t, ndim=2] image, +def mean_subtraction(cnp.ndarray[dtype_t, ndim=2] image, cnp.ndarray[cnp.uint8_t, ndim=2] selem, cnp.ndarray[cnp.uint8_t, ndim=2] mask=None, cnp.ndarray[dtype_t, ndim=2] out=None, @@ -278,7 +278,7 @@ def mean_substraction(cnp.ndarray[dtype_t, ndim=2] image, """return original - mean between [p0 and p1] percentiles *.5 +127 """ _core16( - kernel_mean_substraction, image, selem, mask, out, shift_x, shift_y, + kernel_mean_subtraction, image, selem, mask, out, shift_x, shift_y, bitdepth, p0, p1, 0, 0) diff --git a/skimage/filter/rank/_crank8.pyx b/skimage/filter/rank/_crank8.pyx index cb7febac..da511790 100644 --- a/skimage/filter/rank/_crank8.pyx +++ b/skimage/filter/rank/_crank8.pyx @@ -123,7 +123,7 @@ cdef inline dtype_t kernel_mean(Py_ssize_t * histo, float pop, return (0) -cdef inline dtype_t kernel_meansubstraction(Py_ssize_t * histo, float pop, +cdef inline dtype_t kernel_meansubtraction(Py_ssize_t * histo, float pop, dtype_t g, float p0, float p1, Py_ssize_t s0, Py_ssize_t s1): @@ -384,12 +384,12 @@ def mean(cnp.ndarray[dtype_t, ndim=2] image, 0, 0, 0, 0) -def meansubstraction(cnp.ndarray[dtype_t, ndim=2] image, +def meansubtraction(cnp.ndarray[dtype_t, ndim=2] image, cnp.ndarray[dtype_t, ndim=2] selem, cnp.ndarray[dtype_t, ndim=2] mask=None, cnp.ndarray[dtype_t, ndim=2] out=None, char shift_x=0, char shift_y=0): - _core8(kernel_meansubstraction, image, selem, mask, out, shift_x, shift_y, + _core8(kernel_meansubtraction, image, selem, mask, out, shift_x, shift_y, 0, 0, 0, 0) diff --git a/skimage/filter/rank/_crank8_percentiles.pyx b/skimage/filter/rank/_crank8_percentiles.pyx index 1a71e0fa..8e5cee9c 100644 --- a/skimage/filter/rank/_crank8_percentiles.pyx +++ b/skimage/filter/rank/_crank8_percentiles.pyx @@ -94,7 +94,7 @@ cdef inline dtype_t kernel_mean(Py_ssize_t * histo, float pop, return (0) -cdef inline dtype_t kernel_mean_substraction(Py_ssize_t * histo, +cdef inline dtype_t kernel_mean_subtraction(Py_ssize_t * histo, float pop, dtype_t g, float p0, float p1, @@ -239,14 +239,14 @@ def mean(cnp.ndarray[dtype_t, ndim=2] image, 0, 0) -def mean_substraction(cnp.ndarray[dtype_t, ndim=2] image, +def mean_subtraction(cnp.ndarray[dtype_t, ndim=2] image, cnp.ndarray[dtype_t, ndim=2] selem, cnp.ndarray[dtype_t, ndim=2] mask=None, cnp.ndarray[dtype_t, ndim=2] out=None, char shift_x=0, char shift_y=0, float p0=0., float p1=0.): """return original - mean between [p0 and p1] percentiles *.5 +127 """ - _core8(kernel_mean_substraction, image, selem, mask, out, shift_x, shift_y, + _core8(kernel_mean_subtraction, image, selem, mask, out, shift_x, shift_y, p0, p1, 0, 0) diff --git a/skimage/filter/rank/percentile_rank.pyx b/skimage/filter/rank/percentile_rank.pyx index 4b3cace4..704f53c2 100644 --- a/skimage/filter/rank/percentile_rank.pyx +++ b/skimage/filter/rank/percentile_rank.pyx @@ -29,7 +29,7 @@ from skimage.filter.rank import _crank16_percentiles, _crank8_percentiles __all__ = ['percentile_autolevel', 'percentile_gradient', - 'percentile_mean', 'percentile_mean_substraction', + 'percentile_mean', 'percentile_mean_subtraction', 'percentile_morph_contr_enh', 'percentile', 'percentile_pop', 'percentile_threshold'] @@ -191,11 +191,11 @@ def percentile_mean(image, selem, out=None, mask=None, shift_x=False, shift_y=shift_y, p0=p0, p1=p1) -def percentile_mean_substraction(image, selem, out=None, mask=None, +def percentile_mean_subtraction(image, selem, out=None, mask=None, shift_x=False, shift_y=False, p0=.0, p1=1.): - """Return greyscale local mean_substraction of an image. + """Return greyscale local mean_subtraction of an image. - mean_substraction is computed on the given structuring element. Only levels + mean_subtraction is computed on the given structuring element. Only levels between percentiles [p0, p1] are used. Parameters @@ -221,13 +221,13 @@ def percentile_mean_substraction(image, selem, out=None, mask=None, Returns ------- - local mean_substraction : uint8 array or uint16 - The result of the local mean_substraction. + local mean_subtraction : uint8 array or uint16 + The result of the local mean_subtraction. """ - return _apply(_crank8_percentiles.mean_substraction, - _crank16_percentiles.mean_substraction, + return _apply(_crank8_percentiles.mean_subtraction, + _crank16_percentiles.mean_subtraction, image, selem, out=out, mask=mask, shift_x=shift_x, shift_y=shift_y, p0=p0, p1=p1) diff --git a/skimage/filter/rank/rank.pyx b/skimage/filter/rank/rank.pyx index 2ef5484e..559f1c76 100644 --- a/skimage/filter/rank/rank.pyx +++ b/skimage/filter/rank/rank.pyx @@ -23,7 +23,7 @@ from skimage.filter.rank.generic import find_bitdepth __all__ = ['autolevel', 'bottomhat', 'equalize', 'gradient', 'maximum', 'mean', - 'meansubstraction', 'median', 'minimum', 'modal', 'morph_contr_enh', + 'meansubtraction', 'median', 'minimum', 'modal', 'morph_contr_enh', 'pop', 'threshold', 'tophat', 'noise_filter', 'entropy', 'otsu'] @@ -298,9 +298,9 @@ def mean(image, selem, out=None, mask=None, shift_x=False, shift_y=False): mask=mask, shift_x=shift_x, shift_y=shift_y) -def meansubstraction(image, selem, out=None, mask=None, shift_x=False, +def meansubtraction(image, selem, out=None, mask=None, shift_x=False, shift_y=False): - """Return image substracted from its local mean. + """Return image subtracted from its local mean. Parameters ---------- @@ -323,11 +323,11 @@ def meansubstraction(image, selem, out=None, mask=None, shift_x=False, Returns ------- out : uint8 array or uint16 array (same as input image) - The result of the local meansubstraction. + The result of the local meansubtraction. """ - return _apply(_crank8.meansubstraction, _crank16.meansubstraction, image, + return _apply(_crank8.meansubtraction, _crank16.meansubtraction, image, selem, out=out, mask=mask, shift_x=shift_x, shift_y=shift_y) diff --git a/skimage/filter/rank/tests/test_rank.py b/skimage/filter/rank/tests/test_rank.py index 62363675..1cfb92fe 100644 --- a/skimage/filter/rank/tests/test_rank.py +++ b/skimage/filter/rank/tests/test_rank.py @@ -195,7 +195,7 @@ def test_compare_8bit_vs_16bit(): assert_array_equal(image8, image16) methods = ['autolevel', 'bottomhat', 'equalize', 'gradient', 'maximum', - 'mean', 'meansubstraction', 'median', 'minimum', 'modal', + 'mean', 'meansubtraction', 'median', 'minimum', 'modal', 'morph_contr_enh', 'pop', 'threshold', 'tophat'] for method in methods: