Modified a few docstrings that made doctesting fail

This commit is contained in:
emmanuelle
2014-12-07 16:58:36 +01:00
parent f82243904f
commit 873a2bab4f
4 changed files with 11 additions and 10 deletions
+3 -3
View File
@@ -109,15 +109,15 @@ def canny(image, sigma=1., low_threshold=None, high_threshold=None, mask=None):
Examples
--------
>>> from skimage import filters
>>> from skimage import feature
>>> # Generate noisy image of a square
>>> im = np.zeros((256, 256))
>>> im[64:-64, 64:-64] = 1
>>> im += 0.2 * np.random.rand(*im.shape)
>>> # First trial with the Canny filter, with the default smoothing
>>> edges1 = filter.canny(im)
>>> edges1 = feature.canny(im)
>>> # Increase the smoothing for better results
>>> edges2 = filter.canny(im, sigma=3)
>>> edges2 = feature.canny(im, sigma=3)
"""
#
+5 -4
View File
@@ -409,18 +409,19 @@ def label(input, neighbors=None, background=None, return_num=False,
Examples
--------
>>> import numpy as np
>>> x = np.eye(3).astype(int)
>>> print(x)
[[1 0 0]
[0 1 0]
[0 0 1]]
>>> print(m.label(x, connectivity=1))
>>> from skimage.measure import label
>>> print(label(x, neighbors=4))
[[0 1 1]
[2 3 1]
[2 2 4]]
>>> print(m.label(x, connectivity=2))
>>> print(label(x, neighbors=8))
[[0 1 1]
[1 0 1]
[1 1 0]]
@@ -429,7 +430,7 @@ def label(input, neighbors=None, background=None, return_num=False,
... [1, 1, 5],
... [0, 0, 0]])
>>> print(m.label(x, background=0))
>>> print(label(x, background=0))
[[ 0 -1 -1]
[ 0 0 1]
[-1 -1 -1]]
+1 -1
View File
@@ -314,7 +314,7 @@ def denoise_tv_chambolle(im, weight=50, eps=2.e-4, n_iter_max=200,
>>> from skimage import color, data
>>> img = color.rgb2gray(data.astronaut())[:50, :50]
>>> img += 0.5 * img.std() * np.random.randn(*astro.shape)
>>> img += 0.5 * img.std() * np.random.randn(*img.shape)
>>> denoised_img = denoise_tv_chambolle(img, weight=60)
3D example on synthetic data:
+2 -2
View File
@@ -1111,8 +1111,8 @@ def warp(image, inverse_map=None, map_args={}, output_shape=None, order=1,
>>> scale = 0.1
>>> output_shape = (scale * cube_shape).astype(int)
>>> coords0, coords1, coords2 = \
... np.mgrid[:output_shape[0], :output_shape[1], :output_shape[2]]
>>> coords0, coords1, coords2 = np.mgrid[:output_shape[0],
... :output_shape[1], :output_shape[2]]
>>> coords = np.array([coords0, coords1, coords2])
Assume that the cube contains spatial data, where the first array element