From cc91324625fe9db28823c8994d74085815b4ed8d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Johannes=20Sch=C3=B6nberger?= Date: Sat, 17 Aug 2013 21:42:27 +0200 Subject: [PATCH] Fix PEP8 issues and typos --- skimage/measure/_moments.pyx | 4 ++-- skimage/measure/_regionprops.py | 15 +++++++-------- 2 files changed, 9 insertions(+), 10 deletions(-) diff --git a/skimage/measure/_moments.pyx b/skimage/measure/_moments.pyx index 104acf8f..6b7197d2 100644 --- a/skimage/measure/_moments.pyx +++ b/skimage/measure/_moments.pyx @@ -122,9 +122,9 @@ def moments_normalized(double[:, :] mu, Py_ssize_t order=3): for p in range(order + 1): for q in range(order + 1): if p + q >= 2: - nu[p,q] = mu[p, q] / mu[0, 0] ** ((p + q) / 2 + 1) + nu[p, q] = mu[p, q] / mu[0, 0] ** ((p + q) / 2 + 1) else: - nu[p,q] = np.nan + nu[p, q] = np.nan return np.asarray(nu) diff --git a/skimage/measure/_regionprops.py b/skimage/measure/_regionprops.py index acf251af..0cc56635 100644 --- a/skimage/measure/_regionprops.py +++ b/skimage/measure/_regionprops.py @@ -311,7 +311,6 @@ class _RegionProperties(object): return getattr(self, PROPS[key]) - def regionprops(label_image, properties=None, intensity_image=None, cache=True): """Measure properties of labelled image regions. @@ -346,15 +345,15 @@ def regionprops(label_image, properties=None, **area** : int Number of pixels of region. **bbox** : tuple - Bounding box `(min_row, min_col, max_row, max_col)` + Bounding box ``(min_row, min_col, max_row, max_col)`` **centroid** : array - Centroid coordinate tuple `(row, col)`. + Centroid coordinate tuple ``(row, col)``. **convex_area** : int Number of pixels of convex hull image. **convex_image** : (H, J) ndarray Binary convex hull image which has the same size as bounding box. **coords** : (N, 2) ndarray - Coordinate list `(row, col)` of the region. + Coordinate list ``(row, col)`` of the region. **eccentricity** : float Eccentricity of the ellipse that has the same second-moments as the region. The eccentricity is the ratio of the distance between its @@ -366,7 +365,7 @@ def regionprops(label_image, properties=None, subtracted by number of holes (8-connectivity). **extent** : float Ratio of pixels in the region to pixels in the total bounding box. - Computed as `Area / (rows*cols)` + Computed as ``area / (rows * cols)`` **filled_area** : int Number of pixels of filled region. **filled_image** : (H, J) ndarray @@ -375,11 +374,11 @@ def regionprops(label_image, properties=None, **image** : (H, J) ndarray Sliced binary region image which has the same size as bounding box. **inertia_tensor** : (2, 2) ndarray - Inertia tensor of the region for the rotation around its masss. + Inertia tensor of the region for the rotation around its mass. **inertia_tensor_eigvals** : tuple The two eigen values of the inertia tensor in decreasing order. **label** : int - The label in the labelled input image. + The label in the labeled input image. **major_axis_length** : float The length of the major axis of the ellipse that has the same normalized second central moments as the region. @@ -423,7 +422,7 @@ def regionprops(label_image, properties=None, **solidity** : float Ratio of pixels in the region to pixels of the convex hull image. **weighted_centroid** : array - Centroid coordinate tuple `(row, col)` weighted with intensity + Centroid coordinate tuple ``(row, col)`` weighted with intensity image. **weighted_moments** : (3, 3) ndarray Spatial moments of intensity image up to 3rd order::