@@ -16,40 +16,44 @@ def median(
1616 image : array-like
1717 Input image.
1818 footprint : ndarray, optional
19- If ``behavior=='rank'``, ``footprint`` is a 2-D array of 1's and 0's.
20- If ``behavior=='ndimage'``, ``footprint`` is a N-D array of 1's and 0's
21- with the same number of dimension than ``image``.
22- If None, ``footprint`` will be a N-D array with 3 elements for each
23- dimension (e.g., vector, square, cube, etc.)
24- out : ndarray, (same dtype as image), optional
25- If None, a new array is allocated.
26- mode : {'reflect', 'constant', 'nearest', 'mirror','‘wrap'}, optional
19+ If ``behavior='rank'``, `footprint` is a 2-D array of 1's and 0's.
20+ If ``behavior='ndimage'``, `footprint` is a N-D array of 1's and 0's
21+ with the same number of dimensions as `image`.
22+ If None, `footprint` will be a N-D array with 3 elements for each
23+ dimension (e.g., vector, square, cube, etc.).
24+ out : ndarray, optional
25+ If None, a new array is allocated. For ``behavior='ndimage'``,
26+ dtype matches input. For ``behavior='rank'``, dtype follows
27+ :func:`skimage.filters.rank.median`.
28+ mode : {'reflect', 'constant', 'nearest', 'mirror', 'wrap'}, optional
2729 The mode parameter determines how the array borders are handled, where
28- `` cval`` is the value when mode is equal to 'constant'.
30+ `cval` is the value when ` mode` is equal to 'constant'.
2931 Default is 'nearest'.
3032
3133 .. versionadded:: 0.15
32- `` mode` ` is used when ``behavior='ndimage'``.
34+ `mode` is used when ``behavior='ndimage'``.
3335 cval : scalar, optional
34- Value to fill past edges of input if mode is 'constant'. Default is 0.0
36+ Value to fill past edges of input `image` if `mode` is 'constant'.
37+ Default is 0.0.
3538
3639 .. versionadded:: 0.15
37- `` cval`` was added in 0.15 is used when ``behavior='ndimage'``.
40+ `cval` was added in 0.15 and is used when ``behavior='ndimage'``.
3841 behavior : {'ndimage', 'rank'}, optional
39- Either to use the old behavior (i.e., < 0.15) or the new behavior.
40- The old behavior will call the :func:`skimage.filters.rank.median`.
41- The new behavior will call the :func:`scipy.ndimage.median_filter`.
42+ Whether to use the old (i.e., scikit-image < 0.15) or the new behavior.
43+ The old behavior will call :func:`skimage.filters.rank.median`.
44+ The new behavior will call :func:`scipy.ndimage.median_filter`.
4245 Default is 'ndimage'.
4346
4447 .. versionadded:: 0.15
45- `` behavior`` is introduced in 0 .15
48+ `behavior` is introduced in v0 .15.
4649 .. versionchanged:: 0.16
47- Default `` behavior`` has been changed from 'rank' to 'ndimage'
50+ Default `behavior` has been changed from 'rank' to 'ndimage'.
4851
4952 Returns
5053 -------
51- out : 2-D array, same dtype as input `image`
52- Output image.
54+ out : ndarray
55+ Output image. For ``behavior='ndimage'``, dtype matches input. For
56+ ``behavior='rank'``, dtype follows :func:`skimage.filters.rank.median`.
5357
5458 See also
5559 --------
@@ -59,11 +63,9 @@ def median(
5963
6064 Examples
6165 --------
62- >>> from skimage import data
63- >>> from skimage.morphology import disk
64- >>> from skimage.filters import median
65- >>> img = data.camera()
66- >>> med = median(img, disk(5))
66+ >>> import skimage as ski
67+ >>> img = ski.data.camera()
68+ >>> med = ski.filters.median(img, ski.morphology.disk(5))
6769
6870 """
6971 if behavior == 'rank' :
0 commit comments