Commit 468d672530feec15356ecb33e41006f2eefd3ab9

Authored by Paulo Henrique Junqueira Amorim
1 parent 11f86f5a

ADD: Option to show vtkOutpuwindow with warning and error messages. const.VTK_WA…

…RNING = 0 to disable output.
invesalius/constants.py
... ... @@ -252,4 +252,4 @@ IMAGE_TILING = {"1 x 1":(1,1), "1 x 2":(1,2),
252 252 "4 x 3":(4,3), "4 x 4":(4,4),
253 253 "4 x 5":(4,5), "5 x 4":(5,4)}
254 254  
255   -
  255 +VTK_WARNING = 0
... ...
invesalius/reader/dicom_reader.py
... ... @@ -36,7 +36,6 @@ import data.imagedata_utils as iu
36 36 def ReadDicomGroup(dir_):
37 37  
38 38 patient_group = GetDicomGroups(dir_)
39   -
40 39 if len(patient_group) > 0:
41 40 filelist, dicom, zspacing = SelectLargerDicomGroup(patient_group)
42 41 filelist = SortFiles(filelist, dicom)
... ... @@ -144,6 +143,13 @@ class ProgressDicomReader:
144 143 ps.Publisher().sendMessage("End dicom load", grouper)
145 144  
146 145 def GetDicomGroups(self, path, recursive):
  146 +
  147 + if not const.VTK_WARNING:
  148 + fow = vtk.vtkFileOutputWindow()
  149 + #fow.SetFileName('c:\\vtkoutput.txt')
  150 + ow = vtk.vtkOutputWindow()
  151 + ow.SetInstance(fow)
  152 +
147 153 y = yGetDicomGroups(path, recursive)
148 154 for value_progress in y:
149 155 if not self.running:
... ...