From 468d672530feec15356ecb33e41006f2eefd3ab9 Mon Sep 17 00:00:00 2001 From: paulojamorim Date: Tue, 20 Oct 2009 12:09:07 +0000 Subject: [PATCH] ADD: Option to show vtkOutpuwindow with warning and error messages. const.VTK_WARNING = 0 to disable output. --- invesalius/constants.py | 2 +- invesalius/reader/dicom_reader.py | 8 +++++++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/invesalius/constants.py b/invesalius/constants.py index 908aead..4509f9e 100644 --- a/invesalius/constants.py +++ b/invesalius/constants.py @@ -252,4 +252,4 @@ IMAGE_TILING = {"1 x 1":(1,1), "1 x 2":(1,2), "4 x 3":(4,3), "4 x 4":(4,4), "4 x 5":(4,5), "5 x 4":(5,4)} - +VTK_WARNING = 0 diff --git a/invesalius/reader/dicom_reader.py b/invesalius/reader/dicom_reader.py index fe805b0..d82622b 100644 --- a/invesalius/reader/dicom_reader.py +++ b/invesalius/reader/dicom_reader.py @@ -36,7 +36,6 @@ import data.imagedata_utils as iu def ReadDicomGroup(dir_): patient_group = GetDicomGroups(dir_) - if len(patient_group) > 0: filelist, dicom, zspacing = SelectLargerDicomGroup(patient_group) filelist = SortFiles(filelist, dicom) @@ -144,6 +143,13 @@ class ProgressDicomReader: ps.Publisher().sendMessage("End dicom load", grouper) 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