- {
- str.str("");
- str << medprop->GetPatientName();
- file->InsertEntryString(str.str(),0x0010,0x0010,"PN"); // PN 1 Patient's Name
-
- str.str("");
- str << medprop->GetPatientID();
- file->InsertEntryString(str.str(),0x0010,0x0020,"LO"); // LO 1 Patient ID
-
- str.str("");
- str << medprop->GetPatientAge();
- file->InsertEntryString(str.str(),0x0010,0x1010,"AS"); // AS 1 Patient's Age
-
- str.str("");
- str << medprop->GetPatientSex();
- file->InsertEntryString(str.str(),0x0010,0x0040,"CS"); // CS 1 Patient's Sex
-
- str.str("");
- str << medprop->GetPatientBirthDate();
- file->InsertEntryString(str.str(),0x0010,0x0030,"DA"); // DA 1 Patient's Birth Date
-
- str.str("");
- str << medprop->GetStudyID();
- file->InsertEntryString(str.str(),0x0020,0x0010,"SH"); // SH 1 Study ID
- }
- }
-
-#else
-void SetMedicalImageInformation(gdcm::FileHelper *, vtkMedicalImageProperties *)
-{
+ {
+ if (medprop->GetPatientName())
+ {
+ str.str("");
+ str << medprop->GetPatientName();
+ file->InsertEntryString(str.str(),0x0010,0x0010,"PN"); // PN 1 Patient's Name
+ }
+
+ if (medprop->GetPatientID())
+ {
+ str.str("");
+ str << medprop->GetPatientID();
+ file->InsertEntryString(str.str(),0x0010,0x0020,"LO"); // LO 1 Patient ID
+ }
+
+ if (medprop->GetPatientAge())
+ {
+ str.str("");
+ str << medprop->GetPatientAge();
+ file->InsertEntryString(str.str(),0x0010,0x1010,"AS"); // AS 1 Patient's Age
+ }
+
+ if (medprop->GetPatientSex())
+ {
+ str.str("");
+ str << medprop->GetPatientSex();
+ file->InsertEntryString(str.str(),0x0010,0x0040,"CS"); // CS 1 Patient's Sex
+ }
+
+ if (medprop->GetPatientBirthDate())
+ {
+ str.str("");
+ str << medprop->GetPatientBirthDate();
+ file->InsertEntryString(str.str(),0x0010,0x0030,"DA"); // DA 1 Patient's Birth Date
+ }
+
+ if (medprop->GetStudyID())
+ {
+ str.str("");
+ str << medprop->GetStudyID();
+ file->InsertEntryString(str.str(),0x0020,0x0010,"SH"); // SH 1 Study ID
+ }
+ }