Commit 97f76e213c013358c04ce7bf01ecfcd212965757
1 parent
23bc2c04
Exists in
master
FIX: change marker colors
-minor: set size to trackers combobox
Showing
1 changed file
with
9 additions
and
10 deletions
Show diff stats
invesalius/gui/task_navigator.py
@@ -339,7 +339,7 @@ class NeuronavigationPanel(wx.Panel): | @@ -339,7 +339,7 @@ class NeuronavigationPanel(wx.Panel): | ||
339 | 339 | ||
340 | # ComboBox for spatial tracker device selection | 340 | # ComboBox for spatial tracker device selection |
341 | tracker_options = [_("Select tracker:")] + self.tracker.get_trackers() | 341 | tracker_options = [_("Select tracker:")] + self.tracker.get_trackers() |
342 | - select_tracker_elem = wx.ComboBox(self, -1, "", | 342 | + select_tracker_elem = wx.ComboBox(self, -1, "", size=(145, -1), |
343 | choices=tracker_options, style=wx.CB_DROPDOWN|wx.CB_READONLY) | 343 | choices=tracker_options, style=wx.CB_DROPDOWN|wx.CB_READONLY) |
344 | 344 | ||
345 | tooltip = wx.ToolTip(_("Choose the tracking device")) | 345 | tooltip = wx.ToolTip(_("Choose the tracking device")) |
@@ -1269,8 +1269,7 @@ class MarkersPanel(wx.Panel): | @@ -1269,8 +1269,7 @@ class MarkersPanel(wx.Panel): | ||
1269 | 1269 | ||
1270 | def OnMenuSetColor(self, evt): | 1270 | def OnMenuSetColor(self, evt): |
1271 | index = self.lc.GetFocusedItem() | 1271 | index = self.lc.GetFocusedItem() |
1272 | - | ||
1273 | - color_current = [self.list_coord[index][n] * 255 for n in range(6, 9)] | 1272 | + color_current = [self.list_coord[index][n] * 255 for n in range(12, 15)] |
1274 | 1273 | ||
1275 | color_new = dlg.ShowColorDialog(color_current=color_current) | 1274 | color_new = dlg.ShowColorDialog(color_current=color_current) |
1276 | 1275 | ||
@@ -1280,7 +1279,7 @@ class MarkersPanel(wx.Panel): | @@ -1280,7 +1279,7 @@ class MarkersPanel(wx.Panel): | ||
1280 | # XXX: Seems like a slightly too early point for rounding; better to round only when the value | 1279 | # XXX: Seems like a slightly too early point for rounding; better to round only when the value |
1281 | # is printed to the screen or file. | 1280 | # is printed to the screen or file. |
1282 | # | 1281 | # |
1283 | - self.list_coord[index][6:9] = [round(s/255.0, 3) for s in color_new] | 1282 | + self.list_coord[index][12:15] = [round(s/255.0, 3) for s in color_new] |
1284 | 1283 | ||
1285 | Publisher.sendMessage('Set new color', index=index, color=color_new) | 1284 | Publisher.sendMessage('Set new color', index=index, color=color_new) |
1286 | 1285 | ||
@@ -1383,20 +1382,20 @@ class MarkersPanel(wx.Panel): | @@ -1383,20 +1382,20 @@ class MarkersPanel(wx.Panel): | ||
1383 | coord = [float(s) for s in line[:6]] | 1382 | coord = [float(s) for s in line[:6]] |
1384 | colour = [float(s) for s in line[12:15]] | 1383 | colour = [float(s) for s in line[12:15]] |
1385 | size = float(line[15]) | 1384 | size = float(line[15]) |
1386 | - marker_id = line[16] | 1385 | + label = line[16] |
1387 | 1386 | ||
1388 | seed = [float(s) for s in line[17:20]] | 1387 | seed = [float(s) for s in line[17:20]] |
1389 | 1388 | ||
1390 | for i in const.BTNS_IMG_MARKERS: | 1389 | for i in const.BTNS_IMG_MARKERS: |
1391 | - if marker_id in list(const.BTNS_IMG_MARKERS[i].values())[0]: | ||
1392 | - Publisher.sendMessage('Load image fiducials', marker_id=marker_id, coord=coord) | ||
1393 | - elif marker_id == 'TARGET': | 1390 | + if label in list(const.BTNS_IMG_MARKERS[i].values())[0]: |
1391 | + Publisher.sendMessage('Load image fiducials', label=label, coord=coord) | ||
1392 | + elif label == 'TARGET': | ||
1394 | target = count_line | 1393 | target = count_line |
1395 | 1394 | ||
1396 | target_id = line[20] | 1395 | target_id = line[20] |
1397 | 1396 | ||
1398 | self.CreateMarker(coord=coord, colour=colour, size=size, | 1397 | self.CreateMarker(coord=coord, colour=colour, size=size, |
1399 | - label=marker_id, target_id=target_id, seed=seed) | 1398 | + label=label, target_id=target_id, seed=seed) |
1400 | 1399 | ||
1401 | # if there are multiple TARGETS will set the last one | 1400 | # if there are multiple TARGETS will set the last one |
1402 | if target: | 1401 | if target: |
@@ -1444,7 +1443,7 @@ class MarkersPanel(wx.Panel): | @@ -1444,7 +1443,7 @@ class MarkersPanel(wx.Panel): | ||
1444 | writer.writerows(self.list_coord) | 1443 | writer.writerows(self.list_coord) |
1445 | 1444 | ||
1446 | def OnSelectColour(self, evt, ctrl): | 1445 | def OnSelectColour(self, evt, ctrl): |
1447 | - self.marker_colour = [colour/255.0 for colour in ctrl.GetValue()] | 1446 | + self.marker_colour = [colour/255.0 for colour in ctrl.GetValue()[:3]] |
1448 | 1447 | ||
1449 | def OnSelectSize(self, evt, ctrl): | 1448 | def OnSelectSize(self, evt, ctrl): |
1450 | self.marker_size = ctrl.GetValue() | 1449 | self.marker_size = ctrl.GetValue() |