Commit 574c9620e678e522d3a8635d628f118e32808b34

Authored by Victor Hugo Souza
Committed by GitHub
2 parents 23bc2c04 ca212a82
Exists in master

Merge pull request #366 from rmatsuda/minor_FIX_markers_colors

FIX: change marker colors
invesalius/data/viewer_volume.py
... ... @@ -707,7 +707,7 @@ class Viewer(wx.Panel):
707 707 self.index = False
708 708  
709 709 def SetNewColor(self, index, color):
710   - self.staticballs[index].GetProperty().SetColor(color)
  710 + self.staticballs[index].GetProperty().SetColor([round(s/255.0, 3) for s in color])
711 711 self.Refresh()
712 712  
713 713 def OnTargetMarkerTransparency(self, status, index):
... ...
invesalius/gui/task_navigator.py
... ... @@ -339,7 +339,7 @@ class NeuronavigationPanel(wx.Panel):
339 339  
340 340 # ComboBox for spatial tracker device selection
341 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 343 choices=tracker_options, style=wx.CB_DROPDOWN|wx.CB_READONLY)
344 344  
345 345 tooltip = wx.ToolTip(_("Choose the tracking device"))
... ... @@ -1269,8 +1269,7 @@ class MarkersPanel(wx.Panel):
1269 1269  
1270 1270 def OnMenuSetColor(self, evt):
1271 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 1274 color_new = dlg.ShowColorDialog(color_current=color_current)
1276 1275  
... ... @@ -1280,7 +1279,7 @@ class MarkersPanel(wx.Panel):
1280 1279 # XXX: Seems like a slightly too early point for rounding; better to round only when the value
1281 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 1284 Publisher.sendMessage('Set new color', index=index, color=color_new)
1286 1285  
... ... @@ -1383,20 +1382,20 @@ class MarkersPanel(wx.Panel):
1383 1382 coord = [float(s) for s in line[:6]]
1384 1383 colour = [float(s) for s in line[12:15]]
1385 1384 size = float(line[15])
1386   - marker_id = line[16]
  1385 + label = line[16]
1387 1386  
1388 1387 seed = [float(s) for s in line[17:20]]
1389 1388  
1390 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 1393 target = count_line
1395 1394  
1396 1395 target_id = line[20]
1397 1396  
1398 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 1400 # if there are multiple TARGETS will set the last one
1402 1401 if target:
... ... @@ -1444,7 +1443,7 @@ class MarkersPanel(wx.Panel):
1444 1443 writer.writerows(self.list_coord)
1445 1444  
1446 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 1448 def OnSelectSize(self, evt, ctrl):
1450 1449 self.marker_size = ctrl.GetValue()
... ...