comparison OrthancFramework/Sources/DicomFormat/DicomMap.cpp @ 4936:8422e4f99a18 more-tags

Handling RequestedTags in ExpandResource -> read parent main dicom tags if required. Not yet getting missing tags from file. Integration tests ok
author Alain Mazy <am@osimis.io>
date Fri, 11 Mar 2022 17:38:16 +0100
parents acd3f72e2a21
children 304514ce84ee
comparison
equal deleted inserted replaced
4935:acd3f72e2a21 4936:8422e4f99a18
401 { 401 {
402 return GetValue(DicomTag(group, element)); 402 return GetValue(DicomTag(group, element));
403 } 403 }
404 404
405 405
406 static void ExtractTags(DicomMap& result, 406 // MORE_TAGS: TODO: we can probably remove the std::string from MainDicomTags (not used here !!!)
407 static void ExtractTagsInternal(DicomMap& result,
407 const DicomMap::Content& source, 408 const DicomMap::Content& source,
408 const std::map<DicomTag, std::string>& mainDicomTags) 409 const std::map<DicomTag, std::string>& mainDicomTags)
409 { 410 {
410 result.Clear(); 411 result.Clear();
411 412
418 result.SetValue(it->first, *it->second /* value will be cloned */); 419 result.SetValue(it->first, *it->second /* value will be cloned */);
419 } 420 }
420 } 421 }
421 } 422 }
422 423
424 void DicomMap::ExtractTags(DicomMap& result, const std::set<DicomTag>& tags) const
425 {
426 result.Clear();
427
428 for (std::set<DicomTag>::const_iterator itmt = tags.begin();
429 itmt != tags.end(); itmt++)
430 {
431 DicomMap::Content::const_iterator it = content_.find(*itmt);
432 if (it != content_.end())
433 {
434 result.SetValue(it->first, *it->second /* value will be cloned */);
435 }
436 }
437 }
438
423 void DicomMap::ExtractResourceInformation(DicomMap& result, ResourceType level) const 439 void DicomMap::ExtractResourceInformation(DicomMap& result, ResourceType level) const
424 { 440 {
425 const std::map<DicomTag, std::string>& mainDicomTags = DicomMap::MainDicomTagsConfiguration::GetInstance().GetMainDicomTags(level); 441 const std::map<DicomTag, std::string>& mainDicomTags = DicomMap::MainDicomTagsConfiguration::GetInstance().GetMainDicomTags(level);
426 ExtractTags(result, content_, mainDicomTags); 442 ExtractTagsInternal(result, content_, mainDicomTags);
427 } 443 }
428 444
429 void DicomMap::ExtractPatientInformation(DicomMap& result) const 445 void DicomMap::ExtractPatientInformation(DicomMap& result) const
430 { 446 {
431 ExtractResourceInformation(result, ResourceType_Patient); 447 ExtractResourceInformation(result, ResourceType_Patient);