Commit cbbe0f415dcf8dfd93ece888cbbd77a0f9f6085c

Authored by Thiago Franco de Moraes
1 parent 534231d0
Exists in master

Skimage >= 0.19

invesalius/data/styles.py
@@ -30,7 +30,11 @@ import wx @@ -30,7 +30,11 @@ import wx
30 from scipy import ndimage 30 from scipy import ndimage
31 from imageio import imsave 31 from imageio import imsave
32 from scipy.ndimage import generate_binary_structure, watershed_ift 32 from scipy.ndimage import generate_binary_structure, watershed_ift
33 -from skimage.morphology import watershed 33 +try:
  34 + # Skimage >= 0.19
  35 + from skimage.segmentation import watershed
  36 +except ImportError:
  37 + from skimage.morphology import watershed
34 from invesalius.pubsub import pub as Publisher 38 from invesalius.pubsub import pub as Publisher
35 39
36 import invesalius.constants as const 40 import invesalius.constants as const
invesalius/data/watershed_process.py
1 import numpy as np 1 import numpy as np
2 from scipy import ndimage 2 from scipy import ndimage
3 from scipy.ndimage import watershed_ift, generate_binary_structure 3 from scipy.ndimage import watershed_ift, generate_binary_structure
4 -from skimage.morphology import watershed 4 +try:
  5 + from skimage.segmentation import watershed
  6 +except ImportError:
  7 + from skimage.morphology import watershed
5 8
6 def get_LUT_value(data, window, level): 9 def get_LUT_value(data, window, level):
7 shape = data.shape 10 shape = data.shape