diff --git a/doc/__init__.py b/doc/__init__.py new file mode 100644 index 00000000..10b6fb15 --- /dev/null +++ b/doc/__init__.py @@ -0,0 +1 @@ +__author__ = 'olivier' diff --git a/doc/examples/plot_benchmark_rank.py b/doc/examples/applications/plot_benchmark_rank.py similarity index 96% rename from doc/examples/plot_benchmark_rank.py rename to doc/examples/applications/plot_benchmark_rank.py index dab2f8d4..79357768 100644 --- a/doc/examples/plot_benchmark_rank.py +++ b/doc/examples/applications/plot_benchmark_rank.py @@ -19,13 +19,14 @@ import numpy as np import matplotlib.pyplot as plt import time +from scipy.ndimage.filters import percentile_filter + from skimage import data from skimage.morphology import dilation,disk from skimage.filter import median_filter -from scipy.ndimage.filters import percentile_filter -import skimage.rank as rank +import skimage.filter.rank as rank -def log_timing(func): +def exec_and_timeit(func): """ Decorator that returns both function results and execution time (result, ms) """ @@ -38,23 +39,23 @@ def log_timing(func): return wrapper -@log_timing +@exec_and_timeit def cr_med(image,selem): return rank.median(image=image,selem = selem) -@log_timing +@exec_and_timeit def cr_max(image,selem): return rank.maximum(image=image,selem = selem) -@log_timing +@exec_and_timeit def cm_dil(image,selem): return dilation(image=image,selem = selem) -@log_timing +@exec_and_timeit def ctmf_med(image,radius): return median_filter(image=image,radius=radius) -@log_timing +@exec_and_timeit def ndi_med(image,n): return percentile_filter(image,50,size=n*2-1) @@ -84,8 +85,6 @@ def compare_dilate(): plt.title('increasing element size') plt.plot(e_range,rec) plt.legend(['crank.maximum','cmorph.dilate']) - plt.figure() - plt.imshow(np.hstack((rc,rcm))) r = 9 elem = disk(r+1) diff --git a/doc/examples/plot_16bitbilateral.py b/doc/examples/plot_16bitbilateral.py index f61f3c55..076d03c4 100644 --- a/doc/examples/plot_16bitbilateral.py +++ b/doc/examples/plot_16bitbilateral.py @@ -11,7 +11,7 @@ import matplotlib.pyplot as plt from skimage import data from skimage.morphology import disk -import skimage.rank as rank +import skimage.filter.rank as rank a8 = (data.coins()).astype('uint8') @@ -23,11 +23,13 @@ selem = disk(50) f3 = rank.equalize(a16,selem = selem) # display results -fig, axes = plt.subplots(nrows=3, figsize=(15,5)) +fig, axes = plt.subplots(nrows=3, figsize=(15,15)) ax0, ax1, ax2 = axes ax0.imshow(np.hstack((a8,f1))) +ax0.set_title('percentile mean') ax1.imshow(np.hstack((a16,f2))) +ax1.set_title('bilateral mean') ax2.imshow(np.hstack((a16,f3))) - +ax2.set_title('local equalization') plt.show() diff --git a/doc/examples/plot_lena_bilateral_denoise.py b/doc/examples/plot_lena_bilateral_denoise.py index 57593867..969403d0 100644 --- a/doc/examples/plot_lena_bilateral_denoise.py +++ b/doc/examples/plot_lena_bilateral_denoise.py @@ -18,7 +18,7 @@ import numpy as np import matplotlib.pyplot as plt from skimage import data, color, img_as_ubyte -from skimage.rank import bilateral_mean +from skimage.filter.rank import bilateral_mean from skimage.morphology import disk l = img_as_ubyte(color.rgb2gray(data.lena())) diff --git a/doc/examples/plot_local_autolevels.py b/doc/examples/plot_local_autolevels.py index 842215d5..7c750141 100644 --- a/doc/examples/plot_local_autolevels.py +++ b/doc/examples/plot_local_autolevels.py @@ -13,7 +13,7 @@ import numpy as np from skimage import data -from skimage.rank import percentile_autolevel,autolevel +from skimage.filter.rank import percentile_autolevel,autolevel from skimage.morphology import disk diff --git a/doc/examples/plot_local_equalize.py b/doc/examples/plot_local_equalize.py index 897989f0..1a431f5c 100644 --- a/doc/examples/plot_local_equalize.py +++ b/doc/examples/plot_local_equalize.py @@ -17,12 +17,12 @@ The local version [2]_ of the histogram equalization emphasized every local gray from skimage import data from skimage.util.dtype import dtype_range from skimage import exposure -from skimage import rank from skimage.morphology import disk import matplotlib.pyplot as plt import numpy as np +from skimage.filter import rank def plot_img_and_hist(img, axes, bins=256): """Plot an image along with its histogram and cumulative histogram. diff --git a/doc/examples/plot_local_threshold.py b/doc/examples/plot_local_threshold.py index c5810156..8bc79b30 100644 --- a/doc/examples/plot_local_threshold.py +++ b/doc/examples/plot_local_threshold.py @@ -27,7 +27,7 @@ import matplotlib.pyplot as plt from skimage import data from skimage.filter import threshold_otsu, threshold_adaptive -from skimage.rank import threshold,morph_contr_enh +from skimage.filter.rank import threshold,morph_contr_enh from skimage.morphology import disk diff --git a/doc/examples/plot_marked_watershed.py b/doc/examples/plot_marked_watershed.py index 0be25007..738a3d24 100644 --- a/doc/examples/plot_marked_watershed.py +++ b/doc/examples/plot_marked_watershed.py @@ -14,15 +14,14 @@ See Wikipedia_ for more details on the algorithm. """ -import numpy as np from scipy import ndimage import matplotlib.pyplot as plt from skimage.morphology import watershed,disk -from skimage import rank from skimage import data -from scipy import ndimage # original data +from skimage.filter import rank + image = data.camera() # denoise image diff --git a/skimage/rank/README.rst b/skimage/filter/rank/README.rst similarity index 100% rename from skimage/rank/README.rst rename to skimage/filter/rank/README.rst diff --git a/skimage/rank/__init__.py b/skimage/filter/rank/__init__.py similarity index 100% rename from skimage/rank/__init__.py rename to skimage/filter/rank/__init__.py diff --git a/skimage/rank/_core16.pxd b/skimage/filter/rank/_core16.pxd similarity index 100% rename from skimage/rank/_core16.pxd rename to skimage/filter/rank/_core16.pxd diff --git a/skimage/rank/_core16.pyx b/skimage/filter/rank/_core16.pyx similarity index 100% rename from skimage/rank/_core16.pyx rename to skimage/filter/rank/_core16.pyx diff --git a/skimage/rank/_core8.pxd b/skimage/filter/rank/_core8.pxd similarity index 100% rename from skimage/rank/_core8.pxd rename to skimage/filter/rank/_core8.pxd diff --git a/skimage/rank/_core8.pyx b/skimage/filter/rank/_core8.pyx similarity index 100% rename from skimage/rank/_core8.pyx rename to skimage/filter/rank/_core8.pyx diff --git a/skimage/rank/_crank16.pyx b/skimage/filter/rank/_crank16.pyx similarity index 99% rename from skimage/rank/_crank16.pyx rename to skimage/filter/rank/_crank16.pyx index ce8510db..57d41563 100644 --- a/skimage/rank/_crank16.pyx +++ b/skimage/filter/rank/_crank16.pyx @@ -15,7 +15,7 @@ import numpy as np cimport numpy as np # import main loop -from _core16 cimport _core16 +from skimage.filter.rank._core16 cimport _core16 # ----------------------------------------------------------------- # kernels uint16 take extra parameter for defining the bitdepth diff --git a/skimage/rank/_crank16_bilateral.pyx b/skimage/filter/rank/_crank16_bilateral.pyx similarity index 98% rename from skimage/rank/_crank16_bilateral.pyx rename to skimage/filter/rank/_crank16_bilateral.pyx index b5103be4..24016bbf 100644 --- a/skimage/rank/_crank16_bilateral.pyx +++ b/skimage/filter/rank/_crank16_bilateral.pyx @@ -15,7 +15,7 @@ import numpy as np cimport numpy as np # import main loop -from _core16 cimport _core16 +from skimage.filter.rank._core16 cimport _core16 # ----------------------------------------------------------------- # kernels uint16 take extra parameter for defining the bitdepth diff --git a/skimage/rank/_crank16_percentiles.pyx b/skimage/filter/rank/_crank16_percentiles.pyx similarity index 99% rename from skimage/rank/_crank16_percentiles.pyx rename to skimage/filter/rank/_crank16_percentiles.pyx index 527d2aed..73ccde68 100644 --- a/skimage/rank/_crank16_percentiles.pyx +++ b/skimage/filter/rank/_crank16_percentiles.pyx @@ -7,7 +7,7 @@ import numpy as np cimport numpy as np # import main loop -from _core16 cimport _core16, int_min, int_max +from skimage.filter.rank._core16 cimport _core16, int_min, int_max # ----------------------------------------------------------------- # kernels uint16 (SOFT version using percentiles) diff --git a/skimage/rank/_crank8.pyx b/skimage/filter/rank/_crank8.pyx similarity index 99% rename from skimage/rank/_crank8.pyx rename to skimage/filter/rank/_crank8.pyx index 94124cf7..045e3645 100644 --- a/skimage/rank/_crank8.pyx +++ b/skimage/filter/rank/_crank8.pyx @@ -15,7 +15,7 @@ import numpy as np cimport numpy as np # import main loop -from _core8 cimport _core8 +from skimage.filter.rank._core8 cimport _core8 # ----------------------------------------------------------------- # kernels uint8 diff --git a/skimage/rank/_crank8_percentiles.pyx b/skimage/filter/rank/_crank8_percentiles.pyx similarity index 99% rename from skimage/rank/_crank8_percentiles.pyx rename to skimage/filter/rank/_crank8_percentiles.pyx index 5441eac7..f882961a 100644 --- a/skimage/rank/_crank8_percentiles.pyx +++ b/skimage/filter/rank/_crank8_percentiles.pyx @@ -7,7 +7,7 @@ import numpy as np cimport numpy as np # import main loop -from _core8 cimport _core8, uint8_max, uint8_min +from skimage.filter.rank._core8 cimport _core8, uint8_max, uint8_min # ----------------------------------------------------------------- # kernels uint8 (SOFT version using percentiles) diff --git a/skimage/rank/bilateral_rank.py b/skimage/filter/rank/bilateral_rank.py similarity index 85% rename from skimage/rank/bilateral_rank.py rename to skimage/filter/rank/bilateral_rank.py index 24ccbcd0..1dc7552d 100644 --- a/skimage/rank/bilateral_rank.py +++ b/skimage/filter/rank/bilateral_rank.py @@ -1,17 +1,32 @@ -""" +"""bilateral_rank.py - approximate bilateral rankfilter for local (custom kernel) mean -note: 8 bit images are casted into 16 bit image here +The local histogram is computed using a sliding window similar to the method described in + +Reference: Huang, T. ,Yang, G. ; Tang, G.. "A fast two-dimensional median filtering algorithm", +IEEE Transactions on Acoustics, Speech and Signal Processing, Feb 1979. Volume: 27 , Issue: 1, Page(s): 13 - 18. + +input image can be 8 bit or 16 bit with a value < 4096 (i.e. 12 bit), +8 bit images are casted in 16 bit +the number of histogram bins is determined from the maximum value present in the image + +The pixel neighborhood is defined by: + +* the given structuring element + +* an interval [g-s0,g+s1] in gray level around g the processed pixel gray level + +The kernel is flat (i.e. each pixel belonging to the neighborhood contributes equally) + +result image is 16 bit with respect to the input image """ - -import warnings from skimage import img_as_ubyte import numpy as np +from skimage.filter.rank import _crank16_bilateral -from generic import find_bitdepth -import _crank16_bilateral +from skimage.filter.rank.generic import find_bitdepth __all__ = ['bilateral_mean', 'bilateral_pop'] @@ -67,7 +82,7 @@ def bilateral_mean(image, selem, out=None, mask=None, shift_x=False, shift_y=Fal to be updated >>> # Local mean >>> from skimage.morphology import square - >>> import skimage.rank as rank + >>> import skimage.filter.rank as rank >>> ima8 = 255*np.array([[0, 0, 0, 0, 0], ... [0, 1, 1, 1, 0], ... [0, 1, 1, 1, 0], @@ -131,7 +146,7 @@ def bilateral_pop(image, selem, out=None, mask=None, shift_x=False, shift_y=Fals to be updated >>> # Local mean >>> from skimage.morphology import square - >>> import skimage.rank as rank + >>> import skimage.filter.rank as rank >>> ima8 = 255*np.array([[0, 0, 0, 0, 0], ... [0, 1, 1, 1, 0], ... [0, 1, 1, 1, 0], diff --git a/skimage/rank/generic.py b/skimage/filter/rank/generic.py similarity index 100% rename from skimage/rank/generic.py rename to skimage/filter/rank/generic.py diff --git a/skimage/rank/local/demo_all.py b/skimage/filter/rank/local/demo_all.py similarity index 98% rename from skimage/rank/local/demo_all.py rename to skimage/filter/rank/local/demo_all.py index 8df5c3e7..038c749b 100644 --- a/skimage/rank/local/demo_all.py +++ b/skimage/filter/rank/local/demo_all.py @@ -1,10 +1,9 @@ -import numpy as np import matplotlib.pyplot as plt from pprint import pprint from skimage import data from skimage.morphology.selem import disk -import skimage.rank as rank +import skimage.filter.rank as rank def plot_all(): a8 = data.camera() diff --git a/skimage/rank/local/demo_single.py b/skimage/filter/rank/local/demo_single.py similarity index 92% rename from skimage/rank/local/demo_single.py rename to skimage/filter/rank/local/demo_single.py index b601b226..39b9acc0 100644 --- a/skimage/rank/local/demo_single.py +++ b/skimage/filter/rank/local/demo_single.py @@ -1,10 +1,9 @@ import numpy as np import matplotlib.pyplot as plt -from pprint import pprint from skimage import data from skimage.morphology.selem import disk -import skimage.rank as rank +import skimage.filter.rank as rank if __name__ == '__main__': diff --git a/skimage/filter/rank/local/iko_pan_Ja1.tif b/skimage/filter/rank/local/iko_pan_Ja1.tif new file mode 100644 index 00000000..47201695 Binary files /dev/null and b/skimage/filter/rank/local/iko_pan_Ja1.tif differ diff --git a/skimage/rank/local/test_morph_contr_enh.py b/skimage/filter/rank/local/test_morph_contr_enh.py similarity index 93% rename from skimage/rank/local/test_morph_contr_enh.py rename to skimage/filter/rank/local/test_morph_contr_enh.py index 812e81c5..f2f0f7c9 100644 --- a/skimage/rank/local/test_morph_contr_enh.py +++ b/skimage/filter/rank/local/test_morph_contr_enh.py @@ -3,7 +3,7 @@ import matplotlib.pyplot as plt import gdal from skimage.morphology import disk -import skimage.rank as rank +import skimage.filter.rank as rank filename = 'iko_pan_Ja1.tif' im16 = gdal.Open(filename).ReadAsArray().astype(np.uint16) diff --git a/skimage/rank/local/test_rank.py b/skimage/filter/rank/local/test_rank.py similarity index 95% rename from skimage/rank/local/test_rank.py rename to skimage/filter/rank/local/test_rank.py index 75dd7f65..09cfdcd5 100644 --- a/skimage/rank/local/test_rank.py +++ b/skimage/filter/rank/local/test_rank.py @@ -3,7 +3,7 @@ import matplotlib.pyplot as plt from skimage import data from skimage.morphology.selem import disk -import skimage.rank as rank +import skimage.filter.rank as rank print dir(rank) diff --git a/skimage/rank/percentile_rank.py b/skimage/filter/rank/percentile_rank.py similarity index 98% rename from skimage/rank/percentile_rank.py rename to skimage/filter/rank/percentile_rank.py index ac19ccd6..7908f5ac 100644 --- a/skimage/rank/percentile_rank.py +++ b/skimage/filter/rank/percentile_rank.py @@ -14,14 +14,11 @@ result image is 8 or 16 bit with respect to the input image """ - -import warnings from skimage import img_as_ubyte import numpy as np -from generic import find_bitdepth -import _crank16_percentiles -import _crank8_percentiles +from skimage.filter.rank.generic import find_bitdepth +from skimage.filter.rank import _crank16_percentiles, _crank8_percentiles __all__ = ['percentile_autolevel', 'percentile_gradient', 'percentile_mean', 'percentile_mean_substraction', @@ -77,7 +74,7 @@ def percentile_autolevel(image, selem, out=None, mask=None, shift_x=False, shift to be updated >>> # Local mean >>> from skimage.morphology import square - >>> import skimage.rank as rank + >>> import skimage.filter.rank as rank >>> ima8 = 255*np.array([[0, 0, 0, 0, 0], ... [0, 1, 1, 1, 0], ... [0, 1, 1, 1, 0], @@ -141,7 +138,7 @@ def percentile_gradient(image, selem, out=None, mask=None, shift_x=False, shift_ to be updated >>> # Local gradient >>> from skimage.morphology import square - >>> import skimage.rank as rank + >>> import skimage.filter.rank as rank >>> ima8 = 255*np.array([[0, 0, 0, 0, 0], ... [0, 1, 1, 1, 0], ... [0, 1, 1, 1, 0], @@ -205,7 +202,7 @@ def percentile_mean(image, selem, out=None, mask=None, shift_x=False, shift_y=Fa to be updated >>> # Local mean >>> from skimage.morphology import square - >>> import skimage.rank as rank + >>> import skimage.filter.rank as rank >>> ima8 = 255*np.array([[0, 0, 0, 0, 0], ... [0, 1, 1, 1, 0], ... [0, 1, 1, 1, 0], @@ -269,7 +266,7 @@ def percentile_mean_substraction(image, selem, out=None, mask=None, shift_x=Fals to be updated >>> # Local mean_substraction >>> from skimage.morphology import square - >>> import skimage.rank as rank + >>> import skimage.filter.rank as rank >>> ima8 = 255*np.array([[0, 0, 0, 0, 0], ... [0, 1, 1, 1, 0], ... [0, 1, 1, 1, 0], @@ -333,7 +330,7 @@ def percentile_morph_contr_enh(image, selem, out=None, mask=None, shift_x=False, to be updated >>> # Local mean >>> from skimage.morphology import square - >>> import skimage.rank as rank + >>> import skimage.filter.rank as rank >>> ima8 = 255*np.array([[0, 0, 0, 0, 0], ... [0, 1, 1, 1, 0], ... [0, 1, 1, 1, 0], @@ -397,7 +394,7 @@ def percentile(image, selem, out=None, mask=None, shift_x=False, shift_y=False, to be updated >>> # Local mean >>> from skimage.morphology import square - >>> import skimage.rank as rank + >>> import skimage.filter.rank as rank >>> ima8 = 128*np.array([[0, 0, 0, 0, 0], ... [0, 1, 1, 1, 0], ... [0, 1, 1, 1, 0], @@ -462,7 +459,7 @@ def percentile_pop(image, selem, out=None, mask=None, shift_x=False, shift_y=Fal to be updated >>> # Local mean >>> from skimage.morphology import square - >>> import skimage.rank as rank + >>> import skimage.filter.rank as rank >>> ima8 = 255*np.array([[0, 0, 0, 0, 0], ... [0, 1, 1, 1, 0], ... [0, 1, 1, 1, 0], @@ -526,7 +523,7 @@ def percentile_threshold(image, selem, out=None, mask=None, shift_x=False, shift to be updated >>> # Local mean >>> from skimage.morphology import square - >>> import skimage.rank as rank + >>> import skimage.filter.rank as rank >>> ima8 = 255*np.array([[0, 0, 0, 0, 0], ... [0, 1, 1, 1, 0], ... [0, 1, 1, 1, 0], diff --git a/skimage/rank/rank.py b/skimage/filter/rank/rank.py similarity index 98% rename from skimage/rank/rank.py rename to skimage/filter/rank/rank.py index 51854128..0a9dee27 100644 --- a/skimage/rank/rank.py +++ b/skimage/filter/rank/rank.py @@ -12,14 +12,11 @@ result image is 8 or 16 bit with respect to the input image """ - -import warnings from skimage import img_as_ubyte import numpy as np +from skimage.filter.rank import _crank8, _crank16 -from generic import find_bitdepth -import _crank16 -import _crank8 +from skimage.filter.rank.generic import find_bitdepth __all__ = ['autolevel', 'bottomhat', 'equalize', 'gradient', 'maximum', 'mean', 'meansubstraction', 'median', 'minimum', 'modal', 'morph_contr_enh', 'pop', 'threshold', 'tophat'] @@ -71,7 +68,7 @@ def autolevel(image, selem, out=None, mask=None, shift_x=False, shift_y=False): to be updated >>> # Local mean >>> from skimage.morphology import square - >>> import skimage.rank as rank + >>> import skimage.filter.rank as rank >>> ima8 = 255*np.array([[0, 0, 0, 0, 0], ... [0, 1, 1, 1, 0], ... [0, 1, 1, 1, 0], @@ -133,7 +130,7 @@ def bottomhat(image, selem, out=None, mask=None, shift_x=False, shift_y=False): to be updated >>> # Local mean >>> from skimage.morphology import square - >>> import skimage.rank as rank + >>> import skimage.filter.rank as rank >>> ima8 = 255*np.array([[0, 0, 0, 0, 0], ... [0, 1, 1, 1, 0], ... [0, 1, 1, 1, 0], @@ -194,7 +191,7 @@ def equalize(image, selem, out=None, mask=None, shift_x=False, shift_y=False): to be updated >>> # Local mean >>> from skimage.morphology import square - >>> import skimage.rank as rank + >>> import skimage.filter.rank as rank >>> ima8 = 255*np.array([[0, 0, 0, 0, 0], ... [0, 1, 1, 1, 0], ... [0, 1, 1, 1, 0], @@ -255,7 +252,7 @@ def gradient(image, selem, out=None, mask=None, shift_x=False, shift_y=False): to be updated >>> # Local gradient >>> from skimage.morphology import square - >>> import skimage.rank as rank + >>> import skimage.filter.rank as rank >>> ima8 = 255*np.array([[0, 0, 0, 0, 0], ... [0, 1, 1, 1, 0], ... [0, 1, 1, 1, 0], @@ -317,7 +314,7 @@ def maximum(image, selem, out=None, mask=None, shift_x=False, shift_y=False): to be updated >>> # Local maximum >>> from skimage.morphology import square - >>> import skimage.rank as rank + >>> import skimage.filter.rank as rank >>> ima8 = 255*np.array([[0, 0, 0, 0, 0], ... [0, 0, 0, 0, 0], ... [0, 0, 1, 0, 0], @@ -379,7 +376,7 @@ def mean(image, selem, out=None, mask=None, shift_x=False, shift_y=False): to be updated >>> # Local mean >>> from skimage.morphology import square - >>> import skimage.rank as rank + >>> import skimage.filter.rank as rank >>> ima8 = 255*np.array([[0, 0, 0, 0, 0], ... [0, 1, 1, 1, 0], ... [0, 1, 1, 1, 0], @@ -441,7 +438,7 @@ def meansubstraction(image, selem, out=None, mask=None, shift_x=False, shift_y=F to be updated >>> # Local meansubstraction >>> from skimage.morphology import square - >>> import skimage.rank as rank + >>> import skimage.filter.rank as rank >>> ima8 = 255*np.array([[0, 0, 0, 0, 0], ... [0, 1, 1, 1, 0], ... [0, 1, 1, 1, 0], @@ -503,7 +500,7 @@ def median(image, selem, out=None, mask=None, shift_x=False, shift_y=False): to be updated >>> # Local median >>> from skimage.morphology import square - >>> import skimage.rank as rank + >>> import skimage.filter.rank as rank >>> ima8 = 255*np.array([[0, 0, 0, 0, 0], ... [0, 1, 1, 1, 0], ... [0, 1, 0, 1, 0], @@ -565,7 +562,7 @@ def minimum(image, selem, out=None, mask=None, shift_x=False, shift_y=False): to be updated >>> # Local minimum >>> from skimage.morphology import square - >>> import skimage.rank as rank + >>> import skimage.filter.rank as rank >>> ima8 = 255*np.array([[0, 0, 0, 0, 0], ... [0, 1, 1, 1, 0], ... [0, 1, 1, 1, 0], @@ -628,7 +625,7 @@ def modal(image, selem, out=None, mask=None, shift_x=False, shift_y=False): to be updated >>> # Local modal >>> from skimage.morphology import square - >>> import skimage.rank as rank + >>> import skimage.filter.rank as rank >>> ima8 = np.array([[0, 0, 0, 0, 0], ... [0, 1, 1, 1, 0], ... [0, 1, 5, 6, 0], @@ -691,7 +688,7 @@ def morph_contr_enh(image, selem, out=None, mask=None, shift_x=False, shift_y=Fa to be updated >>> # Local mean >>> from skimage.morphology import square - >>> import skimage.rank as rank + >>> import skimage.filter.rank as rank >>> ima8 = np.array([[0, 0, 0, 0, 0], ... [0, 1, 1, 1, 0], ... [0, 1, 1, 1, 0], @@ -753,7 +750,7 @@ def pop(image, selem, out=None, mask=None, shift_x=False, shift_y=False): to be updated >>> # Local mean >>> from skimage.morphology import square - >>> import skimage.rank as rank + >>> import skimage.filter.rank as rank >>> ima8 = 255*np.array([[0, 0, 0, 0, 0], ... [0, 1, 1, 1, 0], ... [0, 1, 1, 1, 0], @@ -815,7 +812,7 @@ def threshold(image, selem, out=None, mask=None, shift_x=False, shift_y=False): to be updated >>> # Local mean >>> from skimage.morphology import square - >>> import skimage.rank as rank + >>> import skimage.filter.rank as rank >>> ima8 = 255*np.array([[0, 0, 0, 0, 0], ... [0, 1, 1, 1, 0], ... [0, 1, 1, 1, 0], @@ -878,7 +875,7 @@ def tophat(image, selem, out=None, mask=None, shift_x=False, shift_y=False): to be updated >>> # Local mean >>> from skimage.morphology import square - >>> import skimage.rank as rank + >>> import skimage.filter.rank as rank >>> ima8 = 255*np.array([[0, 0, 0, 0, 0], ... [0, 1, 1, 1, 0], ... [0, 1, 1, 1, 0], diff --git a/skimage/rank/setup.py b/skimage/filter/rank/setup.py similarity index 100% rename from skimage/rank/setup.py rename to skimage/filter/rank/setup.py diff --git a/skimage/rank/tests/test_suite.py b/skimage/filter/rank/tests/test_suite.py similarity index 97% rename from skimage/rank/tests/test_suite.py rename to skimage/filter/rank/tests/test_suite.py index 9d2bcfea..4f1e6f81 100644 --- a/skimage/rank/tests/test_suite.py +++ b/skimage/filter/rank/tests/test_suite.py @@ -1,12 +1,12 @@ import unittest import numpy as np +from skimage.filter import rank -from skimage.rank import _crank8,_crank8_percentiles -from skimage.rank import _crank16,_crank16_bilateral,_crank16_percentiles -from skimage.morphology import cmorph,disk from skimage import data -from skimage import rank +from skimage.morphology import cmorph,disk +from skimage.filter.rank import _crank8, _crank16 +from skimage.filter.rank import _crank16_percentiles class TestSequenceFunctions(unittest.TestCase): diff --git a/skimage/rank/local/__init__.py b/skimage/rank/local/__init__.py deleted file mode 100644 index e69de29b..00000000