Commit d6f91a4b0e491abd62cbc065e4a384b0b1449c31

Authored by tatiana
1 parent c4e8bbe6

FIX: (Trying to resolve)Zero problem under Win and Linux

invesalius/control.py
... ... @@ -20,6 +20,15 @@ class Controller():
20 20  
21 21 def __bind_events(self):
22 22 ps.Publisher().subscribe(self.ImportDirectory, 'Import directory')
  23 + ps.Publisher().subscribe(self.StartImportPanel, "Load data to import panel")
  24 +
  25 + def StartImportPanel(self, pubsub_evt):
  26 + path = pubsub_evt.data
  27 + # TODO: Load information
  28 + dict = {"Joao": {"Serie 1": (0, 1, 2, 3, 4, 5, 6, 7),
  29 + "Serie 2": (1, 2, 3, 4, 5, 6, 7, 8)}
  30 + }
  31 + ps.Publisher().sendMessage("Load import panel", dict)
23 32  
24 33 def ImportDirectory(self, pubsub_evt=None, dir_=None):
25 34 """
... ...
invesalius/data/slice_.py
... ... @@ -244,7 +244,6 @@ class Slice(object):
244 244  
245 245 # when this is not the first instance, user will have defined a name
246 246 if name is not None:
247   - print "new mask, we will check if it will be shown"
248 247 future_mask.name = name
249 248 if future_mask.is_shown:
250 249 self.blend_filter.SetOpacity(1, future_mask.opacity)
... ...
invesalius/data/viewer_slice.py
... ... @@ -211,7 +211,7 @@ class Viewer(wx.Panel):
211 211  
212 212 text_property = vtk.vtkTextProperty()
213 213 text_property.SetFontSize(16)
214   - text_property.SetFontFamilyToArial()
  214 + text_property.SetFontFamilyToTimes()
215 215 text_property.BoldOn()
216 216 text_property.SetColor(colour)
217 217  
... ...
invesalius/gui/default_tasks.py
... ... @@ -174,7 +174,7 @@ class UpperTaskPanel(wx.Panel):
174 174  
175 175 fold_panel.AddFoldPanelWindow(item, importer.TaskPanel(item), Spacing= 0,
176 176 leftSpacing=0, rightSpacing=0)
177   - #fold_panel.Expand(fold_panel.GetFoldPanel(0))
  177 + fold_panel.Expand(fold_panel.GetFoldPanel(0))
178 178  
179 179 # Fold 2 - Mask for segmentation and edition
180 180  
... ... @@ -185,7 +185,7 @@ class UpperTaskPanel(wx.Panel):
185 185  
186 186 fold_panel.AddFoldPanelWindow(item, slice_.TaskPanel(item), Spacing= 0,
187 187 leftSpacing=0, rightSpacing=0)
188   - fold_panel.Expand(fold_panel.GetFoldPanel(1))
  188 + #fold_panel.Expand(fold_panel.GetFoldPanel(1))
189 189  
190 190 # Fold 3
191 191 # select mask - combo
... ...
invesalius/gui/import_data_wizard.py
... ... @@ -173,10 +173,10 @@ class DirPage(BasePage):
173 173  
174 174 t1 = wx.TextCtrl(self, -1, "", size=(125, -1))
175 175  
176   - #dbb = filebrowse.DirBrowseButton(
177   - # self, -1, size=(450, -1), changeCallback = self.dbbCallback)
178   - #dbb.SetLabel("")
179   - #line2 = dbb
  176 + dbb = filebrowse.DirBrowseButton(
  177 + self, -1, size=(450, -1), changeCallback = self.dbbCallback)
  178 + dbb.SetLabel("")
  179 + line2 = dbb
180 180 #line2 = wx.BoxSizer(wx.HORIZONTAL)
181 181  
182 182 #line3 = wx.BoxSizer(wx.VERTICAL)
... ... @@ -198,8 +198,8 @@ class DirPage(BasePage):
198 198  
199 199 self.sizer.Add(line1, 0, wx.LEFT|wx.RIGHT|wx.TOP, 5)
200 200 self.sizer.Add(line2, 0, wx.ALL, 5)
201   - self.sizer.Add(line3, 0, wx.ALL, 5)
202   - self.sizer.Add(link_add_another_dir, 0, wx.LEFT|wx.BOTTOM, 10)
  201 + #self.sizer.Add(line3, 0, wx.ALL, 5)
  202 + #self.sizer.Add(link_add_another_dir, 0, wx.LEFT|wx.BOTTOM, 10)
203 203  
204 204  
205 205 fold_panel = fpb.FoldPanelBar(self, -1, wx.DefaultPosition,
... ...
invesalius/gui/task_importer.py
... ... @@ -20,6 +20,7 @@ import os
20 20 import wx
21 21 import wx.lib.hyperlink as hl
22 22 import wx.lib.platebtn as pbtn
  23 +import wx.lib.pubsub as ps
23 24  
24 25 BTN_IMPORT_LOCAL = wx.NewId()
25 26 BTN_IMPORT_PACS = wx.NewId()
... ... @@ -136,7 +137,18 @@ class InnerTaskPanel(wx.Panel):
136 137  
137 138  
138 139 def OnLinkImport(self, evt=None):
139   - print "TODO: Send Signal - Import DICOM files"
  140 + dlg = wx.DirDialog(self, "Choose a directory:", "",
  141 + style=wx.DD_DEFAULT_STYLE
  142 + | wx.DD_DIR_MUST_EXIST
  143 + | wx.DD_CHANGE_DIR)
  144 +
  145 + if dlg.ShowModal() == wx.ID_OK:
  146 + path = dlg.GetPath()
  147 + ps.Publisher().sendMessage("Show import panel", path)
  148 +
  149 + # Only destroy a dialog after you're done with it.
  150 + dlg.Destroy()
  151 +
140 152 if evt:
141 153 evt.Skip()
142 154  
... ...