From bb732c922585073645a444dcbbccfcdf3969b744 Mon Sep 17 00:00:00 2001 From: Nelson Brown Date: Fri, 11 Jul 2014 13:50:55 -0700 Subject: [PATCH 1/6] Add default structuring element to morphology --- skimage/morphology/binary.py | 19 +++++++--- skimage/morphology/grey.py | 46 ++++++++++++++++++++----- skimage/morphology/selem.py | 21 +++++++++++ skimage/morphology/tests/test_binary.py | 25 ++++++++++++++ skimage/morphology/tests/test_grey.py | 26 ++++++++++++++ 5 files changed, 124 insertions(+), 13 deletions(-) diff --git a/skimage/morphology/binary.py b/skimage/morphology/binary.py index 24c5c0ea..636717af 100644 --- a/skimage/morphology/binary.py +++ b/skimage/morphology/binary.py @@ -1,9 +1,10 @@ import warnings import numpy as np from scipy import ndimage +from .selem import _default_selem -def binary_erosion(image, selem, out=None): +def binary_erosion(image, selem=None, out=None): """Return fast binary morphological erosion of an image. This function returns the same result as greyscale erosion but performs @@ -29,6 +30,11 @@ def binary_erosion(image, selem, out=None): The result of the morphological erosion with values in ``[0, 1]``. """ + + # Default structure element + if selem is None: + selem = _default_selem(image.ndim) + selem = (selem != 0) selem_sum = np.sum(selem) @@ -45,7 +51,7 @@ def binary_erosion(image, selem, out=None): return np.equal(conv, selem_sum, out=out) -def binary_dilation(image, selem, out=None): +def binary_dilation(image, selem=None, out=None): """Return fast binary morphological dilation of an image. This function returns the same result as greyscale dilation but performs @@ -72,6 +78,11 @@ def binary_dilation(image, selem, out=None): The result of the morphological dilation with values in ``[0, 1]``. """ + + # Default structure element + if selem is None: + selem = _default_selem(image.ndim) + selem = (selem != 0) if np.sum(selem) <= 255: @@ -87,7 +98,7 @@ def binary_dilation(image, selem, out=None): return np.not_equal(conv, 0, out=out) -def binary_opening(image, selem, out=None): +def binary_opening(image, selem=None, out=None): """Return fast binary morphological opening of an image. This function returns the same result as greyscale opening but performs @@ -119,7 +130,7 @@ def binary_opening(image, selem, out=None): return out -def binary_closing(image, selem, out=None): +def binary_closing(image, selem=None, out=None): """Return fast binary morphological closing of an image. This function returns the same result as greyscale closing but performs diff --git a/skimage/morphology/grey.py b/skimage/morphology/grey.py index 13e9dfbb..7fb1c8c9 100644 --- a/skimage/morphology/grey.py +++ b/skimage/morphology/grey.py @@ -1,5 +1,8 @@ import warnings from skimage import img_as_ubyte +from scipy import ndimage +from .selem import _default_selem + from . import cmorph @@ -8,7 +11,7 @@ __all__ = ['erosion', 'dilation', 'opening', 'closing', 'white_tophat', 'black_tophat'] -def erosion(image, selem, out=None, shift_x=False, shift_y=False): +def erosion(image, selem=None, out=None, shift_x=False, shift_y=False): """Return greyscale morphological erosion of an image. Morphological erosion sets a pixel at (i,j) to the minimum over all pixels @@ -21,7 +24,7 @@ def erosion(image, selem, out=None, shift_x=False, shift_y=False): Image array. selem : ndarray The neighborhood expressed as a 2-D array of 1's and 0's. - out : ndarray + out : ndarrays The array to store the result of the morphology. If None is passed, a new array will be allocated. shift_x, shift_y : bool @@ -52,6 +55,10 @@ def erosion(image, selem, out=None, shift_x=False, shift_y=False): """ + # Default structure element + if selem is None: + selem = _default_selem(image.ndim) + if image is out: raise NotImplementedError("In-place erosion not supported!") image = img_as_ubyte(image) @@ -60,7 +67,7 @@ def erosion(image, selem, out=None, shift_x=False, shift_y=False): shift_x=shift_x, shift_y=shift_y) -def dilation(image, selem, out=None, shift_x=False, shift_y=False): +def dilation(image, selem=None, out=None, shift_x=False, shift_y=False): """Return greyscale morphological dilation of an image. Morphological dilation sets a pixel at (i,j) to the maximum over all pixels @@ -105,6 +112,10 @@ def dilation(image, selem, out=None, shift_x=False, shift_y=False): """ + # Default structure element + if selem is None: + selem = _default_selem(image.ndim) + if image is out: raise NotImplementedError("In-place dilation not supported!") image = img_as_ubyte(image) @@ -113,7 +124,7 @@ def dilation(image, selem, out=None, shift_x=False, shift_y=False): shift_x=shift_x, shift_y=shift_y) -def opening(image, selem, out=None): +def opening(image, selem=None, out=None): """Return greyscale morphological opening of an image. The morphological opening on an image is defined as an erosion followed by @@ -154,7 +165,11 @@ def opening(image, selem, out=None): [0, 0, 0, 0, 0]], dtype=uint8) """ - + + # Default structure element + if selem is None: + selem = _default_selem(image.ndim) + h, w = selem.shape shift_x = True if (w % 2) == 0 else False shift_y = True if (h % 2) == 0 else False @@ -164,7 +179,7 @@ def opening(image, selem, out=None): return out -def closing(image, selem, out=None): +def closing(image, selem=None, out=None): """Return greyscale morphological closing of an image. The morphological closing on an image is defined as a dilation followed by @@ -206,6 +221,10 @@ def closing(image, selem, out=None): """ + # Default structure element + if selem is None: + selem = _default_selem(image.ndim) + h, w = selem.shape shift_x = True if (w % 2) == 0 else False shift_y = True if (h % 2) == 0 else False @@ -215,7 +234,7 @@ def closing(image, selem, out=None): return out -def white_tophat(image, selem, out=None): +def white_tophat(image, selem=None, out=None): """Return white top hat of an image. The white top hat of an image is defined as the image minus its @@ -254,7 +273,12 @@ def white_tophat(image, selem, out=None): [0, 0, 1, 0, 0], [0, 0, 0, 0, 0]], dtype=uint8) - """ + """ + + # Default structure element + if selem is None: + selem = _default_selem(image.ndim) + if image is out: raise NotImplementedError("Cannot perform white top hat in place.") @@ -263,7 +287,7 @@ def white_tophat(image, selem, out=None): return out -def black_tophat(image, selem, out=None): +def black_tophat(image, selem=None, out=None): """Return black top hat of an image. The black top hat of an image is defined as its morphological closing minus @@ -305,6 +329,10 @@ def black_tophat(image, selem, out=None): """ + # Default structure element + if selem is None: + selem = _default_selem(image.ndim) + if image is out: raise NotImplementedError("Cannot perform white top hat in place.") diff --git a/skimage/morphology/selem.py b/skimage/morphology/selem.py index 7e566773..24adfce6 100644 --- a/skimage/morphology/selem.py +++ b/skimage/morphology/selem.py @@ -4,6 +4,7 @@ """ import numpy as np +from scipy import ndimage def square(width, dtype=np.uint8): @@ -290,3 +291,23 @@ def star(a, dtype=np.uint8): selem = selem_square + selem_rotated selem[selem > 0] = 1 return selem.astype(dtype) + + +def _default_selem(ndim): + """ + Generates a cross-shaped structuring element (connectivity=1). This is the + default structuring element (selem) if no selem was specified. + + Parameters + ---------- + ndim : int + Number of dimensions of the image. + + Returns + ------- + selem : ndarray + The structuring element where elements of the neighborhood + are 1 and 0 otherwise. + + """ + return ndimage.morphology.generate_binary_structure(ndim, 1) \ No newline at end of file diff --git a/skimage/morphology/tests/test_binary.py b/skimage/morphology/tests/test_binary.py index deab3d82..e6d80321 100644 --- a/skimage/morphology/tests/test_binary.py +++ b/skimage/morphology/tests/test_binary.py @@ -64,5 +64,30 @@ def test_out_argument(): testing.assert_(np.any(out != out_saved)) testing.assert_array_equal(out, func(img, strel)) +def test_default_selem(): + + functions = [binary.binary_erosion, binary.binary_dilation, + binary.binary_opening, binary.binary_closing] + + strel = selem.diamond(radius=1) + image = np.array([[0, 0, 0, 0, 0, 0, 0, 0, 0, 0], + [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], + [0, 0, 1, 1, 1, 1, 1, 1, 0, 0], + [0, 0, 1, 1, 1, 1, 1, 1, 0, 0], + [0, 0, 1, 1, 1, 1, 1, 1, 0, 0], + [0, 0, 1, 1, 1, 0, 0, 1, 0, 0], + [0, 0, 1, 1, 1, 0, 0, 1, 0, 0], + [0, 0, 1, 1, 1, 0, 0, 1, 0, 0], + [0, 0, 1, 1, 1, 1, 1, 1, 0, 0], + [0, 0, 1, 1, 1, 1, 1, 1, 0, 0], + [0, 0, 1, 1, 1, 1, 1, 1, 0, 0], + [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], + [0, 0, 0, 0, 0, 0, 0, 0, 0, 0]], np.uint8) + + for function in functions: + im_expected = function(image, strel) + im_test = function(image) + yield testing.assert_array_equal, im_expected, im_test + if __name__ == '__main__': testing.run_module_suite() diff --git a/skimage/morphology/tests/test_grey.py b/skimage/morphology/tests/test_grey.py index f0099ee5..d298b1eb 100644 --- a/skimage/morphology/tests/test_grey.py +++ b/skimage/morphology/tests/test_grey.py @@ -119,7 +119,33 @@ class TestEccentricStructuringElements(): tophat = grey.black_tophat(self.white_pixel, s) assert np.all(tophat == 0) +def test_default_selem(): + functions = [grey.erosion, grey.dilation, + grey.opening, grey.closing, + grey.white_tophat, grey.black_tophat] + + strel = selem.diamond(radius=1) + image = np.array([[0, 0, 0, 0, 0, 0, 0, 0, 0, 0], + [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], + [0, 0, 1, 1, 1, 1, 1, 1, 0, 0], + [0, 0, 1, 1, 1, 1, 1, 1, 0, 0], + [0, 0, 1, 1, 1, 1, 1, 1, 0, 0], + [0, 0, 1, 1, 1, 0, 0, 1, 0, 0], + [0, 0, 1, 1, 1, 0, 0, 1, 0, 0], + [0, 0, 1, 1, 1, 0, 0, 1, 0, 0], + [0, 0, 1, 1, 1, 1, 1, 1, 0, 0], + [0, 0, 1, 1, 1, 1, 1, 1, 0, 0], + [0, 0, 1, 1, 1, 1, 1, 1, 0, 0], + [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], + [0, 0, 0, 0, 0, 0, 0, 0, 0, 0]], np.uint8) + + for function in functions: + im_expected = function(image, strel) + im_test = function(image) + yield testing.assert_array_equal, im_expected, im_test + + class TestDTypes(): def setUp(self): From 54aff88bd019b0ed077fe2bf0b4b9bbdf545df1e Mon Sep 17 00:00:00 2001 From: Nelson Brown Date: Fri, 11 Jul 2014 14:10:18 -0700 Subject: [PATCH 2/6] Add docstring for default structuring element --- skimage/morphology/binary.py | 18 +++++++++++------- skimage/morphology/grey.py | 32 +++++++++++++++++++------------- 2 files changed, 30 insertions(+), 20 deletions(-) diff --git a/skimage/morphology/binary.py b/skimage/morphology/binary.py index 636717af..d5e0d92b 100644 --- a/skimage/morphology/binary.py +++ b/skimage/morphology/binary.py @@ -18,8 +18,9 @@ def binary_erosion(image, selem=None, out=None): ---------- image : ndarray Binary input image. - selem : ndarray + selem : ndarray, optional The neighborhood expressed as a 2-D array of 1's and 0's. + If None, use cross-shaped structuring element (connectivity=1). out : ndarray of bool The array to store the result of the morphology. If None is passed, a new array will be allocated. @@ -66,9 +67,10 @@ def binary_dilation(image, selem=None, out=None): image : ndarray Binary input image. - selem : ndarray + selem : ndarray, optional The neighborhood expressed as a 2-D array of 1's and 0's. - out : ndarray of bool + If None, use cross-shaped structuring element (connectivity=1). + out : ndarray of bool, optional The array to store the result of the morphology. If None, is passed, a new array will be allocated. @@ -113,9 +115,10 @@ def binary_opening(image, selem=None, out=None): ---------- image : ndarray Binary input image. - selem : ndarray + selem : ndarray, optional The neighborhood expressed as a 2-D array of 1's and 0's. - out : ndarray of bool + If None, use cross-shaped structuring element (connectivity=1). + out : ndarray of bool, optional The array to store the result of the morphology. If None is passed, a new array will be allocated. @@ -145,9 +148,10 @@ def binary_closing(image, selem=None, out=None): ---------- image : ndarray Binary input image. - selem : ndarray + selem : ndarray, optional The neighborhood expressed as a 2-D array of 1's and 0's. - out : ndarray of bool + If None, use cross-shaped structuring element (connectivity=1). + out : ndarray of bool, optional The array to store the result of the morphology. If None, is passed, a new array will be allocated. diff --git a/skimage/morphology/grey.py b/skimage/morphology/grey.py index 7fb1c8c9..e50e1460 100644 --- a/skimage/morphology/grey.py +++ b/skimage/morphology/grey.py @@ -22,12 +22,13 @@ def erosion(image, selem=None, out=None, shift_x=False, shift_y=False): ---------- image : ndarray Image array. - selem : ndarray + selem : ndarray, optional The neighborhood expressed as a 2-D array of 1's and 0's. - out : ndarrays + If None, use cross-shaped structuring element (connectivity=1). + out : ndarrays, optional The array to store the result of the morphology. If None is passed, a new array will be allocated. - shift_x, shift_y : bool + shift_x, shift_y : bool, optional shift structuring element about center point. This only affects eccentric structuring elements (i.e. selem with even numbered sides). @@ -79,12 +80,13 @@ def dilation(image, selem=None, out=None, shift_x=False, shift_y=False): image : ndarray Image array. - selem : ndarray + selem : ndarray, optional The neighborhood expressed as a 2-D array of 1's and 0's. - out : ndarray + If None, use cross-shaped structuring element (connectivity=1). + out : ndarray, optional The array to store the result of the morphology. If None, is passed, a new array will be allocated. - shift_x, shift_y : bool + shift_x, shift_y : bool, optional shift structuring element about center point. This only affects eccentric structuring elements (i.e. selem with even numbered sides). @@ -136,9 +138,10 @@ def opening(image, selem=None, out=None): ---------- image : ndarray Image array. - selem : ndarray + selem : ndarray, optional The neighborhood expressed as a 2-D array of 1's and 0's. - out : ndarray + If None, use cross-shaped structuring element (connectivity=1). + out : ndarray, optional The array to store the result of the morphology. If None is passed, a new array will be allocated. @@ -191,9 +194,10 @@ def closing(image, selem=None, out=None): ---------- image : ndarray Image array. - selem : ndarray + selem : ndarray, optional The neighborhood expressed as a 2-D array of 1's and 0's. - out : ndarray + If None, use cross-shaped structuring element (connectivity=1). + out : ndarray, optional The array to store the result of the morphology. If None, is passed, a new array will be allocated. @@ -245,9 +249,10 @@ def white_tophat(image, selem=None, out=None): ---------- image : ndarray Image array. - selem : ndarray + selem : ndarray, optional The neighborhood expressed as a 2-D array of 1's and 0's. - out : ndarray + If None, use cross-shaped structuring element (connectivity=1). + out : ndarray, optional The array to store the result of the morphology. If None is passed, a new array will be allocated. @@ -299,8 +304,9 @@ def black_tophat(image, selem=None, out=None): ---------- image : ndarray Image array. - selem : ndarray + selem : ndarray, optional The neighborhood expressed as a 2-D array of 1's and 0's. + If None, use cross-shaped structuring element (connectivity=1). out : ndarray The array to store the result of the morphology. If None is passed, a new array will be allocated. From 1ef556b7104d1c57a8a47309d878553966ad0f1a Mon Sep 17 00:00:00 2001 From: Nelson Brown Date: Fri, 11 Jul 2014 14:51:57 -0700 Subject: [PATCH 3/6] Remove unnecessary whitespace --- skimage/morphology/binary.py | 8 ++++---- skimage/morphology/grey.py | 16 ++++++++-------- skimage/morphology/selem.py | 2 +- skimage/morphology/tests/test_binary.py | 5 +---- skimage/morphology/tests/test_grey.py | 6 +----- 5 files changed, 15 insertions(+), 22 deletions(-) diff --git a/skimage/morphology/binary.py b/skimage/morphology/binary.py index d5e0d92b..5b019051 100644 --- a/skimage/morphology/binary.py +++ b/skimage/morphology/binary.py @@ -31,11 +31,11 @@ def binary_erosion(image, selem=None, out=None): The result of the morphological erosion with values in ``[0, 1]``. """ - + # Default structure element if selem is None: selem = _default_selem(image.ndim) - + selem = (selem != 0) selem_sum = np.sum(selem) @@ -80,11 +80,11 @@ def binary_dilation(image, selem=None, out=None): The result of the morphological dilation with values in ``[0, 1]``. """ - + # Default structure element if selem is None: selem = _default_selem(image.ndim) - + selem = (selem != 0) if np.sum(selem) <= 255: diff --git a/skimage/morphology/grey.py b/skimage/morphology/grey.py index e50e1460..2b4a01a8 100644 --- a/skimage/morphology/grey.py +++ b/skimage/morphology/grey.py @@ -59,7 +59,7 @@ def erosion(image, selem=None, out=None, shift_x=False, shift_y=False): # Default structure element if selem is None: selem = _default_selem(image.ndim) - + if image is out: raise NotImplementedError("In-place erosion not supported!") image = img_as_ubyte(image) @@ -117,7 +117,7 @@ def dilation(image, selem=None, out=None, shift_x=False, shift_y=False): # Default structure element if selem is None: selem = _default_selem(image.ndim) - + if image is out: raise NotImplementedError("In-place dilation not supported!") image = img_as_ubyte(image) @@ -168,11 +168,11 @@ def opening(image, selem=None, out=None): [0, 0, 0, 0, 0]], dtype=uint8) """ - + # Default structure element if selem is None: selem = _default_selem(image.ndim) - + h, w = selem.shape shift_x = True if (w % 2) == 0 else False shift_y = True if (h % 2) == 0 else False @@ -228,7 +228,7 @@ def closing(image, selem=None, out=None): # Default structure element if selem is None: selem = _default_selem(image.ndim) - + h, w = selem.shape shift_x = True if (w % 2) == 0 else False shift_y = True if (h % 2) == 0 else False @@ -279,11 +279,11 @@ def white_tophat(image, selem=None, out=None): [0, 0, 0, 0, 0]], dtype=uint8) """ - + # Default structure element if selem is None: selem = _default_selem(image.ndim) - + if image is out: raise NotImplementedError("Cannot perform white top hat in place.") @@ -338,7 +338,7 @@ def black_tophat(image, selem=None, out=None): # Default structure element if selem is None: selem = _default_selem(image.ndim) - + if image is out: raise NotImplementedError("Cannot perform white top hat in place.") diff --git a/skimage/morphology/selem.py b/skimage/morphology/selem.py index 24adfce6..4147d93b 100644 --- a/skimage/morphology/selem.py +++ b/skimage/morphology/selem.py @@ -292,7 +292,7 @@ def star(a, dtype=np.uint8): selem[selem > 0] = 1 return selem.astype(dtype) - + def _default_selem(ndim): """ Generates a cross-shaped structuring element (connectivity=1). This is the diff --git a/skimage/morphology/tests/test_binary.py b/skimage/morphology/tests/test_binary.py index e6d80321..6ac5e8d8 100644 --- a/skimage/morphology/tests/test_binary.py +++ b/skimage/morphology/tests/test_binary.py @@ -65,10 +65,8 @@ def test_out_argument(): testing.assert_array_equal(out, func(img, strel)) def test_default_selem(): - functions = [binary.binary_erosion, binary.binary_dilation, binary.binary_opening, binary.binary_closing] - strel = selem.diamond(radius=1) image = np.array([[0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], @@ -83,11 +81,10 @@ def test_default_selem(): [0, 0, 1, 1, 1, 1, 1, 1, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0]], np.uint8) - for function in functions: im_expected = function(image, strel) im_test = function(image) yield testing.assert_array_equal, im_expected, im_test - + if __name__ == '__main__': testing.run_module_suite() diff --git a/skimage/morphology/tests/test_grey.py b/skimage/morphology/tests/test_grey.py index d298b1eb..359a2832 100644 --- a/skimage/morphology/tests/test_grey.py +++ b/skimage/morphology/tests/test_grey.py @@ -120,11 +120,9 @@ class TestEccentricStructuringElements(): assert np.all(tophat == 0) def test_default_selem(): - functions = [grey.erosion, grey.dilation, grey.opening, grey.closing, grey.white_tophat, grey.black_tophat] - strel = selem.diamond(radius=1) image = np.array([[0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], @@ -139,13 +137,11 @@ def test_default_selem(): [0, 0, 1, 1, 1, 1, 1, 1, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0]], np.uint8) - for function in functions: im_expected = function(image, strel) im_test = function(image) yield testing.assert_array_equal, im_expected, im_test - - + class TestDTypes(): def setUp(self): From 9cd9a1372ae98a8787221e99b0339a1876e09255 Mon Sep 17 00:00:00 2001 From: Nelson Brown Date: Fri, 11 Jul 2014 15:19:33 -0700 Subject: [PATCH 4/6] Address reviewer comments Add newline at EOF of selem.py Add "optional" to grey.py and binary.py --- skimage/morphology/binary.py | 2 +- skimage/morphology/grey.py | 2 +- skimage/morphology/selem.py | 3 ++- 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/skimage/morphology/binary.py b/skimage/morphology/binary.py index 5b019051..4612a35d 100644 --- a/skimage/morphology/binary.py +++ b/skimage/morphology/binary.py @@ -21,7 +21,7 @@ def binary_erosion(image, selem=None, out=None): selem : ndarray, optional The neighborhood expressed as a 2-D array of 1's and 0's. If None, use cross-shaped structuring element (connectivity=1). - out : ndarray of bool + out : ndarray of bool, optional The array to store the result of the morphology. If None is passed, a new array will be allocated. diff --git a/skimage/morphology/grey.py b/skimage/morphology/grey.py index 2b4a01a8..565ec9a6 100644 --- a/skimage/morphology/grey.py +++ b/skimage/morphology/grey.py @@ -307,7 +307,7 @@ def black_tophat(image, selem=None, out=None): selem : ndarray, optional The neighborhood expressed as a 2-D array of 1's and 0's. If None, use cross-shaped structuring element (connectivity=1). - out : ndarray + out : ndarray, optional The array to store the result of the morphology. If None is passed, a new array will be allocated. diff --git a/skimage/morphology/selem.py b/skimage/morphology/selem.py index 4147d93b..36ce4fe9 100644 --- a/skimage/morphology/selem.py +++ b/skimage/morphology/selem.py @@ -310,4 +310,5 @@ def _default_selem(ndim): are 1 and 0 otherwise. """ - return ndimage.morphology.generate_binary_structure(ndim, 1) \ No newline at end of file + return ndimage.morphology.generate_binary_structure(ndim, 1) + \ No newline at end of file From c2bbca6113e78adf7e263aaa9156e109006124ef Mon Sep 17 00:00:00 2001 From: Nelson Brown Date: Fri, 11 Jul 2014 23:32:36 -0700 Subject: [PATCH 5/6] Add a newline at EOF --- skimage/morphology/selem.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/skimage/morphology/selem.py b/skimage/morphology/selem.py index 36ce4fe9..b7b65d72 100644 --- a/skimage/morphology/selem.py +++ b/skimage/morphology/selem.py @@ -311,4 +311,4 @@ def _default_selem(ndim): """ return ndimage.morphology.generate_binary_structure(ndim, 1) - \ No newline at end of file + From 3518e65ab456ebba870a22632cad201a2dba8484 Mon Sep 17 00:00:00 2001 From: Nelson Brown Date: Fri, 11 Jul 2014 23:39:07 -0700 Subject: [PATCH 6/6] Add newline at EOF of selem.py --- skimage/morphology/selem.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/skimage/morphology/selem.py b/skimage/morphology/selem.py index b7b65d72..1822c8b3 100644 --- a/skimage/morphology/selem.py +++ b/skimage/morphology/selem.py @@ -312,3 +312,9 @@ def _default_selem(ndim): """ return ndimage.morphology.generate_binary_structure(ndim, 1) + + + + + +