diff --git a/invesalius/reader/dicom_reader.py b/invesalius/reader/dicom_reader.py index cc36bf5..b71695a 100644 --- a/invesalius/reader/dicom_reader.py +++ b/invesalius/reader/dicom_reader.py @@ -118,6 +118,13 @@ def yGetDicomGroups(directory, recursive=True, gui=True): yield grouper.GetPatientsGroups() def GetDicomGroups(directory, recursive=True): + + if not const.VTK_WARNING: + fow = vtk.vtkFileOutputWindow() + #fow.SetFileName('c:\\vtkoutput.txt') + ow = vtk.vtkOutputWindow() + ow.SetInstance(fow) + return yGetDicomGroups(directory, recursive, gui=False).next() @@ -145,12 +152,6 @@ class ProgressDicomReader: def GetDicomGroups(self, path, recursive): - if not const.VTK_WARNING: - fow = vtk.vtkFileOutputWindow() - #fow.SetFileName('c:\\vtkoutput.txt') - ow = vtk.vtkOutputWindow() - ow.SetInstance(fow) - y = yGetDicomGroups(path, recursive) for value_progress in y: if not self.running: -- libgit2 0.21.2