Skip to content

Commit

Permalink
DOC: Fix Sphinx errors.
Browse files Browse the repository at this point in the history
  • Loading branch information
tonysyu committed Mar 2, 2013
1 parent db7a063 commit 17e7ba3
Show file tree
Hide file tree
Showing 10 changed files with 48 additions and 39 deletions.
1 change: 0 additions & 1 deletion doc/examples/plot_corner.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@
"""

import numpy as np
from matplotlib import pyplot as plt

from skimage import data
Expand Down
1 change: 0 additions & 1 deletion doc/examples/plot_random_walker_segmentation.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@
.. [1] *Random walks for image segmentation*, Leo Grady, IEEE Trans. Pattern
Anal. Mach. Intell. 2006 Nov; 28(11):1768-83
"""
print __doc__

import numpy as np
from scipy import ndimage
Expand Down
13 changes: 7 additions & 6 deletions skimage/exposure/_adapthist.py
Original file line number Diff line number Diff line change
Expand Up @@ -259,6 +259,8 @@ def map_histogram(hist, min_val, max_val, n_pixels):
It does so by cumulating the input histogram.
Parameters
----------
hist : ndarray
Clipped histogram.
min_val : int
Expand Down Expand Up @@ -301,12 +303,11 @@ def interpolate(image, xslice, yslice,
out : ndarray
Original image with the subregion replaced.
Note
----
This function calculates the new greylevel assignments of pixels
within a submatrix of the image.
This is done by a bilinear interpolation between four different
mappings in order to eliminate boundary artifacts.
Notes
-----
This function calculates the new greylevel assignments of pixels within
a submatrix of the image. This is done by a bilinear interpolation between
four different mappings in order to eliminate boundary artifacts.
"""
norm = xslice.size * yslice.size # Normalization factor
# interpolation weight matrices
Expand Down
21 changes: 13 additions & 8 deletions skimage/feature/_daisy.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,30 +53,35 @@ def daisy(img, step=4, radius=15, rings=3, histograms=8, orientations=8,
the spatial smoothing of the center histogram and the last sigma value
defines the spatial smoothing of the outermost ring. Specifying sigmas
overrides the following parameter.
``rings = len(sigmas)-1``
``rings = len(sigmas) - 1``
ring_radii : 1D array of int, optional
Radius (in pixels) for each ring. Specifying ring_radii overrides the
following two parameters.
| ``rings = len(ring_radii)``
| ``radius = ring_radii[-1]``
``rings = len(ring_radii)``
``radius = ring_radii[-1]``
If both sigmas and ring_radii are given, they must satisfy the
following predicate since no radius is needed for the center
histogram.
``len(ring_radii) == len(sigmas)+1``
``len(ring_radii) == len(sigmas) + 1``
visualize : bool, optional
Generate a visualization of the DAISY descriptors
Returns
-------
descs : array
Grid of DAISY descriptors for the given image as an array
dimensionality (P, Q, R) where
| ``P = ceil((M-radius*2)/step)``
| ``Q = ceil((N-radius*2)/step)``
| ``R = (rings*histograms + 1)*orientations``
``P = ceil((M - radius*2) / step)``
``Q = ceil((N - radius*2) / step)``
``R = (rings * histograms + 1) * orientations``
descs_img : (M, N, 3) array (only if visualize==True)
Visualization of the DAISY descriptors.
Expand Down
6 changes: 3 additions & 3 deletions skimage/feature/corner.py
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@ def corner_harris(image, method='k', k=0.05, eps=1e-6, sigma=1):
..[2] http://en.wikipedia.org/wiki/Corner_detection
Examples
-------
--------
>>> from skimage.feature import corner_harris, corner_peaks
>>> square = np.zeros([10, 10])
>>> square[2:8, 2:8] = 1
Expand Down Expand Up @@ -210,7 +210,7 @@ def corner_shi_tomasi(image, sigma=1):
..[2] http://en.wikipedia.org/wiki/Corner_detection
Examples
-------
--------
>>> from skimage.feature import corner_shi_tomasi, corner_peaks
>>> square = np.zeros([10, 10])
>>> square[2:8, 2:8] = 1
Expand Down Expand Up @@ -277,7 +277,7 @@ def corner_foerstner(image, sigma=1):
..[2] http://en.wikipedia.org/wiki/Corner_detection
Examples
-------
--------
>>> from skimage.feature import corner_foerstner, corner_peaks
>>> square = np.zeros([10, 10])
>>> square[2:8, 2:8] = 1
Expand Down
2 changes: 1 addition & 1 deletion skimage/feature/corner_cy.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ def corner_moravec(image, Py_ssize_t window_size=1):
..[2] http://en.wikipedia.org/wiki/Corner_detection
Examples
-------
--------
>>> from skimage.feature import moravec, peak_local_max
>>> square = np.zeros([7, 7])
>>> square[3, 3] = 1
Expand Down
7 changes: 4 additions & 3 deletions skimage/feature/peak.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,9 +50,10 @@ def peak_local_max(image, min_distance=10, threshold_abs=0, threshold_rel=0.1,
Returns
-------
output : (N, 2) array or ndarray of bools
If `indices = True` : (row, column) coordinates of peaks.
If `indices = False` : Boolean array shaped like `image`,
with peaks represented by True values.
* If `indices = True` : (row, column) coordinates of peaks.
* If `indices = False` : Boolean array shaped like `image`, with peaks
represented by True values.
Notes
-----
Expand Down
6 changes: 3 additions & 3 deletions skimage/filter/_denoise.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ def _denoise_tv_chambolle_3d(im, weight=100, eps=2.e-4, n_iter_max=200):
Rudin, Osher and Fatemi algorithm.
Examples
---------
--------
>>> x, y, z = np.ogrid[0:40, 0:40, 0:40]
>>> mask = (x - 22)**2 + (y - 20)**2 + (z - 17)**2 < 8**2
>>> mask = mask.astype(np.float)
Expand Down Expand Up @@ -123,7 +123,7 @@ def _denoise_tv_chambolle_2d(im, weight=50, eps=2.e-4, n_iter_max=200):
Springer, 2004, 20, 89-97.
Examples
---------
--------
>>> from skimage import color, data
>>> lena = color.rgb2gray(data.lena())
>>> lena += 0.5 * lena.std() * np.random.randn(*lena.shape)
Expand Down Expand Up @@ -221,7 +221,7 @@ def denoise_tv_chambolle(im, weight=50, eps=2.e-4, n_iter_max=200,
Springer, 2004, 20, 89-97.
Examples
---------
--------
2D example on Lena image:
>>> from skimage import color, data
Expand Down
4 changes: 2 additions & 2 deletions skimage/filter/rank/rank.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -648,12 +648,12 @@ def noise_filter(image, selem, out=None, mask=None, shift_x=False,
References
----------
.. [Hashimoto12] N. Hashimoto et al. Referenceless image quality evaluation
for whole slide imaging. J Pathol Inform 2012;3:9.
for whole slide imaging. J Pathol Inform 2012;3:9.
Returns
-------
out : uint8 array or uint16 array (same as input image)
The image noise .
The image noise.
"""

Expand Down
26 changes: 15 additions & 11 deletions skimage/segmentation/random_walker_segmentation.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,7 @@


def _make_graph_edges_3d(n_x, n_y, n_z):
"""
Returns a list of edges for a 3D image.
"""Returns a list of edges for a 3D image.
Parameters
----------
Expand All @@ -45,9 +44,12 @@ def _make_graph_edges_3d(n_x, n_y, n_z):
Returns
-------
edges : (2, N) ndarray
with the total number of edges N = n_x * n_y * (nz - 1) +
n_x * (n_y - 1) * nz +
(n_x - 1) * n_y * nz
with the total number of edges::
N = n_x * n_y * (nz - 1) +
n_x * (n_y - 1) * nz +
(n_x - 1) * n_y * nz
Graph edges with each column describing a node-id pair.
"""
vertices = np.arange(n_x * n_y * n_z).reshape((n_x, n_y, n_z))
Expand Down Expand Up @@ -200,6 +202,7 @@ def random_walker(data, labels, beta=130, mode='bf', tol=1.e-3, copy=True,
mode : {'bf', 'cg_mg', 'cg'} (default: 'bf')
Mode for solving the linear system in the random walker
algorithm.
- 'bf' (brute force, default): an LU factorization of the Laplacian is
computed. This is fast for small images (<1024x1024), but very slow
(due to the memory cost) and memory-consuming for big images (in 3-D
Expand All @@ -214,6 +217,7 @@ def random_walker(data, labels, beta=130, mode='bf', tol=1.e-3, copy=True,
requires that the pyamg module (http://code.google.com/p/pyamg/) is
installed. For images of size > 512x512, this is the recommended
(fastest) mode.
tol : float
tolerance to achieve when solving the linear system, in
cg' and 'cg_mg' modes.
Expand All @@ -237,12 +241,12 @@ def random_walker(data, labels, beta=130, mode='bf', tol=1.e-3, copy=True,
Returns
-------
output : ndarray
If `return_full_prob` is False, array of ints of same shape as `data`,
in which each pixel has been labeled according to the marker that
reached the pixel first by anisotropic diffusion.
If `return_full_prob` is True, array of floats of shape
`(nlabels, data.shape)`. `output[label_nb, i, j]` is the probability
that label `label_nb` reaches the pixel `(i, j)` first.
* If `return_full_prob` is False, array of ints of same shape as
`data`, in which each pixel has been labeled according to the marker
that reached the pixel first by anisotropic diffusion.
* If `return_full_prob` is True, array of floats of shape
`(nlabels, data.shape)`. `output[label_nb, i, j]` is the probability
that label `label_nb` reaches the pixel `(i, j)` first.
See also
--------
Expand Down

0 comments on commit 17e7ba3

Please sign in to comment.