comparison OrthancFramework/Sources/DicomFormat/DicomMap.cpp @ 4981:d0c34145320c

cppcheck
author Sebastien Jodogne <s.jodogne@gmail.com>
date Mon, 25 Apr 2022 17:32:58 +0200
parents c68265bf1f94
children 40fd2a485a84
comparison
equal deleted inserted replaced
4980:8b95fc86b8d9 4981:d0c34145320c
202 202
203 std::string ComputeSignature(const std::set<DicomTag>& tags) 203 std::string ComputeSignature(const std::set<DicomTag>& tags)
204 { 204 {
205 // std::set are sorted by default (which is important for us !) 205 // std::set are sorted by default (which is important for us !)
206 std::set<std::string> tagsIds; 206 std::set<std::string> tagsIds;
207 for (std::set<DicomTag>::const_iterator it = tags.begin(); it != tags.end(); it++) 207 for (std::set<DicomTag>::const_iterator it = tags.begin(); it != tags.end(); ++it)
208 { 208 {
209 tagsIds.insert(it->Format()); 209 tagsIds.insert(it->Format());
210 } 210 }
211 211
212 std::string signatureText = boost::algorithm::join(tagsIds, ";"); 212 std::string signatureText = boost::algorithm::join(tagsIds, ";");
409 const std::map<DicomTag, std::string>& mainDicomTags) 409 const std::map<DicomTag, std::string>& mainDicomTags)
410 { 410 {
411 result.Clear(); 411 result.Clear();
412 412
413 for (std::map<DicomTag, std::string>::const_iterator itmt = mainDicomTags.begin(); 413 for (std::map<DicomTag, std::string>::const_iterator itmt = mainDicomTags.begin();
414 itmt != mainDicomTags.end(); itmt++) 414 itmt != mainDicomTags.end(); ++itmt)
415 { 415 {
416 DicomMap::Content::const_iterator it = source.find(itmt->first); 416 DicomMap::Content::const_iterator it = source.find(itmt->first);
417 if (it != source.end()) 417 if (it != source.end())
418 { 418 {
419 result.SetValue(it->first, *it->second /* value will be cloned */); 419 result.SetValue(it->first, *it->second /* value will be cloned */);
424 void DicomMap::ExtractTags(DicomMap& result, const std::set<DicomTag>& tags) const 424 void DicomMap::ExtractTags(DicomMap& result, const std::set<DicomTag>& tags) const
425 { 425 {
426 result.Clear(); 426 result.Clear();
427 427
428 for (std::set<DicomTag>::const_iterator itmt = tags.begin(); 428 for (std::set<DicomTag>::const_iterator itmt = tags.begin();
429 itmt != tags.end(); itmt++) 429 itmt != tags.end(); ++itmt)
430 { 430 {
431 DicomMap::Content::const_iterator it = content_.find(*itmt); 431 DicomMap::Content::const_iterator it = content_.find(*itmt);
432 if (it != content_.end()) 432 if (it != content_.end())
433 { 433 {
434 result.SetValue(it->first, *it->second /* value will be cloned */); 434 result.SetValue(it->first, *it->second /* value will be cloned */);
548 const std::map<DicomTag, std::string>& mainDicomTags) 548 const std::map<DicomTag, std::string>& mainDicomTags)
549 { 549 {
550 result.Clear(); 550 result.Clear();
551 551
552 for (std::map<DicomTag, std::string>::const_iterator itmt = mainDicomTags.begin(); 552 for (std::map<DicomTag, std::string>::const_iterator itmt = mainDicomTags.begin();
553 itmt != mainDicomTags.end(); itmt++) 553 itmt != mainDicomTags.end(); ++itmt)
554 { 554 {
555 result.SetValue(itmt->first, "", false); 555 result.SetValue(itmt->first, "", false);
556 } 556 }
557 } 557 }
558 558
1413 ResourceType level) 1413 ResourceType level)
1414 { 1414 {
1415 const std::map<DicomTag, std::string>& mainDicomTags = DicomMap::MainDicomTagsConfiguration::GetInstance().GetMainDicomTags(level); 1415 const std::map<DicomTag, std::string>& mainDicomTags = DicomMap::MainDicomTagsConfiguration::GetInstance().GetMainDicomTags(level);
1416 1416
1417 for (std::map<DicomTag, std::string>::const_iterator itmt = mainDicomTags.begin(); 1417 for (std::map<DicomTag, std::string>::const_iterator itmt = mainDicomTags.begin();
1418 itmt != mainDicomTags.end(); itmt++) 1418 itmt != mainDicomTags.end(); ++itmt)
1419 { 1419 {
1420 Content::const_iterator found = other.content_.find(itmt->first); 1420 Content::const_iterator found = other.content_.find(itmt->first);
1421 1421
1422 if (found != other.content_.end() && 1422 if (found != other.content_.end() &&
1423 content_.find(itmt->first) == content_.end()) 1423 content_.find(itmt->first) == content_.end())