Mercurial > hg > orthanc
comparison OrthancServer/FromDcmtkBridge.h @ 789:55dae8c5a6ab
refactoring
author | Sebastien Jodogne <s.jodogne@gmail.com> |
---|---|
date | Mon, 05 May 2014 18:43:34 +0200 |
parents | 7ebe4bf87196 |
children | 331eaf9d9d69 |
comparison
equal
deleted
inserted
replaced
788:7ebe4bf87196 | 789:55dae8c5a6ab |
---|---|
33 #pragma once | 33 #pragma once |
34 | 34 |
35 #include "../Core/DicomFormat/DicomInstanceHasher.h" | 35 #include "../Core/DicomFormat/DicomInstanceHasher.h" |
36 #include "../Core/RestApi/RestApiOutput.h" | 36 #include "../Core/RestApi/RestApiOutput.h" |
37 #include "../Core/Toolbox.h" | 37 #include "../Core/Toolbox.h" |
38 #include "ServerEnumerations.h" | |
38 | 39 |
39 #include <dcmtk/dcmdata/dcdatset.h> | 40 #include <dcmtk/dcmdata/dcdatset.h> |
40 #include <dcmtk/dcmdata/dcfilefo.h> | 41 #include <dcmtk/dcmdata/dcfilefo.h> |
41 #include <json/json.h> | 42 #include <json/json.h> |
42 #include <memory> | 43 #include <memory> |
44 namespace Orthanc | 45 namespace Orthanc |
45 { | 46 { |
46 class FromDcmtkBridge | 47 class FromDcmtkBridge |
47 { | 48 { |
48 public: | 49 public: |
49 enum ReplaceMode | |
50 { | |
51 ReplaceMode_InsertIfAbsent, | |
52 ReplaceMode_ThrowIfAbsent, | |
53 ReplaceMode_IgnoreIfAbsent | |
54 }; | |
55 | |
56 static void Convert(DicomMap& target, DcmDataset& dataset); | 50 static void Convert(DicomMap& target, DcmDataset& dataset); |
57 | 51 |
58 static DicomTag GetTag(const DcmElement& element); | 52 static DicomTag GetTag(const DcmElement& element); |
59 | 53 |
60 static DicomValue* ConvertLeafElement(DcmElement& element); | 54 static DicomValue* ConvertLeafElement(DcmElement& element); |
167 void Insert(const DicomTag& tag, | 161 void Insert(const DicomTag& tag, |
168 const std::string& value); | 162 const std::string& value); |
169 | 163 |
170 void Replace(const DicomTag& tag, | 164 void Replace(const DicomTag& tag, |
171 const std::string& value, | 165 const std::string& value, |
172 FromDcmtkBridge::ReplaceMode mode = FromDcmtkBridge::ReplaceMode_InsertIfAbsent); | 166 DicomReplaceMode mode = DicomReplaceMode_InsertIfAbsent); |
173 | 167 |
174 void RemovePrivateTags(); | 168 void RemovePrivateTags(); |
175 | 169 |
176 bool GetTagValue(std::string& value, | 170 bool GetTagValue(std::string& value, |
177 const DicomTag& tag); | 171 const DicomTag& tag); |