From b1693442806f8291c93638e9857b980255db51a3 Mon Sep 17 00:00:00 2001 From: Anihilatorgunn Date: Sun, 17 Nov 2024 14:04:05 +0300 Subject: [PATCH] fix import for old scipy --- imops/morphology.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/imops/morphology.py b/imops/morphology.py index 88a067a..abd3f49 100644 --- a/imops/morphology.py +++ b/imops/morphology.py @@ -6,6 +6,13 @@ from scipy.ndimage import distance_transform_edt as scipy_distance_transform_edt, generate_binary_structure from scipy.ndimage._nd_image import euclidean_feature_transform from scipy.spatial import ConvexHull, QhullError + + +try: + from scipy.spatial import QhullError +except ImportError: + from scipy.spatial.qhull import QhullError # Old scipy has another structure + from skimage.morphology import ( binary_closing as scipy_binary_closing, binary_dilation as scipy_binary_dilation,