Mercurial > hg > orthanc
comparison OrthancFramework/Sources/DicomFormat/DicomMap.cpp @ 5036:877bc3b96476
Handle Dicom sequences in ExtraMainDicomTags and save them in the 'MainDicomSequences' metadata
author | Alain Mazy <am@osimis.io> |
---|---|
date | Fri, 24 Jun 2022 15:47:10 +0200 |
parents | 40fd2a485a84 |
children | f8bea9c1c0fc |
comparison
equal
deleted
inserted
replaced
5035:67d98fccc850 | 5036:877bc3b96476 |
---|---|
32 #include "../Endianness.h" | 32 #include "../Endianness.h" |
33 #include "../Logging.h" | 33 #include "../Logging.h" |
34 #include "../OrthancException.h" | 34 #include "../OrthancException.h" |
35 #include "../Toolbox.h" | 35 #include "../Toolbox.h" |
36 #include "DicomArray.h" | 36 #include "DicomArray.h" |
37 | 37 #include "../DicomParsing/FromDcmtkBridge.h" |
38 | 38 |
39 namespace Orthanc | 39 namespace Orthanc |
40 { | 40 { |
41 namespace | 41 namespace |
42 { | 42 { |
610 delete it->second; | 610 delete it->second; |
611 content_.erase(it); | 611 content_.erase(it); |
612 } | 612 } |
613 } | 613 } |
614 | 614 |
615 void DicomMap::RemoveTags(const std::set<DicomTag>& tags) | |
616 { | |
617 for (std::set<DicomTag>::const_iterator it = tags.begin(); it != tags.end(); ++it) | |
618 { | |
619 Remove(*it); | |
620 } | |
621 } | |
615 | 622 |
616 static void SetupFindTemplate(DicomMap& result, | 623 static void SetupFindTemplate(DicomMap& result, |
617 const std::map<DicomTag, std::string>& mainDicomTags) | 624 const std::map<DicomTag, std::string>& mainDicomTags) |
618 { | 625 { |
619 result.Clear(); | 626 result.Clear(); |
1520 } | 1527 } |
1521 } | 1528 } |
1522 | 1529 |
1523 return true; | 1530 return true; |
1524 } | 1531 } |
1525 | 1532 |
1533 void DicomMap::ExtractSequences(std::set<DicomTag>& sequences, const std::set<DicomTag>& tags) | |
1534 { | |
1535 sequences.clear(); | |
1536 | |
1537 for (std::set<DicomTag>::const_iterator it = tags.begin(); it != tags.end(); ++it) | |
1538 { | |
1539 ValueRepresentation vr = FromDcmtkBridge::LookupValueRepresentation(*it); | |
1540 if (vr == ValueRepresentation_Sequence) | |
1541 { | |
1542 sequences.insert(*it); | |
1543 } | |
1544 } | |
1545 } | |
1526 | 1546 |
1527 void DicomMap::Serialize(Json::Value& target) const | 1547 void DicomMap::Serialize(Json::Value& target) const |
1528 { | 1548 { |
1529 target = Json::objectValue; | 1549 target = Json::objectValue; |
1530 | 1550 |