From caac4beb46da3e4ebd49eeaddd8bc637b8d6bdd4 Mon Sep 17 00:00:00 2001 From: tatiana Date: Thu, 31 Dec 2009 10:20:13 +0000 Subject: [PATCH] ENH: #68 default DICOM encoding is 'ISO_IR 100' --- invesalius/reader/dicom.py | 19 ++++++++----------- 1 file changed, 8 insertions(+), 11 deletions(-) diff --git a/invesalius/reader/dicom.py b/invesalius/reader/dicom.py index 7c54afa..3f868cc 100644 --- a/invesalius/reader/dicom.py +++ b/invesalius/reader/dicom.py @@ -1139,11 +1139,8 @@ class Parser(): if (data): name = data.strip() encoding = self.GetEncoding() - if encoding != None: - # Returns a unicode decoded in the own dicom encoding - return name.decode(encoding) - else: - return name.strip() + # Returns a unicode decoded in the own dicom encoding + return name.decode(encoding) return "" def GetPatientID(self): @@ -1158,11 +1155,8 @@ class Parser(): .GetPatientID() if (data): encoding = self.GetEncoding() - if encoding != None: - # Returns a unicode decoded in the own dicom encoding - return data.decode(self.GetEncoding()) - else: - return data + # Returns a unicode decoded in the own dicom encoding + return data.decode(encoding) return "" @@ -1509,7 +1503,10 @@ class Parser(): ds = self.gdcm_reader.GetFile().GetDataSet() if ds.FindDataElement(tag): encoding = str(ds.GetDataElement(tag).GetValue()) - return encoding + if encoding != None: + return encoding + + return 'ISO_IR 100' class DicomWriter: -- libgit2 0.21.2