Skip to content

Commit f95a60e

Browse files
feat: enable multilabel spherical opening and closing
1 parent 599905f commit f95a60e

1 file changed

Lines changed: 2 additions & 5 deletions

File tree

fastmorph/__init__.py

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -277,8 +277,7 @@ def spherical_open(
277277
anisotropy:AnisotropyType = None,
278278
in_place:bool = False,
279279
) -> np.ndarray:
280-
"""Apply a spherical morphological open operation to a binary image."""
281-
assert np.issubdtype(labels.dtype, bool), "spherical_open is currently only supported for binary images."
280+
"""Apply a spherical morphological open operation."""
282281
args = [ radius, parallel, anisotropy, in_place ]
283282
return spherical_dilate(spherical_erode(labels, *args), *args)
284283

@@ -289,12 +288,10 @@ def spherical_close(
289288
anisotropy:AnisotropyType = None,
290289
in_place:bool = False,
291290
) -> np.ndarray:
292-
"""Apply a spherical morphological close operation to a binary image."""
293-
assert np.issubdtype(labels.dtype, bool), "spherical_close is currently only supported for binary images."
291+
"""Apply a spherical morphological close operation."""
294292
args = [ radius, parallel, anisotropy, in_place ]
295293
return spherical_erode(spherical_dilate(labels, *args), *args)
296294

297-
298295
class FillError(Exception):
299296
pass
300297

0 commit comments

Comments
 (0)