From 349576735882e1774fbbef9d9a8f97af8213d97f Mon Sep 17 00:00:00 2001 From: Stefan van der Walt Date: Wed, 2 Nov 2011 09:38:54 -0700 Subject: [PATCH] ENH: Rename convex_hull to convex_hull_image to allow later clean API addition of convex_hull with labels. --- skimage/morphology/__init__.py | 2 +- skimage/morphology/convex_hull.py | 6 +++--- skimage/morphology/tests/test_convex_hull.py | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/skimage/morphology/__init__.py b/skimage/morphology/__init__.py index 5a7d67d7..e3176579 100644 --- a/skimage/morphology/__init__.py +++ b/skimage/morphology/__init__.py @@ -3,4 +3,4 @@ from selem import * from .ccomp import label from watershed import watershed, is_local_maximum from skeletonize import skeletonize, medial_axis -from .convex_hull import convex_hull +from .convex_hull import convex_hull_image diff --git a/skimage/morphology/convex_hull.py b/skimage/morphology/convex_hull.py index 487a547b..f461dc4d 100644 --- a/skimage/morphology/convex_hull.py +++ b/skimage/morphology/convex_hull.py @@ -1,11 +1,11 @@ -__all__ = ['convex_hull'] +__all__ = ['convex_hull_image'] import numpy as np from ._pnpoly import points_inside_poly, grid_points_inside_poly from ._convex_hull import possible_hull -def convex_hull(image): - """Compute the convex hull of a binary image. +def convex_hull_image(image): + """Compute the convex hull image of a binary image. The convex hull is the set of pixels included in the smallest convex polygon that surround all white pixels in the input image. diff --git a/skimage/morphology/tests/test_convex_hull.py b/skimage/morphology/tests/test_convex_hull.py index e8fb5514..21f45cd7 100644 --- a/skimage/morphology/tests/test_convex_hull.py +++ b/skimage/morphology/tests/test_convex_hull.py @@ -1,7 +1,7 @@ import numpy as np from numpy.testing import assert_array_equal from numpy.testing.decorators import skipif -from skimage.morphology import convex_hull +from skimage.morphology import convex_hull_image from skimage.morphology._convex_hull import possible_hull try: @@ -28,7 +28,7 @@ def test_basic(): [0, 1, 1, 1, 1, 1, 1, 1, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0]], dtype=bool) - assert_array_equal(convex_hull(image), expected) + assert_array_equal(convex_hull_image(image), expected) @skipif(not scipy_spatial) def test_possible_hull():