Mercurial > hg > orthanc
comparison OrthancServer/FromDcmtkBridge.h @ 2126:03b065778fc3
cleaning up
author | Sebastien Jodogne <s.jodogne@gmail.com> |
---|---|
date | Mon, 07 Nov 2016 13:47:21 +0100 |
parents | b9bd52c72ba2 |
children | 9329ba17a069 |
comparison
equal
deleted
inserted
replaced
2125:b9bd52c72ba2 | 2126:03b065778fc3 |
---|---|
42 #include <dcmtk/dcmdata/dcmetinf.h> | 42 #include <dcmtk/dcmdata/dcmetinf.h> |
43 #include <dcmtk/dcmdata/dcpixseq.h> | 43 #include <dcmtk/dcmdata/dcpixseq.h> |
44 #include <dcmtk/dcmdata/dcfilefo.h> | 44 #include <dcmtk/dcmdata/dcfilefo.h> |
45 #include <json/json.h> | 45 #include <json/json.h> |
46 | 46 |
47 #if ORTHANC_BUILD_UNIT_TESTS == 1 | |
48 # include <gtest/gtest_prod.h> | |
49 #endif | |
50 | |
51 | |
47 namespace Orthanc | 52 namespace Orthanc |
48 { | 53 { |
49 class FromDcmtkBridge : public boost::noncopyable | 54 class FromDcmtkBridge : public boost::noncopyable |
50 { | 55 { |
56 #if ORTHANC_BUILD_UNIT_TESTS == 1 | |
57 FRIEND_TEST(FromDcmtkBridge, FromJson); | |
58 #endif | |
59 | |
51 private: | 60 private: |
52 FromDcmtkBridge(); // Pure static class | 61 FromDcmtkBridge(); // Pure static class |
53 | 62 |
54 static void ExtractDicomSummary(DicomMap& target, | 63 static void ExtractDicomSummary(DicomMap& target, |
55 DcmItem& dataset, | 64 DcmItem& dataset, |
56 unsigned int maxStringLength, | 65 unsigned int maxStringLength, |
57 Encoding defaultEncoding); | 66 Encoding defaultEncoding); |
67 | |
68 static void DatasetToJson(Json::Value& parent, | |
69 DcmItem& item, | |
70 DicomToJsonFormat format, | |
71 DicomToJsonFlags flags, | |
72 unsigned int maxStringLength, | |
73 Encoding encoding); | |
74 | |
75 static void ElementToJson(Json::Value& parent, | |
76 DcmElement& element, | |
77 DicomToJsonFormat format, | |
78 DicomToJsonFlags flags, | |
79 unsigned int maxStringLength, | |
80 Encoding dicomEncoding); | |
58 | 81 |
59 public: | 82 public: |
60 static void InitializeDictionary(); | 83 static void InitializeDictionary(); |
61 | 84 |
62 static void RegisterDictionaryTag(const DicomTag& tag, | 85 static void RegisterDictionaryTag(const DicomTag& tag, |
84 static DicomValue* ConvertLeafElement(DcmElement& element, | 107 static DicomValue* ConvertLeafElement(DcmElement& element, |
85 DicomToJsonFlags flags, | 108 DicomToJsonFlags flags, |
86 unsigned int maxStringLength, | 109 unsigned int maxStringLength, |
87 Encoding encoding); | 110 Encoding encoding); |
88 | 111 |
89 static void ToJson(Json::Value& parent, | 112 static void ExtractDicomAsJson(Json::Value& target, |
90 DcmElement& element, | 113 DcmDataset& dataset, |
91 DicomToJsonFormat format, | 114 DicomToJsonFormat format, |
92 DicomToJsonFlags flags, | 115 DicomToJsonFlags flags, |
93 unsigned int maxStringLength, | 116 unsigned int maxStringLength); |
94 Encoding dicomEncoding); | 117 |
95 | 118 static void ExtractHeaderAsJson(Json::Value& target, |
96 static void ToJson(Json::Value& target, | 119 DcmMetaInfo& header, |
97 DcmDataset& dataset, | 120 DicomToJsonFormat format, |
98 DicomToJsonFormat format, | 121 DicomToJsonFlags flags, |
99 DicomToJsonFlags flags, | 122 unsigned int maxStringLength); |
100 unsigned int maxStringLength, | |
101 Encoding defaultEncoding); | |
102 | |
103 static void ToJson(Json::Value& target, | |
104 DcmMetaInfo& header, | |
105 DicomToJsonFormat format, | |
106 DicomToJsonFlags flags, | |
107 unsigned int maxStringLength); | |
108 | 123 |
109 static std::string GetTagName(const DicomTag& tag, | 124 static std::string GetTagName(const DicomTag& tag, |
110 const std::string& privateCreator); | 125 const std::string& privateCreator); |
111 | 126 |
112 static std::string GetTagName(const DcmElement& element); | 127 static std::string GetTagName(const DcmElement& element); |