From fe6a94e1db7531cbf7bf611ecd7bbff3851de6a8 Mon Sep 17 00:00:00 2001 From: tfmoraes Date: Wed, 19 Jan 2011 18:18:18 +0000 Subject: [PATCH] Merging improvement from dicom branch to master --- invesalius/reader/dicom.py | 5 +++-- invesalius/reader/dicom_reader.py | 2 +- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/invesalius/reader/dicom.py b/invesalius/reader/dicom.py index 45243ea..667a748 100644 --- a/invesalius/reader/dicom.py +++ b/invesalius/reader/dicom.py @@ -1580,8 +1580,9 @@ class Parser(): except(KeyError): return 'ISO_IR_100' - if encoding != None and encoding != "None": - + if encoding is None or encoding == "None" or not encoding.strip(): + return 'ISO_IR 100' + else: #Problem with 0051 anonymized if (encoding.split(":"))[0] == "Loaded": return 'ISO_IR 100' diff --git a/invesalius/reader/dicom_reader.py b/invesalius/reader/dicom_reader.py index a35cf65..eb58ce1 100644 --- a/invesalius/reader/dicom_reader.py +++ b/invesalius/reader/dicom_reader.py @@ -121,7 +121,7 @@ class LoadDicom: ds = reader.GetFile().GetDataSet() if ds.FindDataElement(tag): encoding = str(ds.GetDataElement(tag).GetValue()) - if not(encoding != None and encoding != "None" and encoding != "Loaded"): + if encoding is None or encoding == "None" or encoding.startswith("Loaded"): encoding = "ISO_IR 100" else: encoding = "ISO_IR_100" -- libgit2 0.21.2