From f7959e3f0727bcab47cdf3b8f1250bbb45788af0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Johannes=20Sch=C3=B6nberger?= Date: Sun, 26 May 2013 12:20:06 +0200 Subject: [PATCH 01/10] Fix doc string injection of deprecated wrapper --- skimage/_shared/utils.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/skimage/_shared/utils.py b/skimage/_shared/utils.py index acdf9c16..aad9220d 100644 --- a/skimage/_shared/utils.py +++ b/skimage/_shared/utils.py @@ -27,9 +27,9 @@ class deprecated(object): alt_msg = '' if self.alt_func is not None: - alt_msg = ' Use `%s` instead.' % self.alt_func + alt_msg = ' Use ``%s`` instead.' % self.alt_func - msg = 'Call to deprecated function `%s`.' % func.__name__ + msg = 'Call to deprecated function ``%s``.' % func.__name__ msg += alt_msg @functools.wraps(func) @@ -48,6 +48,6 @@ class deprecated(object): if wrapped.__doc__ is None: wrapped.__doc__ = doc else: - wrapped.__doc__ = doc + '\n\n' + wrapped.__doc__ + wrapped.__doc__ = doc + '\n\n ' + wrapped.__doc__ return wrapped From 769d7d1245beb0c3d3587bf7357e2bc6fdbbab3f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Johannes=20Sch=C3=B6nberger?= Date: Sun, 26 May 2013 12:20:37 +0200 Subject: [PATCH 02/10] Fix invalid index of reference --- doc/examples/applications/plot_rank_filters.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/examples/applications/plot_rank_filters.py b/doc/examples/applications/plot_rank_filters.py index c182671d..31284226 100644 --- a/doc/examples/applications/plot_rank_filters.py +++ b/doc/examples/applications/plot_rank_filters.py @@ -361,7 +361,7 @@ The example compares the local threshold with the global threshold Local thresholding is much slower than global one. There exists a function for global Otsu thresholding: `skimage.filter.threshold_otsu`. -.. [1] http://en.wikipedia.org/wiki/Otsu's_method +.. [4] http://en.wikipedia.org/wiki/Otsu's_method """ From 17b2c4fd18e9ba49441f093bdaa3132878284627 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Johannes=20Sch=C3=B6nberger?= Date: Sun, 26 May 2013 12:21:13 +0200 Subject: [PATCH 03/10] Escape latex math symbols --- doc/examples/plot_swirl.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/doc/examples/plot_swirl.py b/doc/examples/plot_swirl.py index f05246b0..98226a20 100644 --- a/doc/examples/plot_swirl.py +++ b/doc/examples/plot_swirl.py @@ -42,9 +42,9 @@ mapping for the swirl transformation first computes, relative to a center .. math:: - \theta = \arctan(y/x) + \\theta = \\arctan(y/x) - \rho = \sqrt{(x - x_0)^2 + (y - y_0)^2}, + \\rho = \sqrt{(x - x_0)^2 + (y - y_0)^2}, and then transforms them according to @@ -56,12 +56,12 @@ and then transforms them according to s = \mathtt{strength} - \theta' = \phi + s \, e^{-\rho / r + \theta} + \\theta' = \phi + s \, e^{-\\rho / r + \\theta} where ``strength`` is a parameter for the amount of swirl, ``radius`` indicates the swirl extent in pixels, and ``rotation`` adds a rotation angle. The transformation of ``radius`` into :math:`r` is to ensure that the -transformation decays to :math:`\approx 1/1000^{\mathsf{th}}` within the +transformation decays to :math:`\\approx 1/1000^{\mathsf{th}}` within the specified radius. """ From b9cf2145097f8d1c702183a09bf2d54f669e2218 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Johannes=20Sch=C3=B6nberger?= Date: Sun, 26 May 2013 12:21:54 +0200 Subject: [PATCH 04/10] Add filter.rank to __all__ of filter package --- skimage/filter/__init__.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/skimage/filter/__init__.py b/skimage/filter/__init__.py index ef8460a5..1e13a87e 100644 --- a/skimage/filter/__init__.py +++ b/skimage/filter/__init__.py @@ -9,6 +9,7 @@ from ._denoise_cy import denoise_bilateral, denoise_tv_bregman from ._rank_order import rank_order from ._gabor import gabor_kernel, gabor_filter from .thresholding import threshold_otsu, threshold_adaptive +from . import rank __all__ = ['inverse', @@ -36,4 +37,5 @@ __all__ = ['inverse', 'gabor_kernel', 'gabor_filter', 'threshold_otsu', - 'threshold_adaptive'] + 'threshold_adaptive', + 'rank'] From 0d3e752b4dbbcfb5bc14e136fa5e69d6164e9546 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Johannes=20Sch=C3=B6nberger?= Date: Sun, 26 May 2013 12:22:26 +0200 Subject: [PATCH 05/10] Fix indentation of ransac doc string example --- skimage/measure/fit.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/skimage/measure/fit.py b/skimage/measure/fit.py index 87febf70..66502ffa 100644 --- a/skimage/measure/fit.py +++ b/skimage/measure/fit.py @@ -559,7 +559,7 @@ def ransac(data, model_class, min_samples, residual_threshold, >>> ransac_model, inliers = ransac(data, EllipseModel, 5, 3, max_trials=50) >>> # ransac_model._params, inliers - Should give the correct result estimated without the faulty data: + Should give the correct result estimated without the faulty data:: [ 20.12762373, 29.73563061, 4.81499637, 10.4743584, 0.05217117] [ 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, From 71e7eb9a0db49e21e059d48e8bfae0b1125b11a9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Johannes=20Sch=C3=B6nberger?= Date: Sun, 26 May 2013 12:41:08 +0200 Subject: [PATCH 06/10] Fix styling of math and blockquote --- doc/source/themes/scikit-image/static/css/custom.css | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/doc/source/themes/scikit-image/static/css/custom.css b/doc/source/themes/scikit-image/static/css/custom.css index 85a174df..20d31501 100644 --- a/doc/source/themes/scikit-image/static/css/custom.css +++ b/doc/source/themes/scikit-image/static/css/custom.css @@ -41,6 +41,9 @@ h6 { font-size: 13px; line-height: 15px; } +blockquote { + border-left: 0; +} .logo { float: left; @@ -222,3 +225,8 @@ p.admonition-title { width: 200px; text-align: center !important; } + +/* misc */ +div.math { + text-align: center; +} From 3dc4824fb5dc59b70bbda49beaf44004b9701a35 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Johannes=20Sch=C3=B6nberger?= Date: Sun, 26 May 2013 12:49:26 +0200 Subject: [PATCH 07/10] Fix doc string of threshold_adaptive --- skimage/filter/thresholding.py | 19 +++++++++---------- 1 file changed, 9 insertions(+), 10 deletions(-) diff --git a/skimage/filter/thresholding.py b/skimage/filter/thresholding.py index 77f244fc..40e62d12 100644 --- a/skimage/filter/thresholding.py +++ b/skimage/filter/thresholding.py @@ -9,10 +9,10 @@ def threshold_adaptive(image, block_size, method='gaussian', offset=0, mode='reflect', param=None): """Applies an adaptive threshold to an array. - Also known as local or dynamic thresholding where the threshold value is the - weighted mean for the local neighborhood of a pixel subtracted by a - constant. Alternatively the threshold can be determined dynamically by a - a given function using the 'generic' method. + Also known as local or dynamic thresholding where the threshold value is + the weighted mean for the local neighborhood of a pixel subtracted by a + constant. Alternatively the threshold can be determined dynamically by a a + given function using the 'generic' method. Parameters ---------- @@ -26,10 +26,10 @@ def threshold_adaptive(image, block_size, method='gaussian', offset=0, weighted mean image. * 'generic': use custom function (see `param` parameter) - * 'gaussian': apply gaussian filter (see `param` parameter for custom + * 'gaussian': apply gaussian filter (see `param` parameter for custom\ sigma value) * 'mean': apply arithmetic mean filter - * 'median' apply median rank filter + * 'median': apply median rank filter By default the 'gaussian' method is used. offset : float, optional @@ -42,8 +42,8 @@ def threshold_adaptive(image, block_size, method='gaussian', offset=0, param : {int, function}, optional Either specify sigma for 'gaussian' method or function object for 'generic' method. This functions takes the flat array of local - neighbourhood as a single argument and returns the calculated threshold - for the centre pixel. + neighbourhood as a single argument and returns the calculated + threshold for the centre pixel. Returns ------- @@ -52,8 +52,7 @@ def threshold_adaptive(image, block_size, method='gaussian', offset=0, References ---------- - http://docs.opencv.org/modules/imgproc/doc/miscellaneous_transformations - .html?highlight=threshold#adaptivethreshold + .. [1] http://docs.opencv.org/modules/imgproc/doc/miscellaneous_transformations.html?highlight=threshold#adaptivethreshold Examples -------- From b0b7d113f8323ebff65b34e52bdc4196e71a770e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Johannes=20Sch=C3=B6nberger?= Date: Sun, 26 May 2013 12:54:14 +0200 Subject: [PATCH 08/10] Remove bold font from dt tags --- doc/source/themes/scikit-image/static/css/custom.css | 3 +++ 1 file changed, 3 insertions(+) diff --git a/doc/source/themes/scikit-image/static/css/custom.css b/doc/source/themes/scikit-image/static/css/custom.css index 20d31501..18ee7a34 100644 --- a/doc/source/themes/scikit-image/static/css/custom.css +++ b/doc/source/themes/scikit-image/static/css/custom.css @@ -44,6 +44,9 @@ h6 { blockquote { border-left: 0; } +dt { + font-weight: normal; +} .logo { float: left; From 35a73c25b8c7a0a566a0f68ad5f02484229de249 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Johannes=20Sch=C3=B6nberger?= Date: Sun, 26 May 2013 12:55:21 +0200 Subject: [PATCH 09/10] Fix quick search description --- doc/source/user_guide/getting_help.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/source/user_guide/getting_help.txt b/doc/source/user_guide/getting_help.txt index ea444856..7d56fea4 100644 --- a/doc/source/user_guide/getting_help.txt +++ b/doc/source/user_guide/getting_help.txt @@ -24,7 +24,7 @@ Contributing examples to the gallery can be done on github (see Search field ------------ -The ``quick search`` field located in the sidebar of the html +The ``quick search`` field located in the navigation bar of the html documentation can be used to search for specific keywords (segmentation, rescaling, denoising, etc.). From de39f58308bf1c0bd6cc32dfcd36acc9c66b783c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Johannes=20Sch=C3=B6nberger?= Date: Sun, 26 May 2013 13:01:25 +0200 Subject: [PATCH 10/10] Update installation instructions --- doc/source/install.txt | 23 ++++++++--------------- 1 file changed, 8 insertions(+), 15 deletions(-) diff --git a/doc/source/install.txt b/doc/source/install.txt index 7c886549..5e57a540 100644 --- a/doc/source/install.txt +++ b/doc/source/install.txt @@ -6,8 +6,9 @@ Pre-built installation are kindly provided by Christoph Gohlke. The latest stable release is also included as part of the `Enthought Python -Distribution (EPD) `__ and `Python(x,y) -`__. +Distribution (EPD) `__, `Python(x,y) +`__ and +`Anaconda `__. On systems that support setuptools, the package can be installed from the `Python packaging index `__ using @@ -28,34 +29,26 @@ Installation from source Obtain the source from the git-repository at `http://github.com/scikit-image/scikit-image -`_. - -by running - -:: +`_ by running:: git clone http://github.com/scikit-image/scikit-image.git -in a terminal (You will need to have git installed on your machine). +in a terminal (you will need to have git installed on your machine). If you do not have git installed, you can also download a zipball from `https://github.com/scikit-image/scikit-image/zipball/master `_. -The SciKit can be installed globally using - -:: +The SciKit can be installed globally using:: python setup.py install -or locally using - -:: +or locally using:: python setup.py install --prefix=${HOME} If you prefer, you can use it without installing, by simply adding -this path to your PYTHONPATH variable and compiling extensions +this path to your ``PYTHONPATH`` variable and compiling extensions in-place:: python setup.py build_ext -i