From 8f20fff3f8b6335d7e9dcec239bfc3df121cf0c4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fran=C3=A7ois=20Boulogne?= Date: Wed, 2 Oct 2013 18:03:42 +0200 Subject: [PATCH] PEP8: fix indentation --- skimage/filter/rank/generic.py | 8 ++++---- skimage/filter/thresholding.py | 22 +++++++++++----------- skimage/measure/find_contours.py | 2 +- 3 files changed, 16 insertions(+), 16 deletions(-) diff --git a/skimage/filter/rank/generic.py b/skimage/filter/rank/generic.py index 247701d5..5ed9a46b 100644 --- a/skimage/filter/rank/generic.py +++ b/skimage/filter/rank/generic.py @@ -249,8 +249,8 @@ def maximum(image, selem, out=None, mask=None, shift_x=False, shift_y=False): Note ---- - * the lower algorithm complexity makes the rank.maximum() more efficient for - larger images and structuring elements + * the lower algorithm complexity makes the rank.maximum() more efficient + for larger images and structuring elements """ @@ -299,7 +299,7 @@ def mean(image, selem, out=None, mask=None, shift_x=False, shift_y=False): def subtract_mean(image, selem, out=None, mask=None, shift_x=False, - shift_y=False): + shift_y=False): """Return image subtracted from its local mean. Parameters @@ -439,7 +439,7 @@ def modal(image, selem, out=None, mask=None, shift_x=False, shift_y=False): def enhance_contrast(image, selem, out=None, mask=None, shift_x=False, - shift_y=False): + shift_y=False): """Enhance an image replacing each pixel by the local maximum if pixel greylevel is closest to maximimum than local minimum OR local minimum otherwise. diff --git a/skimage/filter/thresholding.py b/skimage/filter/thresholding.py index bc052d8a..7f980387 100644 --- a/skimage/filter/thresholding.py +++ b/skimage/filter/thresholding.py @@ -1,4 +1,4 @@ -__all__ = ['threshold_adaptive', 'threshold_otsu', 'threshold_yen'] +__all__ = ['threshold_adaptive', 'threshold_otsu', 'threshold_yen'] import numpy as np import scipy.ndimage @@ -65,7 +65,7 @@ def threshold_adaptive(image, block_size, method='gaussian', offset=0, thresh_image = np.zeros(image.shape, 'double') if method == 'generic': scipy.ndimage.generic_filter(image, param, block_size, - output=thresh_image, mode=mode) + output=thresh_image, mode=mode) elif method == 'gaussian': if param is None: # automatically determine sigma which covers > 99% of distribution @@ -73,17 +73,17 @@ def threshold_adaptive(image, block_size, method='gaussian', offset=0, else: sigma = param scipy.ndimage.gaussian_filter(image, sigma, output=thresh_image, - mode=mode) + mode=mode) elif method == 'mean': mask = 1. / block_size * np.ones((block_size,)) # separation of filters to speedup convolution scipy.ndimage.convolve1d(image, mask, axis=0, output=thresh_image, - mode=mode) + mode=mode) scipy.ndimage.convolve1d(thresh_image, mask, axis=1, - output=thresh_image, mode=mode) + output=thresh_image, mode=mode) elif method == 'median': scipy.ndimage.median_filter(image, block_size, output=thresh_image, - mode=mode) + mode=mode) return image > (thresh_image - offset) @@ -146,7 +146,7 @@ def threshold_yen(image, nbins=256): nbins : int, optional Number of bins used to calculate histogram. This value is ignored for integer arrays. - + Returns ------- threshold : float @@ -155,11 +155,11 @@ def threshold_yen(image, nbins=256): References ---------- - .. [1] Yen J.C., Chang F.J., and Chang S. (1995) "A New Criterion - for Automatic Multilevel Thresholding" IEEE Trans. on Image + .. [1] Yen J.C., Chang F.J., and Chang S. (1995) "A New Criterion + for Automatic Multilevel Thresholding" IEEE Trans. on Image Processing, 4(3): 370-378 - .. [2] Sezgin M. and Sankur B. (2004) "Survey over Image Thresholding - Techniques and Quantitative Performance Evaluation" Journal of + .. [2] Sezgin M. and Sankur B. (2004) "Survey over Image Thresholding + Techniques and Quantitative Performance Evaluation" Journal of Electronic Imaging, 13(1): 146-165, http://www.busim.ee.boun.edu.tr/~sankur/SankurFolder/Threshold_survey.pdf .. [3] ImageJ AutoThresholder code, http://fiji.sc/wiki/index.php/Auto_Threshold diff --git a/skimage/measure/find_contours.py b/skimage/measure/find_contours.py index 298c09de..d36c2110 100755 --- a/skimage/measure/find_contours.py +++ b/skimage/measure/find_contours.py @@ -116,7 +116,7 @@ def find_contours(array, level, raise ValueError('Parameters "fully_connected" and' ' "positive_orientation" must be either "high" or "low".') point_list = _find_contours.iterate_and_store(array, level, - fully_connected == 'high') + fully_connected == 'high') contours = _assemble_contours(_take_2(point_list)) if positive_orientation == 'high': contours = [c[::-1] for c in contours]