From 06142872b45168eee54de76eafcd90e6118da2b4 Mon Sep 17 00:00:00 2001 From: Tony S Yu Date: Mon, 8 Oct 2012 20:30:33 -0400 Subject: [PATCH] DOC: Add imports to doctests to fix errors --- skimage/morphology/grey.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/skimage/morphology/grey.py b/skimage/morphology/grey.py index e7e52de4..45d11729 100644 --- a/skimage/morphology/grey.py +++ b/skimage/morphology/grey.py @@ -45,6 +45,7 @@ def erosion(image, selem, out=None, shift_x=False, shift_y=False): Examples -------- >>> # Erosion shrinks bright regions + >>> import numpy as np >>> from skimage.morphology import square >>> bright_square = np.array([[0, 0, 0, 0, 0], ... [0, 1, 1, 1, 0], @@ -97,6 +98,7 @@ def dilation(image, selem, out=None, shift_x=False, shift_y=False): Examples -------- >>> # Dilation enlarges bright regions + >>> import numpy as np >>> from skimage.morphology import square >>> bright_pixel = np.array([[0, 0, 0, 0, 0], ... [0, 0, 0, 0, 0], @@ -146,6 +148,7 @@ def opening(image, selem, out=None): Examples -------- >>> # Open up gap between two bright regions (but also shrink regions) + >>> import numpy as np >>> from skimage.morphology import square >>> bad_connection = np.array([[1, 0, 0, 0, 1], ... [1, 1, 0, 1, 1], @@ -196,6 +199,7 @@ def closing(image, selem, out=None): Examples -------- >>> # Close a gap between two bright lines + >>> import numpy as np >>> from skimage.morphology import square >>> broken_line = np.array([[0, 0, 0, 0, 0], ... [0, 0, 0, 0, 0], @@ -245,6 +249,7 @@ def white_tophat(image, selem, out=None): Examples -------- >>> # Subtract grey background from bright peak + >>> import numpy as np >>> from skimage.morphology import square >>> bright_on_grey = np.array([[2, 3, 3, 3, 2], ... [3, 4, 5, 4, 3], @@ -294,6 +299,7 @@ def black_tophat(image, selem, out=None): Examples -------- >>> # Change dark peak to bright peak and subtract background + >>> import numpy as np >>> from skimage.morphology import square >>> dark_on_grey = np.array([[7, 6, 6, 6, 7], ... [6, 5, 4, 5, 6],