From 99c95f8e4f7dfd4a9f3805d93f565bfa3ee60018 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Johannes=20Sch=C3=B6nberger?= Date: Sun, 5 Oct 2014 11:19:37 -0400 Subject: [PATCH 1/4] Refer to rank filters from morphology functions --- skimage/morphology/grey.py | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/skimage/morphology/grey.py b/skimage/morphology/grey.py index 19a4a346..4dfdbc3d 100644 --- a/skimage/morphology/grey.py +++ b/skimage/morphology/grey.py @@ -35,6 +35,11 @@ def erosion(image, selem=None, out=None, shift_x=False, shift_y=False): eroded : uint8 array The result of the morphological erosion. + Notes + ----- + The lower algorithm complexity makes the `skimage.filter.rank.minimum` + more efficient for larger images and structuring elements. + Examples -------- >>> # Erosion shrinks bright regions @@ -90,6 +95,11 @@ def dilation(image, selem=None, out=None, shift_x=False, shift_y=False): dilated : uint8 array The result of the morphological dilation. + Notes + ----- + The lower algorithm complexity makes the `skimage.filter.rank.maximum` + more efficient for larger images and structuring elements. + Examples -------- >>> # Dilation enlarges bright regions From fdeeaa298a3c647cade38c36280aa59201241df5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Johannes=20Sch=C3=B6nberger?= Date: Mon, 6 Oct 2014 08:29:04 -0400 Subject: [PATCH 2/4] Add note about supported data types in rank filter replacements --- skimage/morphology/grey.py | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/skimage/morphology/grey.py b/skimage/morphology/grey.py index 4dfdbc3d..1f1c45d4 100644 --- a/skimage/morphology/grey.py +++ b/skimage/morphology/grey.py @@ -37,8 +37,9 @@ def erosion(image, selem=None, out=None, shift_x=False, shift_y=False): Notes ----- - The lower algorithm complexity makes the `skimage.filter.rank.minimum` - more efficient for larger images and structuring elements. + For `uint8` and `uint16` data, the lower algorithm complexity makes the + `skimage.filter.rank.minimum` function more efficient for larger images + and structuring elements. Examples -------- @@ -97,8 +98,9 @@ def dilation(image, selem=None, out=None, shift_x=False, shift_y=False): Notes ----- - The lower algorithm complexity makes the `skimage.filter.rank.maximum` - more efficient for larger images and structuring elements. + For `uint8` and `uint16` data, the lower algorithm complexity makes the + `skimage.filter.rank.maximum` function more efficient for larger images + and structuring elements. Examples -------- From c73d1c98e015f060c9be3b93e985708afe46e8ed Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Johannes=20Sch=C3=B6nberger?= Date: Tue, 7 Oct 2014 08:38:26 -0400 Subject: [PATCH 3/4] Clarify that uint16 images are only faster up to a certain bit depth --- skimage/morphology/grey.py | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/skimage/morphology/grey.py b/skimage/morphology/grey.py index 1f1c45d4..6c901b4a 100644 --- a/skimage/morphology/grey.py +++ b/skimage/morphology/grey.py @@ -8,6 +8,7 @@ from . import cmorph __all__ = ['erosion', 'dilation', 'opening', 'closing', 'white_tophat', 'black_tophat'] + @default_fallback def erosion(image, selem=None, out=None, shift_x=False, shift_y=False): """Return greyscale morphological erosion of an image. @@ -37,9 +38,9 @@ def erosion(image, selem=None, out=None, shift_x=False, shift_y=False): Notes ----- - For `uint8` and `uint16` data, the lower algorithm complexity makes the - `skimage.filter.rank.minimum` function more efficient for larger images - and structuring elements. + For `uint8` (and `uint16` up to a certain bit-depth) data, the lower + algorithm complexity makes the `skimage.filter.rank.minimum` function more + efficient for larger images and structuring elements. Examples -------- @@ -98,9 +99,9 @@ def dilation(image, selem=None, out=None, shift_x=False, shift_y=False): Notes ----- - For `uint8` and `uint16` data, the lower algorithm complexity makes the - `skimage.filter.rank.maximum` function more efficient for larger images - and structuring elements. + For `uint8` (and `uint16` up to a certain bit-depth) data, the lower + algorithm complexity makes the `skimage.filter.rank.minimum` function more + efficient for larger images and structuring elements. Examples -------- From df1e2061a1b470379b198de1c3a5cb2a1be48417 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Johannes=20Sch=C3=B6nberger?= Date: Thu, 9 Oct 2014 16:32:50 -0400 Subject: [PATCH 4/4] Use correct rank filter replacement function --- skimage/morphology/grey.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/skimage/morphology/grey.py b/skimage/morphology/grey.py index 6c901b4a..cd3dcaa8 100644 --- a/skimage/morphology/grey.py +++ b/skimage/morphology/grey.py @@ -100,7 +100,7 @@ def dilation(image, selem=None, out=None, shift_x=False, shift_y=False): Notes ----- For `uint8` (and `uint16` up to a certain bit-depth) data, the lower - algorithm complexity makes the `skimage.filter.rank.minimum` function more + algorithm complexity makes the `skimage.filter.rank.maximum` function more efficient for larger images and structuring elements. Examples