From f4bb8776261436490c9d86a319a745d9122690d8 Mon Sep 17 00:00:00 2001 From: tatiana Date: Thu, 15 Oct 2009 13:02:51 +0000 Subject: [PATCH] FIX: Date formatting 0392 --- invesalius/reader/dicom.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/invesalius/reader/dicom.py b/invesalius/reader/dicom.py index 1a934d2..8bf57c1 100644 --- a/invesalius/reader/dicom.py +++ b/invesalius/reader/dicom.py @@ -102,7 +102,7 @@ class Parser(): # TODO: internationalize data date = self.vtkgdcm_reader.GetMedicalImageProperties()\ .GetAcquisitionDate() - if (date): + if (date) and (date != ''): return self.__format_date(date) return "" @@ -145,7 +145,7 @@ class Parser(): """ time = self.vtkgdcm_reader.GetMedicalImageProperties()\ .GetAcquisitionTime() - if (time): + if (time) and (time != 'None'): return self.__format_time(time) return "" @@ -1048,7 +1048,7 @@ class Parser(): # TODO: internationalize data date = self.vtkgdcm_reader.GetMedicalImageProperties()\ .GetPatientBirthDate() - if (date): + if (date) and (date!='None'): self.__format_date(date) return "" @@ -1410,9 +1410,9 @@ class Parser(): tag = gdcm.Tag(0x0008, 0x0033) ds = self.gdcm_reader.GetFile().GetDataSet() if ds.FindDataElement(tag): - data = str(ds.GetDataElement(tag).GetValue()) - if (data): - return self.__format_time(data) + date = str(ds.GetDataElement(tag).GetValue()) + if (date) and (date != 'None'): + return self.__format_time(date) return "" def __format_time(self,value): -- libgit2 0.21.2