Commit afcd4fdbd235e447605528ef50c835d7fc34c719

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

Merge remote-tracking branch 'origin/master'

app.py
... ... @@ -29,6 +29,13 @@ import traceback
29 29  
30 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 39 if sys.platform == 'win32':
33 40 try:
34 41 import winreg
... ...
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
... ...
invesalius/gui/frame.py
... ... @@ -790,13 +790,13 @@ class Frame(wx.Frame):
790 790  
791 791 def OnBrainSegmentation(self):
792 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 794 dlg = brain_seg_dialog.BrainSegmenterDialog(self)
795 795 dlg.Show()
796 796 else:
797 797 dlg = wx.MessageDialog(self,
798 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 800 "InVesalius 3 - Brain segmenter",
801 801 wx.ICON_INFORMATION | wx.OK)
802 802 dlg.ShowModal()
... ...