Commit d5925187b1230b9ccac44c7ffce4ed7704b82652
1 parent
fc5829b6
Exists in
master
Showing a message if the system doesn't have theano or plaidml installed when us…
…er try to use brain segmenter tool
Showing
1 changed file
with
12 additions
and
3 deletions
Show diff stats
invesalius/gui/frame.py
| @@ -744,9 +744,18 @@ class Frame(wx.Frame): | @@ -744,9 +744,18 @@ class Frame(wx.Frame): | ||
| 744 | Publisher.sendMessage('Enable style', style=const.SLICE_STATE_FFILL_SEGMENTATION) | 744 | Publisher.sendMessage('Enable style', style=const.SLICE_STATE_FFILL_SEGMENTATION) |
| 745 | 745 | ||
| 746 | def OnBrainSegmentation(self): | 746 | def OnBrainSegmentation(self): |
| 747 | - from invesalius.gui.brain_seg_dialog import BrainSegmenterDialog | ||
| 748 | - dlg = BrainSegmenterDialog(self) | ||
| 749 | - dlg.Show() | 747 | + from invesalius.gui import brain_seg_dialog |
| 748 | + if brain_seg_dialog.HAS_PLAIDML or brain_seg_dialog.HAS_THEANO: | ||
| 749 | + dlg = brain_seg_dialog.BrainSegmenterDialog(self) | ||
| 750 | + dlg.Show() | ||
| 751 | + else: | ||
| 752 | + dlg = wx.MessageDialog(self, | ||
| 753 | + _("It's not possible to run brain segmenter because your system doesn't have the following modules installed:") \ | ||
| 754 | + + " PlaidML or Theano" , | ||
| 755 | + "InVesalius 3 - Brain segmenter", | ||
| 756 | + wx.ICON_INFORMATION | wx.OK) | ||
| 757 | + dlg.ShowModal() | ||
| 758 | + dlg.Destroy() | ||
| 750 | 759 | ||
| 751 | def OnInterpolatedSlices(self, status): | 760 | def OnInterpolatedSlices(self, status): |
| 752 | Publisher.sendMessage('Set interpolated slices', flag=status) | 761 | Publisher.sendMessage('Set interpolated slices', flag=status) |