Skip to content

Commit

Permalink
fix private import to work across scikit-image versions
Browse files Browse the repository at this point in the history
  • Loading branch information
grlee77 committed Dec 16, 2024
1 parent c2d4b97 commit 24e2461
Showing 1 changed file with 9 additions and 6 deletions.
15 changes: 9 additions & 6 deletions python/cucim/src/cucim/skimage/morphology/_skeletonize.py
Original file line number Diff line number Diff line change
Expand Up @@ -253,12 +253,15 @@ def medial_axis(image, mask=None, return_distance=False, *, rng=None):
"""
try:
from skimage.morphology._skeletonize_cy import _skeletonize_loop
except ImportError as e:
warnings.warn(
"Could not find required private skimage Cython function:\n"
"\tskimage.morphology._skeletonize_cy._skeletonize_loop\n"
)
raise e
except ImportError:
try:
from skimage.morphology._skeletonize import _skeletonize_loop
except ImportError as e:
warnings.warn(
"Could not find required private skimage Cython function:\n"
"\tskimage.morphology._skeletonize_cy._skeletonize_loop\n"
)
raise e

if mask is None:
# masked_image is modified in-place later so make a copy of the input
Expand Down

0 comments on commit 24e2461

Please sign in to comment.