Commit 8d05dc3ea00c3c2c5da59bc149569313617fe10d
1 parent
919c76d7
Exists in
master
and in
6 other branches
ENH: GUI of import panel
Showing
2 changed files
with
24 additions
and
4 deletions
Show diff stats
invesalius/constants.py
| @@ -65,6 +65,9 @@ ORIENTATION_COLOUR = {'AXIAL': (1,0,0), # Red | @@ -65,6 +65,9 @@ ORIENTATION_COLOUR = {'AXIAL': (1,0,0), # Red | ||
| 65 | 'CORONAL': (0,1,0), # Green | 65 | 'CORONAL': (0,1,0), # Green |
| 66 | 'SAGITAL': (0,0,1)} # Blue | 66 | 'SAGITAL': (0,0,1)} # Blue |
| 67 | 67 | ||
| 68 | +IMPORT_INTERVAL = [_("Keep all slices"), _("Skip 1 for each 2 slices"), | ||
| 69 | + _("Skip 1 for each 3 slices")] | ||
| 70 | + | ||
| 68 | # Camera according to slice's orientation | 71 | # Camera according to slice's orientation |
| 69 | #CAM_POSITION = {"AXIAL":(0, 0, 1), "CORONAL":(0, -1, 0), "SAGITAL":(1, 0, 0)} | 72 | #CAM_POSITION = {"AXIAL":(0, 0, 1), "CORONAL":(0, -1, 0), "SAGITAL":(1, 0, 0)} |
| 70 | #CAM_VIEW_UP = {"AXIAL":(0, 1, 0), "CORONAL":(0, 0, 1), "SAGITAL":(0, 0, 1)} | 73 | #CAM_VIEW_UP = {"AXIAL":(0, 1, 0), "CORONAL":(0, 0, 1), "SAGITAL":(0, 0, 1)} |
invesalius/gui/import_panel.py
| @@ -21,6 +21,7 @@ import wx.gizmos as gizmos | @@ -21,6 +21,7 @@ import wx.gizmos as gizmos | ||
| 21 | import wx.lib.pubsub as ps | 21 | import wx.lib.pubsub as ps |
| 22 | import wx.lib.splitter as spl | 22 | import wx.lib.splitter as spl |
| 23 | 23 | ||
| 24 | +import constants as const | ||
| 24 | import dicom_preview_panel as dpp | 25 | import dicom_preview_panel as dpp |
| 25 | import reader.dicom_grouper as dcm | 26 | import reader.dicom_grouper as dcm |
| 26 | 27 | ||
| @@ -79,15 +80,31 @@ class InnerPanel(wx.Panel): | @@ -79,15 +80,31 @@ class InnerPanel(wx.Panel): | ||
| 79 | self.splitter = splitter | 80 | self.splitter = splitter |
| 80 | 81 | ||
| 81 | panel = wx.Panel(self) | 82 | panel = wx.Panel(self) |
| 82 | - button = wx.Button(panel, -1, _("Import medical images"), (20, 20)) | 83 | + #button = wx.Button(panel, -1, _("Import medical images"), (20, 20)) |
| 83 | 84 | ||
| 84 | - inner_sizer = wx.BoxSizer() | ||
| 85 | - inner_sizer.Add(button, 0, wx.ALIGN_CENTER_HORIZONTAL, 40) | 85 | + |
| 86 | + btn_ok = wx.Button(panel, wx.ID_OK) | ||
| 87 | + btn_ok.SetDefault() | ||
| 88 | + btn_cancel = wx.Button(panel, wx.ID_CANCEL) | ||
| 89 | + | ||
| 90 | + btnsizer = wx.StdDialogButtonSizer() | ||
| 91 | + btnsizer.AddButton(btn_ok) | ||
| 92 | + btnsizer.AddButton(btn_cancel) | ||
| 93 | + btnsizer.Realize() | ||
| 94 | + | ||
| 95 | + combo_interval = wx.ComboBox(panel, -1, "", choices= const.IMPORT_INTERVAL, | ||
| 96 | + style=wx.CB_DROPDOWN|wx.CB_READONLY) | ||
| 97 | + combo_interval.SetSelection(0) | ||
| 98 | + | ||
| 99 | + inner_sizer = wx.BoxSizer(wx.HORIZONTAL) | ||
| 100 | + inner_sizer.AddSizer(btnsizer, 0, wx.LEFT|wx.TOP, 5) | ||
| 101 | + inner_sizer.Add(combo_interval, 0, wx.LEFT|wx.RIGHT|wx.TOP, 8) | ||
| 86 | panel.SetSizer(inner_sizer) | 102 | panel.SetSizer(inner_sizer) |
| 103 | + inner_sizer.Fit(panel) | ||
| 87 | 104 | ||
| 88 | sizer = wx.BoxSizer(wx.VERTICAL) | 105 | sizer = wx.BoxSizer(wx.VERTICAL) |
| 89 | sizer.Add(splitter, 20, wx.EXPAND) | 106 | sizer.Add(splitter, 20, wx.EXPAND) |
| 90 | - sizer.Add(panel, 1, wx.EXPAND) | 107 | + sizer.Add(panel, 1, wx.EXPAND|wx.LEFT, 90) |
| 91 | 108 | ||
| 92 | self.SetSizer(sizer) | 109 | self.SetSizer(sizer) |
| 93 | sizer.Fit(self) | 110 | sizer.Fit(self) |