From d6f91a4b0e491abd62cbc065e4a384b0b1449c31 Mon Sep 17 00:00:00 2001 From: tatiana Date: Mon, 22 Jun 2009 12:53:35 +0000 Subject: [PATCH] FIX: (Trying to resolve)Zero problem under Win and Linux --- invesalius/control.py | 9 +++++++++ invesalius/data/slice_.py | 1 - invesalius/data/viewer_slice.py | 2 +- invesalius/gui/default_tasks.py | 4 ++-- invesalius/gui/import_data_wizard.py | 12 ++++++------ invesalius/gui/task_importer.py | 14 +++++++++++++- 6 files changed, 31 insertions(+), 11 deletions(-) diff --git a/invesalius/control.py b/invesalius/control.py index 70782b4..cf208c3 100755 --- a/invesalius/control.py +++ b/invesalius/control.py @@ -20,6 +20,15 @@ class Controller(): def __bind_events(self): ps.Publisher().subscribe(self.ImportDirectory, 'Import directory') + ps.Publisher().subscribe(self.StartImportPanel, "Load data to import panel") + + def StartImportPanel(self, pubsub_evt): + path = pubsub_evt.data + # TODO: Load information + dict = {"Joao": {"Serie 1": (0, 1, 2, 3, 4, 5, 6, 7), + "Serie 2": (1, 2, 3, 4, 5, 6, 7, 8)} + } + ps.Publisher().sendMessage("Load import panel", dict) def ImportDirectory(self, pubsub_evt=None, dir_=None): """ diff --git a/invesalius/data/slice_.py b/invesalius/data/slice_.py index 1f630fe..768b19d 100644 --- a/invesalius/data/slice_.py +++ b/invesalius/data/slice_.py @@ -244,7 +244,6 @@ class Slice(object): # when this is not the first instance, user will have defined a name if name is not None: - print "new mask, we will check if it will be shown" future_mask.name = name if future_mask.is_shown: self.blend_filter.SetOpacity(1, future_mask.opacity) diff --git a/invesalius/data/viewer_slice.py b/invesalius/data/viewer_slice.py index d5e7a5d..48f9be3 100755 --- a/invesalius/data/viewer_slice.py +++ b/invesalius/data/viewer_slice.py @@ -211,7 +211,7 @@ class Viewer(wx.Panel): text_property = vtk.vtkTextProperty() text_property.SetFontSize(16) - text_property.SetFontFamilyToArial() + text_property.SetFontFamilyToTimes() text_property.BoldOn() text_property.SetColor(colour) diff --git a/invesalius/gui/default_tasks.py b/invesalius/gui/default_tasks.py index f0bb925..75a0c33 100755 --- a/invesalius/gui/default_tasks.py +++ b/invesalius/gui/default_tasks.py @@ -174,7 +174,7 @@ class UpperTaskPanel(wx.Panel): fold_panel.AddFoldPanelWindow(item, importer.TaskPanel(item), Spacing= 0, leftSpacing=0, rightSpacing=0) - #fold_panel.Expand(fold_panel.GetFoldPanel(0)) + fold_panel.Expand(fold_panel.GetFoldPanel(0)) # Fold 2 - Mask for segmentation and edition @@ -185,7 +185,7 @@ class UpperTaskPanel(wx.Panel): fold_panel.AddFoldPanelWindow(item, slice_.TaskPanel(item), Spacing= 0, leftSpacing=0, rightSpacing=0) - fold_panel.Expand(fold_panel.GetFoldPanel(1)) + #fold_panel.Expand(fold_panel.GetFoldPanel(1)) # Fold 3 # select mask - combo diff --git a/invesalius/gui/import_data_wizard.py b/invesalius/gui/import_data_wizard.py index cc57f38..1282a45 100644 --- a/invesalius/gui/import_data_wizard.py +++ b/invesalius/gui/import_data_wizard.py @@ -173,10 +173,10 @@ class DirPage(BasePage): t1 = wx.TextCtrl(self, -1, "", size=(125, -1)) - #dbb = filebrowse.DirBrowseButton( - # self, -1, size=(450, -1), changeCallback = self.dbbCallback) - #dbb.SetLabel("") - #line2 = dbb + dbb = filebrowse.DirBrowseButton( + self, -1, size=(450, -1), changeCallback = self.dbbCallback) + dbb.SetLabel("") + line2 = dbb #line2 = wx.BoxSizer(wx.HORIZONTAL) #line3 = wx.BoxSizer(wx.VERTICAL) @@ -198,8 +198,8 @@ class DirPage(BasePage): self.sizer.Add(line1, 0, wx.LEFT|wx.RIGHT|wx.TOP, 5) self.sizer.Add(line2, 0, wx.ALL, 5) - self.sizer.Add(line3, 0, wx.ALL, 5) - self.sizer.Add(link_add_another_dir, 0, wx.LEFT|wx.BOTTOM, 10) + #self.sizer.Add(line3, 0, wx.ALL, 5) + #self.sizer.Add(link_add_another_dir, 0, wx.LEFT|wx.BOTTOM, 10) fold_panel = fpb.FoldPanelBar(self, -1, wx.DefaultPosition, diff --git a/invesalius/gui/task_importer.py b/invesalius/gui/task_importer.py index 177bc42..e3b6f43 100644 --- a/invesalius/gui/task_importer.py +++ b/invesalius/gui/task_importer.py @@ -20,6 +20,7 @@ import os import wx import wx.lib.hyperlink as hl import wx.lib.platebtn as pbtn +import wx.lib.pubsub as ps BTN_IMPORT_LOCAL = wx.NewId() BTN_IMPORT_PACS = wx.NewId() @@ -136,7 +137,18 @@ class InnerTaskPanel(wx.Panel): def OnLinkImport(self, evt=None): - print "TODO: Send Signal - Import DICOM files" + dlg = wx.DirDialog(self, "Choose a directory:", "", + style=wx.DD_DEFAULT_STYLE + | wx.DD_DIR_MUST_EXIST + | wx.DD_CHANGE_DIR) + + if dlg.ShowModal() == wx.ID_OK: + path = dlg.GetPath() + ps.Publisher().sendMessage("Show import panel", path) + + # Only destroy a dialog after you're done with it. + dlg.Destroy() + if evt: evt.Skip() -- libgit2 0.21.2