Build gallery with sphinx-gallery

Modified comments in some gallery examples for compatibility with
sphinx-gallery parsing. Also modified some links in the narrative doc
since image file names have changed.
This commit is contained in:
emmanuelle
2016-05-10 21:49:15 +02:00
parent ef9bcfb778
commit 844858f01b
23 changed files with 688 additions and 945 deletions
+4 -1
View File
@@ -14,7 +14,7 @@
import sys
import os
import skimage
import sphinx_gallery
# If extensions (or modules to document with autodoc) are in another directory,
# add these directories to sys.path here. If the directory is relative to the
# documentation root, use os.path.abspath to make it absolute, like shown here.
@@ -37,11 +37,14 @@ extensions = ['sphinx.ext.autodoc',
'sphinx_gallery.gen_gallery'
]
autosummary_generate = True
#------------------------------------------------------------------------
# Sphinx-gallery configuration
#------------------------------------------------------------------------
sphinx_gallery_conf = {
'doc_module' : 'skimage',
# path to your examples scripts
'examples_dirs' : '../examples',
# path where to save gallery generated examples
@@ -6,9 +6,9 @@
Release notes
=============
.. include:: ../release/_release_notes_for_docs.txt
.. include:: ../release/_release_notes_for_docs.rst
Installation
============
.. include:: install.txt
.. include:: install.rst
+1 -1
View File
@@ -81,7 +81,7 @@ disk: ::
... (nrows / 2)**2)
>>> camera[outer_disk_mask] = 0
.. image:: ../auto_examples/numpy_operations/images/plot_camera_numpy_1.png
.. image:: ../../_images/sphx_glr_plot_camera_numpy_001.png
:width: 45%
:target: ../auto_examples/numpy_operations/plot_camera_numpy.html
@@ -78,7 +78,7 @@ using an array of labels to encode the regions to be represented with the
same color.
.. image: ../auto_examples/segmentation/images/plot_join_segmentations_1.png
.. image:: ../../_images/sphx_glr_plot_join_segmentations_001.png
:target: ../auto_examples/segmentation/plot_join_segmentations.html
:align: center
:width: 80%
@@ -87,9 +87,9 @@ same color.
.. topic:: Examples:
* :ref:`example_color_exposure_plot_tinting_grayscale_images.py`
* :ref:`example_segmentation_plot_join_segmentations.py`
* :ref:`example_segmentation_plot_rag_mean_color.py`
* :ref:`sphx_glr_auto_examples_color_exposure_plot_tinting_grayscale_images.py`
* :ref:`sphx_glr_auto_examples_segmentation_plot_join_segmentations.py`
* :ref:`sphx_glr_auto_examples_segmentation_plot_rag_mean_color.py`
Contrast and exposure
@@ -157,9 +157,9 @@ details are enhanced in large regions with poor contrast. As a further
refinement, histogram equalization can be performed in subregions of the
image with :func:`equalize_adapthist`, in order to correct for exposure
gradients across the image. See the example
:ref:`example_color_exposure_plot_equalize.py`.
:ref:`sphx_glr_auto_examples_color_exposure_plot_equalize.py`.
.. image:: ../auto_examples/color_exposure/images/plot_equalize_1.png
.. image:: ../../_images/sphx_glr_plot_equalize_001.png
:target: ../auto_examples/color_exposure/plot_equalize.html
:align: center
:width: 90%
@@ -167,6 +167,6 @@ gradients across the image. See the example
.. topic:: Examples:
* :ref:`example_color_exposure_plot_equalize.py`
* :ref:`sphx_glr_auto_examples_color_exposure_plot_equalize.py`
@@ -11,7 +11,7 @@ the coins cannot be done directly from the histogram of grey values,
because the background shares enough grey levels with the coins that a
thresholding segmentation is not sufficient.
.. image:: ../auto_examples/xx_applications/images/plot_coins_segmentation_1.png
.. image:: ../../_images/sphx_glr_plot_coins_segmentation_001.png
:target: ../auto_examples/xx_applications/plot_coins_segmentation.html
:align: center
@@ -26,7 +26,7 @@ Simply thresholding the image leads either to missing significant parts
of the coins, or to merging parts of the background with the
coins. This is due to the inhomogeneous lighting of the image.
.. image:: ../auto_examples/xx_applications/images/plot_coins_segmentation_2.png
.. image:: ../../_images/sphx_glr_plot_coins_segmentation_002.png
:target: ../auto_examples/xx_applications/plot_coins_segmentation.html
:align: center
@@ -53,7 +53,7 @@ boundary of the coins, or inside the coins.
>>> from scipy import ndimage as ndi
>>> fill_coins = ndi.binary_fill_holes(edges)
.. image:: ../auto_examples/xx_applications/images/plot_coins_segmentation_3.png
.. image:: ../../_images/sphx_glr_plot_coins_segmentation_003.png
:target: ../auto_examples/xx_applications/plot_coins_segmentation.html
:align: center
@@ -62,7 +62,7 @@ we fill the inner part of the coins using the
``ndi.binary_fill_holes`` function, which uses mathematical morphology
to fill the holes.
.. image:: ../auto_examples/xx_applications/images/plot_coins_segmentation_4.png
.. image:: ../../_images/sphx_glr_plot_coins_segmentation_004.png
:target: ../auto_examples/xx_applications/plot_coins_segmentation.html
:align: center
@@ -83,7 +83,7 @@ has not been segmented correctly at all. The reason is that the contour
that we got from the Canny detector was not completely closed, therefore
the filling function did not fill the inner part of the coin.
.. image:: ../auto_examples/xx_applications/images/plot_coins_segmentation_5.png
.. image:: ../../_images/sphx_glr_plot_coins_segmentation_005.png
:target: ../auto_examples/xx_applications/plot_coins_segmentation.html
:align: center
@@ -128,7 +128,7 @@ separate the coins from the background.
and here is the corresponding 2-D plot:
.. image:: ../auto_examples/xx_applications/images/plot_coins_segmentation_6.png
.. image:: ../../_images/sphx_glr_plot_coins_segmentation_006.png
:target: ../auto_examples/xx_applications/plot_coins_segmentation.html
:align: center
@@ -139,7 +139,7 @@ extreme parts of the histogram of grey values::
>>> markers[coins < 30] = 1
>>> markers[coins > 150] = 2
.. image:: ../auto_examples/xx_applications/images/plot_coins_segmentation_7.png
.. image:: ../../_images/sphx_glr_plot_coins_segmentation_007.png
:target: ../auto_examples/xx_applications/plot_coins_segmentation.html
:align: center
@@ -148,7 +148,7 @@ Let us now compute the watershed transform::
>>> from skimage.morphology import watershed
>>> segmentation = watershed(elevation_map, markers)
.. image:: ../auto_examples/xx_applications/images/plot_coins_segmentation_8.png
.. image:: ../../_images/sphx_glr_plot_coins_segmentation_008.png
:target: ../auto_examples/xx_applications/plot_coins_segmentation.html
:align: center
@@ -165,7 +165,7 @@ We can now label all the coins one by one using ``ndi.label``::
>>> labeled_coins, _ = ndi.label(segmentation)
.. image:: ../auto_examples/xx_applications/images/plot_coins_segmentation_9.png
.. image:: ../../_images/sphx_glr_plot_coins_segmentation_009.png
:target: ../auto_examples/xx_applications/plot_coins_segmentation.html
:align: center