comparison OrthancFramework/Sources/DicomFormat/DicomMap.h @ 5044:6fed78e13233

Refactored DicomMap to handle sequences when needed
author Alain Mazy <am@osimis.io>
date Tue, 28 Jun 2022 17:45:09 +0200
parents 1c08cd68250a
children 48005e522bd6
comparison
equal deleted inserted replaced
5043:ec5c203a97ea 5044:6fed78e13233
92 void SetValue(uint16_t group, 92 void SetValue(uint16_t group,
93 uint16_t element, 93 uint16_t element,
94 const std::string& str, 94 const std::string& str,
95 bool isBinary); 95 bool isBinary);
96 96
97 void SetValue(const DicomTag& tag,
98 const Json::Value& value);
99
97 bool HasTag(uint16_t group, uint16_t element) const; 100 bool HasTag(uint16_t group, uint16_t element) const;
98 101
99 bool HasTag(const DicomTag& tag) const; 102 bool HasTag(const DicomTag& tag) const;
100 103
101 const DicomValue& GetValue(uint16_t group, uint16_t element) const; 104 const DicomValue& GetValue(uint16_t group, uint16_t element) const;
122 125
123 void ExtractResourceInformation(DicomMap& result, ResourceType level) const; 126 void ExtractResourceInformation(DicomMap& result, ResourceType level) const;
124 127
125 void ExtractTags(DicomMap& result, const std::set<DicomTag>& tags) const; 128 void ExtractTags(DicomMap& result, const std::set<DicomTag>& tags) const;
126 129
130 void ExtractSequences(DicomMap& result) const;
131
127 static void SetupFindPatientTemplate(DicomMap& result); 132 static void SetupFindPatientTemplate(DicomMap& result);
128 133
129 static void SetupFindStudyTemplate(DicomMap& result); 134 static void SetupFindStudyTemplate(DicomMap& result);
130 135
131 static void SetupFindSeriesTemplate(DicomMap& result); 136 static void SetupFindSeriesTemplate(DicomMap& result);
146 static bool HasOnlyComputedTags(const std::set<DicomTag>& tags); 151 static bool HasOnlyComputedTags(const std::set<DicomTag>& tags);
147 152
148 static bool HasComputedTags(const std::set<DicomTag>& tags, ResourceType level); 153 static bool HasComputedTags(const std::set<DicomTag>& tags, ResourceType level);
149 154
150 static bool HasComputedTags(const std::set<DicomTag>& tags); 155 static bool HasComputedTags(const std::set<DicomTag>& tags);
151
152 #if ORTHANC_ENABLE_DCMTK == 1
153 static void ExtractSequences(std::set<DicomTag>& sequences, const std::set<DicomTag>& tags);
154 #endif
155 156
156 static const std::set<DicomTag>& GetMainDicomTags(ResourceType level); 157 static const std::set<DicomTag>& GetMainDicomTags(ResourceType level);
157 158
158 // returns a string uniquely identifying the list of main dicom tags for a level 159 // returns a string uniquely identifying the list of main dicom tags for a level
159 static const std::string& GetMainDicomTagsSignature(ResourceType level); 160 static const std::string& GetMainDicomTagsSignature(ResourceType level);
206 207
207 bool ParseDouble(double& result, 208 bool ParseDouble(double& result,
208 const DicomTag& tag) const; 209 const DicomTag& tag) const;
209 210
210 void FromDicomAsJson(const Json::Value& dicomAsJson, 211 void FromDicomAsJson(const Json::Value& dicomAsJson,
211 bool append = false); 212 bool append = false,
213 bool parseSequences = false);
212 214
213 void Merge(const DicomMap& other); 215 void Merge(const DicomMap& other);
214 216
215 void MergeMainDicomTags(const DicomMap& other, 217 void MergeMainDicomTags(const DicomMap& other,
216 ResourceType level); 218 ResourceType level);
229 const std::string& defaultValue, 231 const std::string& defaultValue,
230 bool allowBinary) const; 232 bool allowBinary) const;
231 233
232 void RemoveBinaryTags(); 234 void RemoveBinaryTags();
233 235
236 void RemoveSequences();
237
234 void DumpMainDicomTags(Json::Value& target, 238 void DumpMainDicomTags(Json::Value& target,
235 ResourceType level) const; 239 ResourceType level) const;
236 240
237 void Print(FILE* fp) const; // For debugging only 241 void Print(FILE* fp) const; // For debugging only
238 }; 242 };