]> Creatis software - clitk.git/commitdiff
Do not seg fault anymore with GDCM1 if the name of the structure does not exist.
authordsarrut <david.sarrut@gmail.com>
Thu, 26 May 2011 06:55:48 +0000 (08:55 +0200)
committerdsarrut <david.sarrut@gmail.com>
Thu, 26 May 2011 06:55:48 +0000 (08:55 +0200)
common/clitkDicomRT_StructureSet.cxx

index f0b690f546093837870632630ee30be540a443cc..8543fb7ddfefac3bbd5392b8a0e3a1f6bbdc18b8 100644 (file)
@@ -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();
 
   //----------------------------------