Mercurial > hg > orthanc
comparison OrthancServer/FromDcmtkBridge.h @ 788:7ebe4bf87196
refactoring
author | Sebastien Jodogne <s.jodogne@gmail.com> |
---|---|
date | Mon, 05 May 2014 18:39:36 +0200 |
parents | efd0215736d9 |
children | 55dae8c5a6ab |
comparison
equal
deleted
inserted
replaced
787:ac18946afa74 | 788:7ebe4bf87196 |
---|---|
41 #include <json/json.h> | 41 #include <json/json.h> |
42 #include <memory> | 42 #include <memory> |
43 | 43 |
44 namespace Orthanc | 44 namespace Orthanc |
45 { | 45 { |
46 enum DicomRootLevel | |
47 { | |
48 DicomRootLevel_Patient, | |
49 DicomRootLevel_Study, | |
50 DicomRootLevel_Series, | |
51 DicomRootLevel_Instance | |
52 }; | |
53 | |
54 enum DicomReplaceMode | |
55 { | |
56 DicomReplaceMode_InsertIfAbsent, | |
57 DicomReplaceMode_ThrowIfAbsent, | |
58 DicomReplaceMode_IgnoreIfAbsent | |
59 }; | |
60 | |
61 class FromDcmtkBridge | 46 class FromDcmtkBridge |
62 { | 47 { |
63 public: | 48 public: |
49 enum ReplaceMode | |
50 { | |
51 ReplaceMode_InsertIfAbsent, | |
52 ReplaceMode_ThrowIfAbsent, | |
53 ReplaceMode_IgnoreIfAbsent | |
54 }; | |
55 | |
64 static void Convert(DicomMap& target, DcmDataset& dataset); | 56 static void Convert(DicomMap& target, DcmDataset& dataset); |
65 | 57 |
66 static DicomTag GetTag(const DcmElement& element); | 58 static DicomTag GetTag(const DcmElement& element); |
67 | 59 |
68 static DicomValue* ConvertLeafElement(DcmElement& element); | 60 static DicomValue* ConvertLeafElement(DcmElement& element); |
117 const DicomMap& m); | 109 const DicomMap& m); |
118 | 110 |
119 static void ToJson(Json::Value& result, | 111 static void ToJson(Json::Value& result, |
120 const DicomMap& values); | 112 const DicomMap& values); |
121 | 113 |
122 static std::string GenerateUniqueIdentifier(DicomRootLevel level); | 114 static std::string GenerateUniqueIdentifier(ResourceType level); |
123 | 115 |
124 static bool SaveToMemoryBuffer(std::string& buffer, | 116 static bool SaveToMemoryBuffer(std::string& buffer, |
125 DcmDataset* dataSet); | 117 DcmDataset* dataSet); |
126 }; | 118 }; |
127 | 119 |
175 void Insert(const DicomTag& tag, | 167 void Insert(const DicomTag& tag, |
176 const std::string& value); | 168 const std::string& value); |
177 | 169 |
178 void Replace(const DicomTag& tag, | 170 void Replace(const DicomTag& tag, |
179 const std::string& value, | 171 const std::string& value, |
180 DicomReplaceMode mode = DicomReplaceMode_InsertIfAbsent); | 172 FromDcmtkBridge::ReplaceMode mode = FromDcmtkBridge::ReplaceMode_InsertIfAbsent); |
181 | 173 |
182 void RemovePrivateTags(); | 174 void RemovePrivateTags(); |
183 | 175 |
184 bool GetTagValue(std::string& value, | 176 bool GetTagValue(std::string& value, |
185 const DicomTag& tag); | 177 const DicomTag& tag); |