From 8c0d79889694e6c26475fe1c83745b276e018166 Mon Sep 17 00:00:00 2001 From: Tony S Yu Date: Thu, 23 Jun 2011 11:15:31 -0400 Subject: [PATCH] Reorder eps and weight keyword args to tv_denoise --- scikits/image/filter/tv_denoise.py | 34 +++++++++++++++--------------- 1 file changed, 17 insertions(+), 17 deletions(-) diff --git a/scikits/image/filter/tv_denoise.py b/scikits/image/filter/tv_denoise.py index 8114837c..f2987b55 100644 --- a/scikits/image/filter/tv_denoise.py +++ b/scikits/image/filter/tv_denoise.py @@ -1,6 +1,6 @@ import numpy as np -def _tv_denoise_3d(im, eps=2.e-4, weight=100, keep_type=False, n_iter_max=200): +def _tv_denoise_3d(im, weight=100, eps=2.e-4, keep_type=False, n_iter_max=200): """ Perform total-variation denoising on 3-D arrays @@ -9,15 +9,15 @@ def _tv_denoise_3d(im, eps=2.e-4, weight=100, keep_type=False, n_iter_max=200): im: ndarray 3-D input data to be denoised + weight: float, optional + denoising weight. The greater ``weight``, the more denoising (at + the expense of fidelity to ``input``) + eps: float, optional relative difference of the value of the cost function that determines the stop criterion. The algorithm stops when (E_(n-1) - E_n) < eps * E_0 - weight: float, optional - denoising weight. The greater ``weight``, the more denoising (at - the expense of fidelity to ``input``) - keep_type: bool, optional (False) whether the output has the same dtype as the input array. keep_type is False by default, and the dtype of the output @@ -92,7 +92,7 @@ def _tv_denoise_3d(im, eps=2.e-4, weight=100, keep_type=False, n_iter_max=200): else: return out -def _tv_denoise_2d(im, eps=2.e-4, weight=50, keep_type=False, n_iter_max=200): +def _tv_denoise_2d(im, weight=50, eps=2.e-4, keep_type=False, n_iter_max=200): """ Perform total-variation denoising @@ -101,15 +101,15 @@ def _tv_denoise_2d(im, eps=2.e-4, weight=50, keep_type=False, n_iter_max=200): im: ndarray input data to be denoised + weight: float, optional + denoising weight. The greater ``weight``, the more denoising (at + the expense of fidelity to ``input``) + eps: float, optional relative difference of the value of the cost function that determines the stop criterion. The algorithm stops when (E_(n-1) - E_n) < eps * E_0 - weight: float, optional - denoising weight. The greater ``weight``, the more denoising (at - the expense of fidelity to ``input``) - keep_type: bool, optional (False) whether the output has the same dtype as the input array. keep_type is False by default, and the dtype of the output @@ -188,7 +188,7 @@ def _tv_denoise_2d(im, eps=2.e-4, weight=50, keep_type=False, n_iter_max=200): else: return out -def tv_denoise(im, eps=2.e-4, weight=50, keep_type=False, n_iter_max=200): +def tv_denoise(im, weight=50, eps=2.e-4, keep_type=False, n_iter_max=200): """ Perform total-variation denoising on 2-d and 3-d images @@ -199,15 +199,15 @@ def tv_denoise(im, eps=2.e-4, weight=50, keep_type=False, n_iter_max=200): but it is cast into an ndarray of floats for the computation of the denoised image. + weight: float, optional + denoising weight. The greater ``weight``, the more denoising (at + the expense of fidelity to ``input``) + eps: float, optional relative difference of the value of the cost function that determines the stop criterion. The algorithm stops when (E_(n-1) - E_n) < eps * E_0 - weight: float, optional - denoising weight. The greater ``weight``, the more denoising (at - the expense of fidelity to ``input``) - keep_type: bool, optional (False) whether the output has the same dtype as the input array. keep_type is False by default, and the dtype of the output @@ -261,9 +261,9 @@ def tv_denoise(im, eps=2.e-4, weight=50, keep_type=False, n_iter_max=200): """ if im.ndim == 2: - return _tv_denoise_2d(im, eps, weight, keep_type, n_iter_max) + return _tv_denoise_2d(im, weight, eps, keep_type, n_iter_max) elif im.ndim == 3: - return _tv_denoise_3d(im, eps, weight, keep_type, n_iter_max) + return _tv_denoise_3d(im, weight, eps, keep_type, n_iter_max) else: raise ValueError('only 2-d and 3-d images may be denoised with this function')