comparison OrthancServer/DicomModification.h @ 1698:d78b87f93bcf

DicomModification use Json::Value
author Sebastien Jodogne <s.jodogne@gmail.com>
date Fri, 09 Oct 2015 12:29:21 +0200
parents 18c02c6987d5
children b1291df2f780
comparison
equal deleted inserted replaced
1697:21902c8ba95b 1698:d78b87f93bcf
34 34
35 #include "ParsedDicomFile.h" 35 #include "ParsedDicomFile.h"
36 36
37 namespace Orthanc 37 namespace Orthanc
38 { 38 {
39 class DicomModification 39 class DicomModification : public boost::noncopyable
40 { 40 {
41 /** 41 /**
42 * Process: 42 * Process:
43 * (1) Remove private tags 43 * (1) Remove private tags
44 * (2) Remove tags specified by the user 44 * (2) Remove tags specified by the user
45 * (3) Replace tags 45 * (3) Replace tags
46 **/ 46 **/
47 47
48 private: 48 private:
49 typedef std::set<DicomTag> SetOfTags; 49 typedef std::set<DicomTag> SetOfTags;
50 typedef std::map<DicomTag, std::string> Replacements; 50 typedef std::map<DicomTag, Json::Value*> Replacements;
51 typedef std::map< std::pair<ResourceType, std::string>, std::string> UidMap; 51 typedef std::map< std::pair<ResourceType, std::string>, std::string> UidMap;
52 52
53 SetOfTags removals_; 53 SetOfTags removals_;
54 Replacements replacements_; 54 Replacements replacements_;
55 bool removePrivateTags_; 55 bool removePrivateTags_;
61 void MapDicomIdentifier(ParsedDicomFile& dicom, 61 void MapDicomIdentifier(ParsedDicomFile& dicom,
62 ResourceType level); 62 ResourceType level);
63 63
64 void MarkNotOrthancAnonymization(); 64 void MarkNotOrthancAnonymization();
65 65
66 void ClearReplacements();
67
68 void RemoveInternal(const DicomTag& tag);
69
70 void ReplaceInternal(const DicomTag& tag,
71 const Json::Value& value);
72
66 public: 73 public:
67 DicomModification(); 74 DicomModification();
75
76 ~DicomModification();
68 77
69 void Keep(const DicomTag& tag); 78 void Keep(const DicomTag& tag);
70 79
71 void Remove(const DicomTag& tag); 80 void Remove(const DicomTag& tag);
72 81
73 bool IsRemoved(const DicomTag& tag) const; 82 bool IsRemoved(const DicomTag& tag) const;
74 83
75 void Replace(const DicomTag& tag, 84 void Replace(const DicomTag& tag,
76 const std::string& utf8Value, 85 const Json::Value& value, // Encoded using UTF-8
77 bool safeForAnonymization = false); 86 bool safeForAnonymization = false);
78 87
79 bool IsReplaced(const DicomTag& tag) const; 88 bool IsReplaced(const DicomTag& tag) const;
80 89
81 const std::string& GetReplacement(const DicomTag& tag) const; 90 const Json::Value& GetReplacement(const DicomTag& tag) const;
91
92 std::string GetReplacementAsString(const DicomTag& tag) const;
82 93
83 void SetRemovePrivateTags(bool removed); 94 void SetRemovePrivateTags(bool removed);
84 95
85 bool ArePrivateTagsRemoved() const 96 bool ArePrivateTagsRemoved() const
86 { 97 {