Commit 4ed4823be62e297455a46338e288fc6bc7be5287
1 parent
55d959f7
Exists in
master
Some key shortcuts was not working when the focus is in the viewer slice
and reducing the warning and debug messages from gdcm
Showing
2 changed files
with
9 additions
and
1 deletions
Show diff stats
invesalius/data/viewer_slice.py
@@ -1312,7 +1312,7 @@ class Viewer(wx.Panel): | @@ -1312,7 +1312,7 @@ class Viewer(wx.Panel): | ||
1312 | 1312 | ||
1313 | def OnKeyDown(self, evt=None, obj=None): | 1313 | def OnKeyDown(self, evt=None, obj=None): |
1314 | pos = self.scroll.GetThumbPosition() | 1314 | pos = self.scroll.GetThumbPosition() |
1315 | - skip = False | 1315 | + skip = True |
1316 | 1316 | ||
1317 | min = 0 | 1317 | min = 0 |
1318 | max = self.slice_.GetMaxSliceNumber(self.orientation) | 1318 | max = self.slice_.GetMaxSliceNumber(self.orientation) |
@@ -1331,10 +1331,12 @@ class Viewer(wx.Panel): | @@ -1331,10 +1331,12 @@ class Viewer(wx.Panel): | ||
1331 | if (evt.GetKeyCode() == wx.WXK_UP and pos > min): | 1331 | if (evt.GetKeyCode() == wx.WXK_UP and pos > min): |
1332 | self.OnScrollForward() | 1332 | self.OnScrollForward() |
1333 | self.OnScrollBar() | 1333 | self.OnScrollBar() |
1334 | + skip = False | ||
1334 | 1335 | ||
1335 | elif (evt.GetKeyCode() == wx.WXK_DOWN and pos < max): | 1336 | elif (evt.GetKeyCode() == wx.WXK_DOWN and pos < max): |
1336 | self.OnScrollBackward() | 1337 | self.OnScrollBackward() |
1337 | self.OnScrollBar() | 1338 | self.OnScrollBar() |
1339 | + skip = False | ||
1338 | 1340 | ||
1339 | elif (evt.GetKeyCode() == wx.WXK_NUMPAD_ADD): | 1341 | elif (evt.GetKeyCode() == wx.WXK_NUMPAD_ADD): |
1340 | actual_value = self.mip_ctrls.mip_size_spin.GetValue() | 1342 | actual_value = self.mip_ctrls.mip_size_spin.GetValue() |
@@ -1342,6 +1344,7 @@ class Viewer(wx.Panel): | @@ -1342,6 +1344,7 @@ class Viewer(wx.Panel): | ||
1342 | if self.mip_ctrls.mip_size_spin.GetValue() != actual_value: | 1344 | if self.mip_ctrls.mip_size_spin.GetValue() != actual_value: |
1343 | self.number_slices = self.mip_ctrls.mip_size_spin.GetValue() | 1345 | self.number_slices = self.mip_ctrls.mip_size_spin.GetValue() |
1344 | self.ReloadActualSlice() | 1346 | self.ReloadActualSlice() |
1347 | + skip = False | ||
1345 | 1348 | ||
1346 | elif (evt.GetKeyCode() == wx.WXK_NUMPAD_SUBTRACT): | 1349 | elif (evt.GetKeyCode() == wx.WXK_NUMPAD_SUBTRACT): |
1347 | actual_value = self.mip_ctrls.mip_size_spin.GetValue() | 1350 | actual_value = self.mip_ctrls.mip_size_spin.GetValue() |
@@ -1349,6 +1352,7 @@ class Viewer(wx.Panel): | @@ -1349,6 +1352,7 @@ class Viewer(wx.Panel): | ||
1349 | if self.mip_ctrls.mip_size_spin.GetValue() != actual_value: | 1352 | if self.mip_ctrls.mip_size_spin.GetValue() != actual_value: |
1350 | self.number_slices = self.mip_ctrls.mip_size_spin.GetValue() | 1353 | self.number_slices = self.mip_ctrls.mip_size_spin.GetValue() |
1351 | self.ReloadActualSlice() | 1354 | self.ReloadActualSlice() |
1355 | + skip = False | ||
1352 | 1356 | ||
1353 | elif evt.GetKeyCode() in projections: | 1357 | elif evt.GetKeyCode() in projections: |
1354 | self.slice_.SetTypeProjection(projections[evt.GetKeyCode()]) | 1358 | self.slice_.SetTypeProjection(projections[evt.GetKeyCode()]) |
invesalius/reader/dicom_reader.py
@@ -25,6 +25,9 @@ from multiprocessing import cpu_count | @@ -25,6 +25,9 @@ from multiprocessing import cpu_count | ||
25 | 25 | ||
26 | import vtk | 26 | import vtk |
27 | import gdcm | 27 | import gdcm |
28 | +# Not showing GDCM warning and debug messages | ||
29 | +gdcm.Trace_DebugOff() | ||
30 | +gdcm.Trace_WarningOff() | ||
28 | from wx.lib.pubsub import pub as Publisher | 31 | from wx.lib.pubsub import pub as Publisher |
29 | 32 | ||
30 | import invesalius.constants as const | 33 | import invesalius.constants as const |
@@ -48,6 +51,7 @@ if sys.platform == 'win32': | @@ -48,6 +51,7 @@ if sys.platform == 'win32': | ||
48 | else: | 51 | else: |
49 | _has_win32api = False | 52 | _has_win32api = False |
50 | 53 | ||
54 | + | ||
51 | def ReadDicomGroup(dir_): | 55 | def ReadDicomGroup(dir_): |
52 | 56 | ||
53 | patient_group = GetDicomGroups(dir_) | 57 | patient_group = GetDicomGroups(dir_) |