comparison UnitTestsSources/DicomMapTests.cpp @ 2007:655489d9165d

DicomMap::ParseDicomMetaInformation()
author Sebastien Jodogne <s.jodogne@gmail.com>
date Thu, 09 Jun 2016 15:46:33 +0200
parents b1291df2f780
children a657f7772e69
comparison
equal deleted inserted replaced
2006:6301bbcbcaed 2007:655489d9165d
88 m.GetTags(s); 88 m.GetTags(s);
89 ASSERT_EQ(0u, s.size()); 89 ASSERT_EQ(0u, s.size());
90 90
91 ASSERT_FALSE(m.HasTag(DICOM_TAG_PATIENT_NAME)); 91 ASSERT_FALSE(m.HasTag(DICOM_TAG_PATIENT_NAME));
92 ASSERT_FALSE(m.HasTag(0x0010, 0x0010)); 92 ASSERT_FALSE(m.HasTag(0x0010, 0x0010));
93 m.SetValue(0x0010, 0x0010, "PatientName"); 93 m.SetValue(0x0010, 0x0010, "PatientName", false);
94 ASSERT_TRUE(m.HasTag(DICOM_TAG_PATIENT_NAME)); 94 ASSERT_TRUE(m.HasTag(DICOM_TAG_PATIENT_NAME));
95 ASSERT_TRUE(m.HasTag(0x0010, 0x0010)); 95 ASSERT_TRUE(m.HasTag(0x0010, 0x0010));
96 96
97 m.GetTags(s); 97 m.GetTags(s);
98 ASSERT_EQ(1u, s.size()); 98 ASSERT_EQ(1u, s.size());
99 ASSERT_EQ(DICOM_TAG_PATIENT_NAME, *s.begin()); 99 ASSERT_EQ(DICOM_TAG_PATIENT_NAME, *s.begin());
100 100
101 ASSERT_FALSE(m.HasTag(DICOM_TAG_PATIENT_ID)); 101 ASSERT_FALSE(m.HasTag(DICOM_TAG_PATIENT_ID));
102 m.SetValue(DICOM_TAG_PATIENT_ID, "PatientID"); 102 m.SetValue(DICOM_TAG_PATIENT_ID, "PatientID", false);
103 ASSERT_TRUE(m.HasTag(0x0010, 0x0020)); 103 ASSERT_TRUE(m.HasTag(0x0010, 0x0020));
104 m.SetValue(DICOM_TAG_PATIENT_ID, "PatientID2"); 104 m.SetValue(DICOM_TAG_PATIENT_ID, "PatientID2", false);
105 ASSERT_EQ("PatientID2", m.GetValue(0x0010, 0x0020).GetContent()); 105 ASSERT_EQ("PatientID2", m.GetValue(0x0010, 0x0020).GetContent());
106 106
107 m.GetTags(s); 107 m.GetTags(s);
108 ASSERT_EQ(2u, s.size()); 108 ASSERT_EQ(2u, s.size());
109 109
115 ASSERT_EQ(DICOM_TAG_PATIENT_NAME, *s.begin()); 115 ASSERT_EQ(DICOM_TAG_PATIENT_NAME, *s.begin());
116 116
117 std::auto_ptr<DicomMap> mm(m.Clone()); 117 std::auto_ptr<DicomMap> mm(m.Clone());
118 ASSERT_EQ("PatientName", mm->GetValue(DICOM_TAG_PATIENT_NAME).GetContent()); 118 ASSERT_EQ("PatientName", mm->GetValue(DICOM_TAG_PATIENT_NAME).GetContent());
119 119
120 m.SetValue(DICOM_TAG_PATIENT_ID, "Hello"); 120 m.SetValue(DICOM_TAG_PATIENT_ID, "Hello", false);
121 ASSERT_THROW(mm->GetValue(DICOM_TAG_PATIENT_ID), OrthancException); 121 ASSERT_THROW(mm->GetValue(DICOM_TAG_PATIENT_ID), OrthancException);
122 mm->CopyTagIfExists(m, DICOM_TAG_PATIENT_ID); 122 mm->CopyTagIfExists(m, DICOM_TAG_PATIENT_ID);
123 ASSERT_EQ("Hello", mm->GetValue(DICOM_TAG_PATIENT_ID).GetContent()); 123 ASSERT_EQ("Hello", mm->GetValue(DICOM_TAG_PATIENT_ID).GetContent());
124 124
125 DicomValue v; 125 DicomValue v;