remove trivial examples from perentile_rank

This commit is contained in:
odebeir
2012-11-04 15:49:54 +01:00
parent 14d86ccb33
commit 271ea14c0e
-228
View File
@@ -71,34 +71,6 @@ def percentile_autolevel(image, selem, out=None, mask=None, shift_x=False, shift
local autolevel : uint8 array or uint16 array depending on input image
The result of the local autolevel.
Examples
--------
>>> # Local mean
>>> from skimage.morphology import square
>>> 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],
... [0, 1, 1, 1, 0],
... [0, 0, 0, 0, 0]], dtype=np.uint8)
>>> rank.percentile_autolevel(ima8, square(3), p0=0.,p1=1.)
array([[ 0, 0, 0, 0, 0],
[ 0, 255, 255, 255, 0],
[ 0, 255, 0, 255, 0],
[ 0, 255, 255, 255, 0],
[ 0, 0, 0, 0, 0]], dtype=uint8)
>>> ima16 = 4095*np.array([[0, 0, 0, 0, 0],
... [0, 1, 1, 1, 0],
... [0, 1, 1, 1, 0],
... [0, 1, 1, 1, 0],
... [0, 0, 0, 0, 0]], dtype=np.uint16)
>>> rank.percentile_autolevel(ima16, square(3), p0=0.,p1=1.)
array([[ 0, 0, 0, 0, 0],
[ 0, 4095, 4095, 4095, 0],
[ 0, 4095, 0, 4095, 0],
[ 0, 4095, 4095, 4095, 0],
[ 0, 0, 0, 0, 0]], dtype=uint16)
"""
@@ -136,35 +108,7 @@ def percentile_gradient(image, selem, out=None, mask=None, shift_x=False, shift_
local percentile_gradient : uint8 array or uint16 array depending on input image
The result of the local percentile_gradient.
Examples
--------
>>> # Local gradient
>>> from skimage.morphology import square
>>> 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],
... [0, 1, 1, 1, 0],
... [0, 0, 0, 0, 0]], dtype=np.uint8)
>>> rank.percentile_gradient(ima8, square(3), p0=0.,p1=1.)
array([[255, 255, 255, 255, 255],
[255, 255, 255, 255, 255],
[255, 255, 255, 255, 255],
[255, 255, 255, 255, 255],
[255, 255, 255, 255, 255]], dtype=uint8)
>>> ima16 = 4095*np.array([[0, 0, 0, 0, 0],
... [0, 1, 1, 1, 0],
... [0, 1, 1, 1, 0],
... [0, 1, 1, 1, 0],
... [0, 0, 0, 0, 0]], dtype=np.uint16)
>>> rank.percentile_gradient(ima16, square(3), p0=0.,p1=1.)
array([[4095, 4095, 4095, 4095, 4095],
[4095, 4095, 4095, 4095, 4095],
[4095, 4095, 4095, 4095, 4095],
[4095, 4095, 4095, 4095, 4095],
[4095, 4095, 4095, 4095, 4095]], dtype=uint16)
"""
@@ -202,35 +146,6 @@ def percentile_mean(image, selem, out=None, mask=None, shift_x=False, shift_y=Fa
local mean : uint8 array or uint16 array depending on input image
The result of the local mean.
Examples
--------
>>> # Local mean
>>> from skimage.morphology import square
>>> 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],
... [0, 1, 1, 1, 0],
... [0, 0, 0, 0, 0]], dtype=np.uint8)
>>> rank.percentile_mean(ima8, square(3),p0=0.,p1=1.)
array([[ 63, 85, 127, 85, 63],
[ 85, 113, 170, 113, 85],
[127, 170, 255, 170, 127],
[ 85, 113, 170, 113, 85],
[ 63, 85, 127, 85, 63]], dtype=uint8)
>>> ima16 = 4095*np.array([[0, 0, 0, 0, 0],
... [0, 1, 1, 1, 0],
... [0, 1, 1, 1, 0],
... [0, 1, 1, 1, 0],
... [0, 0, 0, 0, 0]], dtype=np.uint16)
>>> rank.percentile_mean(ima16, square(3),p0=0.,p1=1.)
array([[1023, 1365, 2047, 1365, 1023],
[1365, 1820, 2730, 1820, 1365],
[2047, 2730, 4095, 2730, 2047],
[1365, 1820, 2730, 1820, 1365],
[1023, 1365, 2047, 1365, 1023]], dtype=uint16)
"""
@@ -268,35 +183,7 @@ def percentile_mean_substraction(image, selem, out=None, mask=None, shift_x=Fals
local mean_substraction : uint8 array or uint16 array depending on input image
The result of the local mean_substraction.
Examples
--------
>>> # Local mean_substraction
>>> from skimage.morphology import square
>>> 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],
... [0, 1, 1, 1, 0],
... [0, 0, 0, 0, 0]], dtype=np.uint8)
>>> rank.percentile_mean_substraction(ima8, square(3), p0=0.,p1=1.)
array([[ 95, 84, 63, 84, 95],
[ 84, 198, 169, 198, 84],
[ 63, 169, 127, 169, 63],
[ 84, 198, 169, 198, 84],
[ 95, 84, 63, 84, 95]], dtype=uint8)
>>> ima16 = 4095*np.array([[0, 0, 0, 0, 0],
... [0, 1, 1, 1, 0],
... [0, 1, 1, 1, 0],
... [0, 1, 1, 1, 0],
... [0, 0, 0, 0, 0]], dtype=np.uint16)
>>> rank.percentile_mean_substraction(ima16, square(3), p0=0.,p1=1.)
array([[1536, 1365, 1024, 1365, 1536],
[1365, 3185, 2730, 3185, 1365],
[1024, 2730, 2048, 2730, 1024],
[1365, 3185, 2730, 3185, 1365],
[1536, 1365, 1024, 1365, 1536]], dtype=uint16)
"""
@@ -334,35 +221,7 @@ def percentile_morph_contr_enh(image, selem, out=None, mask=None, shift_x=False,
local morph_contr_enh : uint8 array or uint16 array depending on input image
The result of the local morph_contr_enh.
Examples
--------
>>> # Local mean
>>> from skimage.morphology import square
>>> 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],
... [0, 1, 1, 1, 0],
... [0, 0, 0, 0, 0]], dtype=np.uint8)
>>> rank.percentile_morph_contr_enh(ima8, square(3), p0=0.,p1=1.)
array([[ 0, 0, 0, 0, 0],
[ 0, 255, 255, 255, 0],
[ 0, 255, 255, 255, 0],
[ 0, 255, 255, 255, 0],
[ 0, 0, 0, 0, 0]], dtype=uint8)
>>> ima16 = 4095*np.array([[0, 0, 0, 0, 0],
... [0, 1, 1, 1, 0],
... [0, 1, 1, 1, 0],
... [0, 1, 1, 1, 0],
... [0, 0, 0, 0, 0]], dtype=np.uint16)
>>> rank.percentile_morph_contr_enh(ima16, square(3), p0=0.,p1=1.)
array([[ 0, 0, 0, 0, 0],
[ 0, 4095, 4095, 4095, 0],
[ 0, 4095, 4095, 4095, 0],
[ 0, 4095, 4095, 4095, 0],
[ 0, 0, 0, 0, 0]], dtype=uint16)
"""
@@ -400,35 +259,6 @@ def percentile(image, selem, out=None, mask=None, shift_x=False, shift_y=False,
local percentile : uint8 array or uint16 array depending on input image
The result of the local percentile.
Examples
--------
>>> # Local mean
>>> from skimage.morphology import square
>>> 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],
... [0, 1, 1, 1, 0],
... [0, 0, 0, 0, 0]], dtype=np.uint8)
>>> rank.percentile(ima8, square(3), p0=0.,p1=1.)
array([[0, 0, 0, 0, 0],
[0, 0, 0, 0, 0],
[0, 0, 0, 0, 0],
[0, 0, 0, 0, 0],
[0, 0, 0, 0, 0]], dtype=uint8)
>>> ima16 = 4095*np.array([[0, 0, 0, 0, 0],
... [0, 1, 1, 1, 0],
... [0, 1, 1, 1, 0],
... [0, 1, 1, 1, 0],
... [0, 0, 0, 0, 0]], dtype=np.uint16)
>>> rank.percentile(ima16, square(3), p0=0.,p1=1.)
array([[0, 0, 0, 0, 0],
[0, 0, 0, 0, 0],
[0, 0, 0, 0, 0],
[0, 0, 0, 0, 0],
[0, 0, 0, 0, 0]], dtype=uint16)
"""
@@ -467,35 +297,7 @@ def percentile_pop(image, selem, out=None, mask=None, shift_x=False, shift_y=Fal
local pop : uint8 array or uint16 array depending on input image
The result of the local pop.
Examples
--------
>>> # Local mean
>>> from skimage.morphology import square
>>> 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],
... [0, 1, 1, 1, 0],
... [0, 0, 0, 0, 0]], dtype=np.uint8)
>>> rank.percentile_pop(ima8, square(3), p0=0.,p1=1.)
array([[4, 6, 6, 6, 4],
[6, 9, 9, 9, 6],
[6, 9, 9, 9, 6],
[6, 9, 9, 9, 6],
[4, 6, 6, 6, 4]], dtype=uint8)
>>> ima16 = 4095*np.array([[0, 0, 0, 0, 0],
... [0, 1, 1, 1, 0],
... [0, 1, 1, 1, 0],
... [0, 1, 1, 1, 0],
... [0, 0, 0, 0, 0]], dtype=np.uint16)
>>> rank.percentile_pop(ima16, square(3), p0=0.,p1=1.)
array([[4, 6, 6, 6, 4],
[6, 9, 9, 9, 6],
[6, 9, 9, 9, 6],
[6, 9, 9, 9, 6],
[4, 6, 6, 6, 4]], dtype=uint16)
"""
@@ -533,37 +335,7 @@ def percentile_threshold(image, selem, out=None, mask=None, shift_x=False, shift
local threshold : uint8 array or uint16 array depending on input image
The result of the local threshold.
Examples
--------
>>> # Local mean
>>> from skimage.morphology import square
>>> 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],
... [0, 1, 1, 1, 0],
... [0, 0, 0, 0, 0]], dtype=np.uint8)
>>> rank.percentile_threshold(ima8, square(3), p0=0.,p1=1.)
array([[255, 255, 255, 255, 255],
[255, 255, 255, 255, 255],
[255, 255, 255, 255, 255],
[255, 255, 255, 255, 255],
[255, 255, 255, 255, 255]], dtype=uint8)
>>> ima16 = 4095*np.array([[0, 0, 0, 0, 0],
... [0, 1, 1, 1, 0],
... [0, 1, 1, 1, 0],
... [0, 1, 1, 1, 0],
... [0, 0, 0, 0, 0]], dtype=np.uint16)
>>> rank.percentile_threshold(ima16, square(3), p0=0.,p1=1.)
array([[4095, 4095, 4095, 4095, 4095],
[4095, 4095, 4095, 4095, 4095],
[4095, 4095, 4095, 4095, 4095],
[4095, 4095, 4095, 4095, 4095],
[4095, 4095, 4095, 4095, 4095]], dtype=uint16)
"""
return _apply(