diff --git a/DEVELOPMENT.txt b/DEVELOPMENT.txt index 13efecef..863206b8 100644 --- a/DEVELOPMENT.txt +++ b/DEVELOPMENT.txt @@ -46,7 +46,7 @@ Test coverage Tests for a module should ideally cover all code in that module, i.e. statement coverage should be at 100%. - To measure the test coverage, install +To measure the test coverage, install `coverage.py `__ (using ``easy_install coverage``) and then run:: diff --git a/doc/examples/plot_gabors_from_lena.py b/doc/examples/plot_gabors_from_lena.py index 36872259..3cf575a9 100644 --- a/doc/examples/plot_gabors_from_lena.py +++ b/doc/examples/plot_gabors_from_lena.py @@ -32,10 +32,10 @@ is not rocket science. .. [4] http://en.wikipedia.org/wiki/K-means_clustering .. [5] http://en.wikipedia.org/wiki/Lateral_geniculate_nucleus .. [6] D. H. Hubel and T. N. Wiesel Receptive Fields of Single Neurones -in the Cat's Striate Cortex J. Physiol. pp. 574-591 (148) 1959 + in the Cat's Striate Cortex J. Physiol. pp. 574-591 (148) 1959 .. [7] D. H. Hubel and T. N. Wiesel Receptive Fields, Binocular -Interaction and Functional Architecture in the Cat's Visual Cortex J. -Physiol. 160 pp. 106-154 1962 + Interaction and Functional Architecture in the Cat's Visual Cortex J. + Physiol. 160 pp. 106-154 1962 """ import numpy as np diff --git a/doc/source/gitwash/forking_hell.txt b/doc/source/gitwash/forking_hell.txt index ef95c3e4..58e12fee 100644 --- a/doc/source/gitwash/forking_hell.txt +++ b/doc/source/gitwash/forking_hell.txt @@ -1,8 +1,8 @@ .. _forking: -========================================== +============================================ Making your own copy (fork) of scikits-image -========================================== +============================================ You need to do this only once. The instructions here are very similar to the instructions at http://help.github.com/forking/ |emdash| please see @@ -10,7 +10,7 @@ that page for more detail. We're repeating some of it here just to give the specifics for the scikits-image_ project, and to suggest some default names. Set up and configure a github account -===================================== +====================================== If you don't have a github account, go to the github page, and make one. @@ -18,7 +18,7 @@ You then need to configure your account to allow write access |emdash| see the ``Generating SSH keys`` help on `github help`_. Create your own forked copy of scikits-image_ -=========================================== +============================================= #. Log into your github account. #. Go to the scikits-image_ github home at `scikits-image github`_. diff --git a/doc/source/gitwash/index.txt b/doc/source/gitwash/index.txt index 2edcadcb..d0eac669 100644 --- a/doc/source/gitwash/index.txt +++ b/doc/source/gitwash/index.txt @@ -1,7 +1,7 @@ .. _using-git: Working with *scikits-image* source code -====================================== +======================================== Contents: diff --git a/skimage/feature/greycomatrix.py b/skimage/feature/greycomatrix.py index 081fe8d1..5b4bdb85 100644 --- a/skimage/feature/greycomatrix.py +++ b/skimage/feature/greycomatrix.py @@ -127,9 +127,9 @@ def greycoprops(P, prop='contrast'): - 'homogeneity': :math:`\\sum_{i,j=0}^{levels-1}\\frac{P_{i,j}}{1+(i-j)^2}` - 'ASM': :math:`\\sum_{i,j=0}^{levels-1} P_{i,j}^2` - 'energy': :math:`\\sqrt{ASM}` - - 'correlation': -.. math:: \\sum_{i,j=0}^{levels-1} P_{i,j}\\left[\\frac{(i-\\mu_i) \\ - (j-\\mu_j)}{\\sqrt{(\\sigma_i^2)(\\sigma_j^2)}}\\right] + - 'correlation': + .. math:: \\sum_{i,j=0}^{levels-1} P_{i,j}\\left[\\frac{(i-\\mu_i) \\ + (j-\\mu_j)}{\\sqrt{(\\sigma_i^2)(\\sigma_j^2)}}\\right] Parameters @@ -140,6 +140,7 @@ def greycoprops(P, prop='contrast'): `P[i,j,d,theta]` is the number of times that grey-level j occurs at a distance d and at an angle theta from grey-level i. + prop : {'contrast', 'dissimilarity', 'homogeneity', 'energy', \ 'correlation', 'ASM'}, optional The property of the GLCM to compute. The default is 'contrast'. diff --git a/skimage/feature/hog.py b/skimage/feature/hog.py index 01a2208a..f9b33116 100644 --- a/skimage/feature/hog.py +++ b/skimage/feature/hog.py @@ -7,11 +7,12 @@ def hog(image, orientations=9, pixels_per_cell=(8, 8), """Extract Histogram of Oriented Gradients (HOG) for a given image. Compute a Histogram of Oriented Gradients (HOG) by - 1) (optional) global image normalisation - 2) computing the gradient image in x and y - 3) computing gradient histograms - 3) normalising across blocks - 4) flattening into a feature vector + + 1. (optional) global image normalisation + 2. computing the gradient image in x and y + 3. computing gradient histograms + 4. normalising across blocks + 5. flattening into a feature vector Parameters ---------- diff --git a/skimage/io/collection.py b/skimage/io/collection.py index 2d32f082..19d3ab57 100644 --- a/skimage/io/collection.py +++ b/skimage/io/collection.py @@ -21,15 +21,6 @@ class MultiImage(object): Whether to conserve memory by only caching a single frame. Default is True. - Attributes - ---------- - filename : str - The complete path to the image file. - conserve_memory : bool - Whether memory is conserved by only caching a single frame. - numframes : int - The number of frames in the image. - Notes ----- If ``conserve_memory=True`` the memory footprint can be reduced, however diff --git a/skimage/segmentation/random_walker_segmentation.py b/skimage/segmentation/random_walker_segmentation.py index fb26f2bf..36ec764a 100644 --- a/skimage/segmentation/random_walker_segmentation.py +++ b/skimage/segmentation/random_walker_segmentation.py @@ -182,22 +182,22 @@ def random_walker(data, labels, beta=130, mode='bf', tol=1.e-3, copy=True): 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 for example). + - '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 + for example). - - 'cg' (conjugate gradient): the linear system is solved - iteratively using the Conjugate Gradient method from - scipy.sparse.linalg. This is less memory-consuming than the - brute force method for large images, but it is quite slow. + - 'cg' (conjugate gradient): the linear system is solved iteratively + using the Conjugate Gradient method from scipy.sparse.linalg. This is + less memory-consuming than the brute force method for large images, + but it is quite slow. - - 'cg_mg' (conjugate gradient with multigrid preconditioner): - a preconditioner is computed using a multigrid solver, then - the solution is computed with the Conjugate Gradient method. - This mode requires that the pyamg module - (http://code.google.com/p/pyamg/) is installed. For images of - size > 512x512, this is the recommended (fastest) mode. + - 'cg_mg' (conjugate gradient with multigrid preconditioner): a + preconditioner is computed using a multigrid solver, then the + solution is computed with the Conjugate Gradient method. This mode + 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 @@ -240,18 +240,20 @@ def random_walker(data, labels, beta=130, mode='bf', tol=1.e-3, copy=True): the other coefficients are looked for). Each pixel is attributed the label for which it has a maximal value of x. The Laplacian L of the image is defined as: + - L_ii = d_i, the number of neighbors of pixel i (the degree of i) - L_ij = -w_ij if i and j are adjacent pixels + The weight w_ij is a decreasing function of the norm of the local gradient. This ensures that diffusion is easier between pixels of similar values. - When the Laplacian is decomposed into blocks of marked and unmarked pixels + When the Laplacian is decomposed into blocks of marked and unmarked pixels:: L = M B.T B A with first indices corresponding to marked pixels, and then to unmarked - pixels, minimizing x.T L x for one phase amount to solving + pixels, minimizing x.T L x for one phase amount to solving:: A x = - B x_m diff --git a/skimage/transform/finite_radon_transform.py b/skimage/transform/finite_radon_transform.py index 43c0ba3b..03dd0152 100644 --- a/skimage/transform/finite_radon_transform.py +++ b/skimage/transform/finite_radon_transform.py @@ -97,7 +97,7 @@ def ifrt2(a): Notes ----- The FRT has a unique inverse iff n is prime. - See [FRT] for an overview. + See [1]_ for an overview. The idea for this algorithm is due to Vlad Negnevitski. Examples @@ -120,7 +120,7 @@ def ifrt2(a): References ---------- - .. [FRT] A. Kingston and I. Svalbe, "Projective transforms on periodic + .. [1] A. Kingston and I. Svalbe, "Projective transforms on periodic discrete image arrays," in P. Hawkes (Ed), Advances in Imaging and Electron Physics, 139 (2006) diff --git a/skimage/transform/radon_transform.py b/skimage/transform/radon_transform.py index 7e3dbe02..9d8dc08d 100644 --- a/skimage/transform/radon_transform.py +++ b/skimage/transform/radon_transform.py @@ -17,6 +17,9 @@ import numpy as np from scipy.fftpack import fftshift, fft, ifft from ._project import homography +__all__ = ["radon", "iradon"] + + def radon(image, theta=None): """ Calculates the radon transform of an image given specified