diff OrthancFramework/Sources/DicomParsing/DicomModification.h @ 4678:2e850edf03d6

Full support for the anonymization of subsequences containing tags whose VR is UI
author Sebastien Jodogne <s.jodogne@gmail.com>
date Fri, 04 Jun 2021 17:38:43 +0200
parents 521e39b3f2c0
children 898e8ac8c453
line wrap: on
line diff
--- a/OrthancFramework/Sources/DicomParsing/DicomModification.h	Thu Jun 03 21:06:34 2021 +0200
+++ b/OrthancFramework/Sources/DicomParsing/DicomModification.h	Fri Jun 04 17:38:43 2021 +0200
@@ -58,13 +58,53 @@
   private:
     class RelationshipsVisitor;
 
+    class DicomTagRange
+    {
+    private:
+      uint16_t   groupFrom_;
+      uint16_t   groupTo_;
+      uint16_t   elementFrom_;
+      uint16_t   elementTo_;
+
+    public:
+      DicomTagRange(uint16_t groupFrom,
+                    uint16_t groupTo,
+                    uint16_t elementFrom,
+                    uint16_t elementTo);
+
+      uint16_t GetGroupFrom() const
+      {
+        return groupFrom_;
+      }
+
+      uint16_t GetGroupTo() const
+      {
+        return groupTo_;
+      }
+
+      uint16_t GetElementFrom() const
+      {
+        return elementFrom_;
+      }
+
+      uint16_t GetElementTo() const
+      {
+        return elementTo_;
+      }
+
+      bool Contains(const DicomTag& tag) const;
+    };
+    
     typedef std::set<DicomTag> SetOfTags;
     typedef std::map<DicomTag, Json::Value*> Replacements;
     typedef std::map< std::pair<ResourceType, std::string>, std::string>  UidMap;
+    typedef std::list<DicomTagRange>  RemovedRanges;
 
     SetOfTags removals_;
     SetOfTags clearings_;
     Replacements replacements_;
+    SetOfTags uids_;                // New in Orthanc 1.9.4
+    RemovedRanges removedRanges_;   // New in Orthanc 1.9.4
     bool removePrivateTags_;
     ResourceType level_;
     UidMap uidMap_;
@@ -99,6 +139,8 @@
     void ReplaceInternal(const DicomTag& tag,
                          const Json::Value& value);
 
+    void SetupUidsFromOrthanc_1_9_3();
+
     void SetupAnonymization2008();
 
     void SetupAnonymization2017c();