From c18f07ede1f00fdc6b945e593ae8c874b27073e9 Mon Sep 17 00:00:00 2001 From: Olivier Debeir Date: Wed, 10 Oct 2012 11:41:18 +0200 Subject: [PATCH] rename egalise to equalize --- doc/examples/plot_local_equalize.py | 4 ++-- skimage/rank/_crank8.pyx | 6 +++--- skimage/rank/rank.py | 20 ++++++++++---------- 3 files changed, 15 insertions(+), 15 deletions(-) diff --git a/doc/examples/plot_local_equalize.py b/doc/examples/plot_local_equalize.py index 840f2a1f..ec28067d 100644 --- a/doc/examples/plot_local_equalize.py +++ b/doc/examples/plot_local_equalize.py @@ -19,7 +19,7 @@ to be adjusted... from skimage import data from skimage.util.dtype import dtype_range from skimage import exposure -from skimage.rank import egalise +from skimage import rank from skimage.morphology import disk @@ -63,7 +63,7 @@ img_rescale = exposure.equalize(img) # Equalization selem = disk(30) -img_eq = egalise(img,selem=selem) +img_eq = rank.equalize(img,selem=selem) # Display results diff --git a/skimage/rank/_crank8.pyx b/skimage/rank/_crank8.pyx index cb74021e..12e0577e 100644 --- a/skimage/rank/_crank8.pyx +++ b/skimage/rank/_crank8.pyx @@ -49,7 +49,7 @@ cdef inline np.uint8_t kernel_bottomhat(int* histo, float pop, np.uint8_t g): return (g-i) -cdef inline np.uint8_t kernel_egalise(int* histo, float pop, np.uint8_t g): +cdef inline np.uint8_t kernel_equalize(int* histo, float pop, np.uint8_t g): cdef int i cdef float sum = 0. @@ -210,14 +210,14 @@ def bottomhat(np.ndarray[np.uint8_t, ndim=2] image, """ return _core8(kernel_bottomhat,image,selem,mask,out,shift_x,shift_y) -def egalise(np.ndarray[np.uint8_t, ndim=2] image, +def equalize(np.ndarray[np.uint8_t, ndim=2] image, np.ndarray[np.uint8_t, ndim=2] selem, np.ndarray[np.uint8_t, ndim=2] mask=None, np.ndarray[np.uint8_t, ndim=2] out=None, char shift_x=0, char shift_y=0): """local egalisation of the gray level """ - return _core8(kernel_egalise,image,selem,mask,out,shift_x,shift_y) + return _core8(kernel_equalize,image,selem,mask,out,shift_x,shift_y) def gradient(np.ndarray[np.uint8_t, ndim=2] image, np.ndarray[np.uint8_t, ndim=2] selem, diff --git a/skimage/rank/rank.py b/skimage/rank/rank.py index 42e5c23e..2a7caab9 100644 --- a/skimage/rank/rank.py +++ b/skimage/rank/rank.py @@ -18,7 +18,7 @@ import numpy as np from generic import find_bitdepth import _crank16,_crank8 -__all__ = ['autolevel','bottomhat','egalise','gradient','maximum','mean' +__all__ = ['autolevel','bottomhat','equalize','gradient','maximum','mean' ,'meansubstraction','median','minimum','modal','morph_contr_enh','pop','threshold', 'tophat'] def autolevel(image, selem, out=None, mask=None, shift_x=False, shift_y=False): @@ -162,10 +162,10 @@ def bottomhat(image, selem, out=None, mask=None, shift_x=False, shift_y=False): else: raise TypeError("only uint8 and uint16 image supported!") -def egalise(image, selem, out=None, mask=None, shift_x=False, shift_y=False): - """Return greyscale local egalise of an image. +def equalize(image, selem, out=None, mask=None, shift_x=False, shift_y=False): + """Return greyscale local equalize of an image. - egalise is computed on the given structuring element. + equalize is computed on the given structuring element. Parameters ---------- @@ -187,8 +187,8 @@ def egalise(image, selem, out=None, mask=None, shift_x=False, shift_y=False): Returns ------- - local egalise : uint8 array or uint16 array depending on input image - The result of the local egalise. + local equalize : uint8 array or uint16 array depending on input image + The result of the local equalize. Examples -------- @@ -200,7 +200,7 @@ def egalise(image, selem, out=None, mask=None, shift_x=False, shift_y=False): ... [0, 1, 1, 1, 0], ... [0, 1, 1, 1, 0], ... [0, 0, 0, 0, 0]], dtype=np.uint8) - >>> egalise(ima8, square(3)) + >>> equalize(ima8, square(3)) array([[191, 170, 127, 170, 191], [170, 255, 255, 255, 170], [127, 255, 255, 255, 127], @@ -212,7 +212,7 @@ def egalise(image, selem, out=None, mask=None, shift_x=False, shift_y=False): ... [0, 1, 1, 1, 0], ... [0, 1, 1, 1, 0], ... [0, 0, 0, 0, 0]], dtype=np.uint16) - >>> egalise(ima16, square(3)) + >>> equalize(ima16, square(3)) array([[3072, 2730, 2048, 2730, 3072], [2730, 4096, 4096, 4096, 2730], [2048, 4096, 4096, 4096, 2048], @@ -223,12 +223,12 @@ def egalise(image, selem, out=None, mask=None, shift_x=False, shift_y=False): if mask is not None: mask = img_as_ubyte(mask) if image.dtype == np.uint8: - return _crank8.egalise(image,selem,shift_x=shift_x,shift_y=shift_y,mask=mask,out=out) + return _crank8.equalize(image,selem,shift_x=shift_x,shift_y=shift_y,mask=mask,out=out) elif image.dtype == np.uint16: bitdepth = find_bitdepth(image) if bitdepth>11: raise ValueError("only uint16 <4096 image (12bit) supported!") - return _crank16.egalise(image,selem,shift_x=shift_x,shift_y=shift_y,mask=mask,bitdepth=bitdepth+1,out=out) + return _crank16.equalize(image,selem,shift_x=shift_x,shift_y=shift_y,mask=mask,bitdepth=bitdepth+1,out=out) else: raise TypeError("only uint8 and uint16 image supported!")