]> Creatis software - clitk.git/blobdiff - common/clitkDicomRT_StructureSet.cxx
Add Write function (still to be defined)
[clitk.git] / common / clitkDicomRT_StructureSet.cxx
index f0b690f546093837870632630ee30be540a443cc..2d5abd15ead731c71c343249dec98dd385c1ceb6 100644 (file)
@@ -141,6 +141,18 @@ void clitk::DicomRT_StructureSet::Print(std::ostream & os) const
 //--------------------------------------------------------------------
 
 
+//--------------------------------------------------------------------
+void clitk::DicomRT_StructureSet::Write(const std::string & filename)
+{
+#if GDCM_MAJOR_VERSION == 2
+  DD("WRITE TODO");
+#else
+  FATAL("Sorry not compatible with GDCM1, use GDCM2");
+#endif
+}
+//--------------------------------------------------------------------
+
+
 //--------------------------------------------------------------------
 void clitk::DicomRT_StructureSet::Read(const std::string & filename)
 {
@@ -274,7 +286,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();
 
   //----------------------------------