From ab4e95e4f38a55dd645a52cafc88e2946780caca Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Johannes=20Sch=C3=B6nberger?= Date: Thu, 25 Jul 2013 22:35:12 +0200 Subject: [PATCH 1/3] Fix typo in doc string --- skimage/filter/_denoise_cy.pyx | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/skimage/filter/_denoise_cy.pyx b/skimage/filter/_denoise_cy.pyx index b80b8e6b..0089e7b4 100644 --- a/skimage/filter/_denoise_cy.pyx +++ b/skimage/filter/_denoise_cy.pyx @@ -98,7 +98,7 @@ def denoise_bilateral(image, Py_ssize_t win_size=5, sigma_range=None, """ image = np.atleast_3d(img_as_float(image)) - + # if image.max() is 0, then dist_scale can have an unverified value # and color_lut[(dist * dist_scale)] may cause a segmentation fault # so we verify we have a positive image and that the max is not 0.0. @@ -112,7 +112,7 @@ def denoise_bilateral(image, Py_ssize_t win_size=5, sigma_range=None, Py_ssize_t window_ext = (win_size - 1) / 2 double max_value - + cnp.ndarray[dtype=cnp.double_t, ndim=3, mode='c'] cimage cnp.ndarray[dtype=cnp.double_t, ndim=3, mode='c'] out @@ -136,12 +136,12 @@ def denoise_bilateral(image, Py_ssize_t win_size=5, sigma_range=None, csigma_range = sigma_range max_value = image.max() - + if max_value == 0.0: raise ValueError("The maximum value found in the image was 0.") cimage = np.ascontiguousarray(image) - + out = np.zeros((rows, cols, dims), dtype=np.double) image_data = cimage.data out_data = out.data @@ -224,8 +224,8 @@ def denoise_tv_bregman(image, double weight, int max_iter=100, double eps=1e-3, max_iter: int, optional Maximal number of iterations used for the optimization. - isotropic: boolean, optimal - Switch between isotropic and anisotropic tv denoising + isotropic: boolean, optional + Switch between isotropic and anisotropic TV denoising. Returns ------- @@ -241,7 +241,7 @@ def denoise_tv_bregman(image, double weight, int max_iter=100, double eps=1e-3, .. [3] Pascal Getreuer, "Rudin–Osher–Fatemi Total Variation Denoising using Split Bregman" in Image Processing On Line on 2012–05–19, http://www.ipol.im/pub/art/2012/g-tvd/article_lr.pdf - .. [4] http://www.math.ucsb.edu/~cgarcia/UGProjects/BregmanAlgorithms_JacquelineBush.pdf + .. [4] http://www.math.ucsb.edu/~cgarcia/UGProjects/BregmanAlgorithms_JacquelineBush.pdf """ From 79a88f81f59e15f47617bf91384fc51c8193af72 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Johannes=20Sch=C3=B6nberger?= Date: Thu, 25 Jul 2013 22:36:06 +0200 Subject: [PATCH 2/3] Wrap line --- skimage/filter/_denoise_cy.pyx | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/skimage/filter/_denoise_cy.pyx b/skimage/filter/_denoise_cy.pyx index 0089e7b4..b4d9b1d3 100644 --- a/skimage/filter/_denoise_cy.pyx +++ b/skimage/filter/_denoise_cy.pyx @@ -200,7 +200,8 @@ def denoise_bilateral(image, Py_ssize_t win_size=5, sigma_range=None, return np.squeeze(out) -def denoise_tv_bregman(image, double weight, int max_iter=100, double eps=1e-3, isotropic=True): +def denoise_tv_bregman(image, double weight, int max_iter=100, double eps=1e-3, + isotropic=True): """Perform total-variation denoising using split-Bregman optimization. Total-variation denoising (also know as total-variation regularization) From 012f8b4ea112b6d08061044118995e5baaf642b4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Johannes=20Sch=C3=B6nberger?= Date: Thu, 25 Jul 2013 22:36:41 +0200 Subject: [PATCH 3/3] Add missing space in parameter defintion in doc string --- skimage/filter/_denoise_cy.pyx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/skimage/filter/_denoise_cy.pyx b/skimage/filter/_denoise_cy.pyx index b4d9b1d3..3459171c 100644 --- a/skimage/filter/_denoise_cy.pyx +++ b/skimage/filter/_denoise_cy.pyx @@ -223,9 +223,9 @@ def denoise_tv_bregman(image, double weight, int max_iter=100, double eps=1e-3, SUM((u(n) - u(n-1))**2) < eps - max_iter: int, optional + max_iter : int, optional Maximal number of iterations used for the optimization. - isotropic: boolean, optional + isotropic : boolean, optional Switch between isotropic and anisotropic TV denoising. Returns