From efc4e7bf6baa554cc638aff2290087025d8fdf24 Mon Sep 17 00:00:00 2001 From: paulojamorim Date: Tue, 17 Aug 2010 13:59:56 +0000 Subject: [PATCH] ADD: Reader Analyze File from Interface --- invesalius/constants.py | 2 +- invesalius/control.py | 12 ++++++++++++ 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/invesalius/constants.py b/invesalius/constants.py index 88eb454..a613600 100644 --- a/invesalius/constants.py +++ b/invesalius/constants.py @@ -430,7 +430,7 @@ VTK_WARNING = 0 [ID_DICOM_IMPORT, ID_PROJECT_OPEN, ID_PROJECT_SAVE_AS, ID_PROJECT_SAVE, ID_PROJECT_CLOSE, ID_PROJECT_INFO, ID_SAVE_SCREENSHOT, ID_DICOM_LOAD_NET, -ID_PRINT_SCREENSHOT, ID_EXIT] = [wx.NewId() for number in range(10)] +ID_PRINT_SCREENSHOT, ID_EXIT, ID_IMPORT_OTHERS_FILES, ID_ANALYZE_IMPORT] = [wx.NewId() for number in range(12)] [ID_EDIT_UNDO, ID_EDIT_REDO, ID_EDIT_LIST] =\ diff --git a/invesalius/control.py b/invesalius/control.py index a9614ee..a07219f 100755 --- a/invesalius/control.py +++ b/invesalius/control.py @@ -75,6 +75,8 @@ class Controller(): ps.Publisher().subscribe(self.OnShowDialogCloseProject, 'Close Project') ps.Publisher().subscribe(self.OnOpenProject, 'Open project') ps.Publisher().subscribe(self.OnOpenRecentProject, 'Open recent project') + ps.Publisher().subscribe(self.OnShowAnalyzeFile, 'Show analyze dialog') + def OnCancelImport(self, pubsub_evt): #self.cancel_import = True @@ -97,6 +99,16 @@ class Controller(): def OnShowDialogCloseProject(self, pubsub_evt): self.ShowDialogCloseProject() + def OnShowAnalyzeFile(self, pubsub_evt): + dirpath = dialog.ShowOpenAnalyzeDialog() + imagedata = analyze.ReadAnalyze(dirpath) + if imagedata: + self.CreateAnalyzeProject(imagedata) + + self.LoadProject() + ps.Publisher().sendMessage("Enable state project", True) + + ########################### def ShowDialogImportDirectory(self): -- libgit2 0.21.2