From d5925187b1230b9ccac44c7ffce4ed7704b82652 Mon Sep 17 00:00:00 2001 From: Thiago Franco de Moraes Date: Mon, 23 Mar 2020 12:33:56 -0300 Subject: [PATCH] Showing a message if the system doesn't have theano or plaidml installed when user try to use brain segmenter tool --- invesalius/gui/frame.py | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/invesalius/gui/frame.py b/invesalius/gui/frame.py index 337abfb..4aa8a92 100644 --- a/invesalius/gui/frame.py +++ b/invesalius/gui/frame.py @@ -744,9 +744,18 @@ class Frame(wx.Frame): Publisher.sendMessage('Enable style', style=const.SLICE_STATE_FFILL_SEGMENTATION) def OnBrainSegmentation(self): - from invesalius.gui.brain_seg_dialog import BrainSegmenterDialog - dlg = BrainSegmenterDialog(self) - dlg.Show() + from invesalius.gui import brain_seg_dialog + if brain_seg_dialog.HAS_PLAIDML or brain_seg_dialog.HAS_THEANO: + dlg = brain_seg_dialog.BrainSegmenterDialog(self) + dlg.Show() + else: + dlg = wx.MessageDialog(self, + _("It's not possible to run brain segmenter because your system doesn't have the following modules installed:") \ + + " PlaidML or Theano" , + "InVesalius 3 - Brain segmenter", + wx.ICON_INFORMATION | wx.OK) + dlg.ShowModal() + dlg.Destroy() def OnInterpolatedSlices(self, status): Publisher.sendMessage('Set interpolated slices', flag=status) -- libgit2 0.21.2