From 4ed4823be62e297455a46338e288fc6bc7be5287 Mon Sep 17 00:00:00 2001 From: Thiago Franco de Moraes Date: Wed, 9 Oct 2019 16:09:16 -0300 Subject: [PATCH] Some key shortcuts was not working when the focus is in the viewer slice and reducing the warning and debug messages from gdcm --- invesalius/data/viewer_slice.py | 6 +++++- invesalius/reader/dicom_reader.py | 4 ++++ 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/invesalius/data/viewer_slice.py b/invesalius/data/viewer_slice.py index bc8bddc..30ff0a8 100644 --- a/invesalius/data/viewer_slice.py +++ b/invesalius/data/viewer_slice.py @@ -1312,7 +1312,7 @@ class Viewer(wx.Panel): def OnKeyDown(self, evt=None, obj=None): pos = self.scroll.GetThumbPosition() - skip = False + skip = True min = 0 max = self.slice_.GetMaxSliceNumber(self.orientation) @@ -1331,10 +1331,12 @@ class Viewer(wx.Panel): if (evt.GetKeyCode() == wx.WXK_UP and pos > min): self.OnScrollForward() self.OnScrollBar() + skip = False elif (evt.GetKeyCode() == wx.WXK_DOWN and pos < max): self.OnScrollBackward() self.OnScrollBar() + skip = False elif (evt.GetKeyCode() == wx.WXK_NUMPAD_ADD): actual_value = self.mip_ctrls.mip_size_spin.GetValue() @@ -1342,6 +1344,7 @@ class Viewer(wx.Panel): if self.mip_ctrls.mip_size_spin.GetValue() != actual_value: self.number_slices = self.mip_ctrls.mip_size_spin.GetValue() self.ReloadActualSlice() + skip = False elif (evt.GetKeyCode() == wx.WXK_NUMPAD_SUBTRACT): actual_value = self.mip_ctrls.mip_size_spin.GetValue() @@ -1349,6 +1352,7 @@ class Viewer(wx.Panel): if self.mip_ctrls.mip_size_spin.GetValue() != actual_value: self.number_slices = self.mip_ctrls.mip_size_spin.GetValue() self.ReloadActualSlice() + skip = False elif evt.GetKeyCode() in projections: self.slice_.SetTypeProjection(projections[evt.GetKeyCode()]) diff --git a/invesalius/reader/dicom_reader.py b/invesalius/reader/dicom_reader.py index d4ada61..5ebc6da 100644 --- a/invesalius/reader/dicom_reader.py +++ b/invesalius/reader/dicom_reader.py @@ -25,6 +25,9 @@ from multiprocessing import cpu_count import vtk import gdcm +# Not showing GDCM warning and debug messages +gdcm.Trace_DebugOff() +gdcm.Trace_WarningOff() from wx.lib.pubsub import pub as Publisher import invesalius.constants as const @@ -48,6 +51,7 @@ if sys.platform == 'win32': else: _has_win32api = False + def ReadDicomGroup(dir_): patient_group = GetDicomGroups(dir_) -- libgit2 0.21.2