From 36fabdb651b4cc6b2d52d8a2e0f3be2b78b1f965 Mon Sep 17 00:00:00 2001 From: dsarrut Date: Thu, 26 May 2011 08:55:48 +0200 Subject: [PATCH] Do not seg fault anymore with GDCM1 if the name of the structure does not exist. --- common/clitkDicomRT_StructureSet.cxx | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/common/clitkDicomRT_StructureSet.cxx b/common/clitkDicomRT_StructureSet.cxx index f0b690f..8543fb7 100644 --- a/common/clitkDicomRT_StructureSet.cxx +++ b/common/clitkDicomRT_StructureSet.cxx @@ -274,7 +274,12 @@ void clitk::DicomRT_StructureSet::Read(const std::string & filename) mStudyTime = reader.GetValEntry(0x008,0x0020)->GetValue(); mStudyDate = reader.GetValEntry(0x008,0x0030)->GetValue(); mLabel = reader.GetValEntry(0x3006,0x002)->GetValue(); - mName = reader.GetValEntry(0x3006,0x004)->GetValue(); + if (!reader.GetValEntry(0x3006,0x004)) { + mName = "Anonymous"; + } + else { + mName = reader.GetValEntry(0x3006,0x004)->GetValue(); + } mTime = reader.GetValEntry(0x3006,0x009)->GetValue(); //---------------------------------- -- 2.47.0