comparison OrthancFramework/UnitTestsSources/DicomMapTests.cpp @ 4933:312c6f4da888 more-tags

adding MainDicomTags signatures
author Alain Mazy <am@osimis.io>
date Wed, 09 Mar 2022 12:16:45 +0100
parents b7ce2bb6b881
children 304514ce84ee
comparison
equal deleted inserted replaced
4932:b7ce2bb6b881 4933:312c6f4da888
136 ASSERT_THROW(DicomMap::AddMainDicomTag(DICOM_TAG_BITS_ALLOCATED, "BitsAllocated", ResourceType_Instance), OrthancException); 136 ASSERT_THROW(DicomMap::AddMainDicomTag(DICOM_TAG_BITS_ALLOCATED, "BitsAllocated", ResourceType_Instance), OrthancException);
137 137
138 // adding another tag with same name should throw 138 // adding another tag with same name should throw
139 ASSERT_THROW(DicomMap::AddMainDicomTag(DICOM_TAG_BITS_STORED, "BitsAllocated", ResourceType_Instance), OrthancException); 139 ASSERT_THROW(DicomMap::AddMainDicomTag(DICOM_TAG_BITS_STORED, "BitsAllocated", ResourceType_Instance), OrthancException);
140 } 140 }
141
142 TEST_F(DicomMapMainTagsTests, Signatures)
143 {
144 std::string defaultPatientSignature = DicomMap::GetDefaultMainDicomTagsSignature(ResourceType_Patient);
145 std::string defaultStudySignature = DicomMap::GetDefaultMainDicomTagsSignature(ResourceType_Study);
146 std::string defaultSeriesSignature = DicomMap::GetDefaultMainDicomTagsSignature(ResourceType_Series);
147 std::string defaultInstanceSignature = DicomMap::GetDefaultMainDicomTagsSignature(ResourceType_Instance);
148
149 ASSERT_NE(defaultInstanceSignature, defaultPatientSignature);
150 ASSERT_NE(defaultSeriesSignature, defaultStudySignature);
151 ASSERT_NE(defaultSeriesSignature, defaultPatientSignature);
152
153 std::string patientSignature = DicomMap::GetMainDicomTagsSignature(ResourceType_Patient);
154 std::string studySignature = DicomMap::GetMainDicomTagsSignature(ResourceType_Study);
155 std::string seriesSignature = DicomMap::GetMainDicomTagsSignature(ResourceType_Series);
156 std::string instanceSignature = DicomMap::GetMainDicomTagsSignature(ResourceType_Instance);
157
158 // at start, default and current signature should be equal
159 ASSERT_EQ(defaultPatientSignature, patientSignature);
160 ASSERT_EQ(defaultStudySignature, studySignature);
161 ASSERT_EQ(defaultSeriesSignature, seriesSignature);
162 ASSERT_EQ(defaultInstanceSignature, instanceSignature);
163
164 DicomMap::AddMainDicomTag(DICOM_TAG_BITS_ALLOCATED, "BitsAllocated", ResourceType_Instance);
165 instanceSignature = DicomMap::GetMainDicomTagsSignature(ResourceType_Instance);
166
167 ASSERT_NE(defaultInstanceSignature, instanceSignature);
168 }
169
141 } 170 }
142 171
143 TEST(DicomMap, Tags) 172 TEST(DicomMap, Tags)
144 { 173 {
145 std::set<DicomTag> s; 174 std::set<DicomTag> s;