Commit cbbe0f415dcf8dfd93ece888cbbd77a0f9f6085c
1 parent
534231d0
Exists in
master
Skimage >= 0.19
Showing
2 changed files
with
9 additions
and
2 deletions
Show diff stats
invesalius/data/styles.py
| ... | ... | @@ -30,7 +30,11 @@ import wx |
| 30 | 30 | from scipy import ndimage |
| 31 | 31 | from imageio import imsave |
| 32 | 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 | 38 | from invesalius.pubsub import pub as Publisher |
| 35 | 39 | |
| 36 | 40 | import invesalius.constants as const | ... | ... |
invesalius/data/watershed_process.py
| 1 | 1 | import numpy as np |
| 2 | 2 | from scipy import ndimage |
| 3 | 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 | 9 | def get_LUT_value(data, window, level): |
| 7 | 10 | shape = data.shape | ... | ... |