Commit efc4e7bf6baa554cc638aff2290087025d8fdf24
1 parent
299a0043
Exists in
master
and in
68 other branches
ADD: Reader Analyze File from Interface
Showing
2 changed files
with
13 additions
and
1 deletions
Show diff stats
invesalius/constants.py
| ... | ... | @@ -430,7 +430,7 @@ VTK_WARNING = 0 |
| 430 | 430 | |
| 431 | 431 | [ID_DICOM_IMPORT, ID_PROJECT_OPEN, ID_PROJECT_SAVE_AS, ID_PROJECT_SAVE, |
| 432 | 432 | ID_PROJECT_CLOSE, ID_PROJECT_INFO, ID_SAVE_SCREENSHOT, ID_DICOM_LOAD_NET, |
| 433 | -ID_PRINT_SCREENSHOT, ID_EXIT] = [wx.NewId() for number in range(10)] | |
| 433 | +ID_PRINT_SCREENSHOT, ID_EXIT, ID_IMPORT_OTHERS_FILES, ID_ANALYZE_IMPORT] = [wx.NewId() for number in range(12)] | |
| 434 | 434 | |
| 435 | 435 | |
| 436 | 436 | [ID_EDIT_UNDO, ID_EDIT_REDO, ID_EDIT_LIST] =\ | ... | ... |
invesalius/control.py
| ... | ... | @@ -75,6 +75,8 @@ class Controller(): |
| 75 | 75 | ps.Publisher().subscribe(self.OnShowDialogCloseProject, 'Close Project') |
| 76 | 76 | ps.Publisher().subscribe(self.OnOpenProject, 'Open project') |
| 77 | 77 | ps.Publisher().subscribe(self.OnOpenRecentProject, 'Open recent project') |
| 78 | + ps.Publisher().subscribe(self.OnShowAnalyzeFile, 'Show analyze dialog') | |
| 79 | + | |
| 78 | 80 | |
| 79 | 81 | def OnCancelImport(self, pubsub_evt): |
| 80 | 82 | #self.cancel_import = True |
| ... | ... | @@ -97,6 +99,16 @@ class Controller(): |
| 97 | 99 | def OnShowDialogCloseProject(self, pubsub_evt): |
| 98 | 100 | self.ShowDialogCloseProject() |
| 99 | 101 | |
| 102 | + def OnShowAnalyzeFile(self, pubsub_evt): | |
| 103 | + dirpath = dialog.ShowOpenAnalyzeDialog() | |
| 104 | + imagedata = analyze.ReadAnalyze(dirpath) | |
| 105 | + if imagedata: | |
| 106 | + self.CreateAnalyzeProject(imagedata) | |
| 107 | + | |
| 108 | + self.LoadProject() | |
| 109 | + ps.Publisher().sendMessage("Enable state project", True) | |
| 110 | + | |
| 111 | + | |
| 100 | 112 | ########################### |
| 101 | 113 | |
| 102 | 114 | def ShowDialogImportDirectory(self): | ... | ... |