Commit afcd4fdbd235e447605528ef50c835d7fc34c719

Authored by Thiago Franco de Moraes
2 parents 474ae848 9aba833e
Exists in master

Merge remote-tracking branch 'origin/master'

@@ -29,6 +29,13 @@ import traceback @@ -29,6 +29,13 @@ import traceback
29 29
30 import re 30 import re
31 31
  32 +if sys.platform == "darwin":
  33 + try:
  34 + import certifi
  35 + os.environ["SSL_CERT_FILE"] = certifi.where()
  36 + except ImportError:
  37 + pass
  38 +
32 if sys.platform == 'win32': 39 if sys.platform == 'win32':
33 try: 40 try:
34 import winreg 41 import winreg
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
invesalius/gui/frame.py
@@ -790,13 +790,13 @@ class Frame(wx.Frame): @@ -790,13 +790,13 @@ class Frame(wx.Frame):
790 790
791 def OnBrainSegmentation(self): 791 def OnBrainSegmentation(self):
792 from invesalius.gui import brain_seg_dialog 792 from invesalius.gui import brain_seg_dialog
793 - if brain_seg_dialog.HAS_PLAIDML or brain_seg_dialog.HAS_THEANO: 793 + if brain_seg_dialog.HAS_PLAIDML or brain_seg_dialog.HAS_THEANO or brain_seg_dialog.HAS_TORCH:
794 dlg = brain_seg_dialog.BrainSegmenterDialog(self) 794 dlg = brain_seg_dialog.BrainSegmenterDialog(self)
795 dlg.Show() 795 dlg.Show()
796 else: 796 else:
797 dlg = wx.MessageDialog(self, 797 dlg = wx.MessageDialog(self,
798 _("It's not possible to run brain segmenter because your system doesn't have the following modules installed:") \ 798 _("It's not possible to run brain segmenter because your system doesn't have the following modules installed:") \
799 - + " PlaidML or Theano" , 799 + + " Torch, PlaidML or Theano" ,
800 "InVesalius 3 - Brain segmenter", 800 "InVesalius 3 - Brain segmenter",
801 wx.ICON_INFORMATION | wx.OK) 801 wx.ICON_INFORMATION | wx.OK)
802 dlg.ShowModal() 802 dlg.ShowModal()