Commit 6b02c8b8ad100d7cff156f6a9062cc082dc527c7
1 parent
00a27689
Exists in
master
and in
68 other branches
ENH: Raycasting menu with radio hability.
Showing
3 changed files
with
7 additions
and
3 deletions
Show diff stats
invesalius/constants.py
@@ -153,3 +153,5 @@ RAYCASTING_TYPES = [filename.split(".")[0] for filename in | @@ -153,3 +153,5 @@ RAYCASTING_TYPES = [filename.split(".")[0] for filename in | ||
153 | os.listdir(folder) if | 153 | os.listdir(folder) if |
154 | os.path.isfile(os.path.join(folder,filename))] | 154 | os.path.isfile(os.path.join(folder,filename))] |
155 | RAYCASTING_TYPES.sort() | 155 | RAYCASTING_TYPES.sort() |
156 | +RAYCASTING_LABEL = "Skin On Blue" | ||
157 | + |
invesalius/data/volume.py
@@ -23,7 +23,7 @@ import vtk | @@ -23,7 +23,7 @@ import vtk | ||
23 | import wx | 23 | import wx |
24 | import wx.lib.pubsub as ps | 24 | import wx.lib.pubsub as ps |
25 | 25 | ||
26 | -import constants | 26 | +import constants as const |
27 | from project import Project | 27 | from project import Project |
28 | 28 | ||
29 | Kernels = { | 29 | Kernels = { |
@@ -96,7 +96,7 @@ class Volume(): | @@ -96,7 +96,7 @@ class Volume(): | ||
96 | def LoadConfig(self, label): | 96 | def LoadConfig(self, label): |
97 | print label | 97 | print label |
98 | if not label: | 98 | if not label: |
99 | - label = "Skin On Blue" | 99 | + label = const.RAYCASTING_LABEL |
100 | 100 | ||
101 | path = os.path.join("..", "presets", "raycasting", | 101 | path = os.path.join("..", "presets", "raycasting", |
102 | label+".plist") | 102 | label+".plist") |
invesalius/gui/default_viewers.py
@@ -210,8 +210,10 @@ class VolumeToolPanel(wx.Panel): | @@ -210,8 +210,10 @@ class VolumeToolPanel(wx.Panel): | ||
210 | menu = wx.Menu() | 210 | menu = wx.Menu() |
211 | for name in const.RAYCASTING_TYPES: | 211 | for name in const.RAYCASTING_TYPES: |
212 | id = wx.NewId() | 212 | id = wx.NewId() |
213 | - item = wx.MenuItem(menu, id, name) | 213 | + item = wx.MenuItem(menu, id, name, kind=wx.ITEM_RADIO) |
214 | menu.AppendItem(item) | 214 | menu.AppendItem(item) |
215 | + if name == const.RAYCASTING_LABEL: | ||
216 | + item.Check(1) | ||
215 | ID_TO_NAME[id] = name | 217 | ID_TO_NAME[id] = name |
216 | self.menu_raycasting = menu | 218 | self.menu_raycasting = menu |
217 | menu.Bind(wx.EVT_MENU, self.OnMenuRaycasting) | 219 | menu.Bind(wx.EVT_MENU, self.OnMenuRaycasting) |