diff --git a/invesalius/data/styles.py b/invesalius/data/styles.py index 89dbab4..fbf698c 100644 --- a/invesalius/data/styles.py +++ b/invesalius/data/styles.py @@ -30,7 +30,11 @@ import wx from scipy import ndimage from imageio import imsave from scipy.ndimage import generate_binary_structure, watershed_ift -from skimage.morphology import watershed +try: + # Skimage >= 0.19 + from skimage.segmentation import watershed +except ImportError: + from skimage.morphology import watershed from invesalius.pubsub import pub as Publisher import invesalius.constants as const diff --git a/invesalius/data/watershed_process.py b/invesalius/data/watershed_process.py index 6c370f1..3394733 100644 --- a/invesalius/data/watershed_process.py +++ b/invesalius/data/watershed_process.py @@ -1,7 +1,10 @@ import numpy as np from scipy import ndimage from scipy.ndimage import watershed_ift, generate_binary_structure -from skimage.morphology import watershed +try: + from skimage.segmentation import watershed +except ImportError: + from skimage.morphology import watershed def get_LUT_value(data, window, level): shape = data.shape -- libgit2 0.21.2