Mercurial > hg > orthanc
diff OrthancServer/FromDcmtkBridge.cpp @ 2126:03b065778fc3
cleaning up
author | Sebastien Jodogne <s.jodogne@gmail.com> |
---|---|
date | Mon, 07 Nov 2016 13:47:21 +0100 |
parents | b9bd52c72ba2 |
children | 0c09d1af22f3 |
line wrap: on
line diff
--- a/OrthancServer/FromDcmtkBridge.cpp Mon Nov 07 12:38:09 2016 +0100 +++ b/OrthancServer/FromDcmtkBridge.cpp Mon Nov 07 13:47:21 2016 +0100 @@ -741,20 +741,12 @@ } - static void DatasetToJson(Json::Value& parent, - DcmItem& item, - DicomToJsonFormat format, - DicomToJsonFlags flags, - unsigned int maxStringLength, - Encoding encoding); - - - void FromDcmtkBridge::ToJson(Json::Value& parent, - DcmElement& element, - DicomToJsonFormat format, - DicomToJsonFlags flags, - unsigned int maxStringLength, - Encoding encoding) + void FromDcmtkBridge::ElementToJson(Json::Value& parent, + DcmElement& element, + DicomToJsonFormat format, + DicomToJsonFlags flags, + unsigned int maxStringLength, + Encoding encoding) { if (parent.type() == Json::nullValue) { @@ -789,12 +781,12 @@ } - static void DatasetToJson(Json::Value& parent, - DcmItem& item, - DicomToJsonFormat format, - DicomToJsonFlags flags, - unsigned int maxStringLength, - Encoding encoding) + void FromDcmtkBridge::DatasetToJson(Json::Value& parent, + DcmItem& item, + DicomToJsonFormat format, + DicomToJsonFlags flags, + unsigned int maxStringLength, + Encoding encoding) { assert(parent.type() == Json::objectValue); @@ -839,28 +831,29 @@ } } - FromDcmtkBridge::ToJson(parent, *element, format, flags, maxStringLength, encoding); + FromDcmtkBridge::ElementToJson(parent, *element, format, flags, maxStringLength, encoding); } } - void FromDcmtkBridge::ToJson(Json::Value& target, - DcmDataset& dataset, - DicomToJsonFormat format, - DicomToJsonFlags flags, - unsigned int maxStringLength, - Encoding defaultEncoding) + void FromDcmtkBridge::ExtractDicomAsJson(Json::Value& target, + DcmDataset& dataset, + DicomToJsonFormat format, + DicomToJsonFlags flags, + unsigned int maxStringLength) { + Encoding encoding = DetectEncoding(dataset, Configuration::GetDefaultEncoding()); + target = Json::objectValue; - DatasetToJson(target, dataset, format, flags, maxStringLength, DetectEncoding(dataset, defaultEncoding)); + DatasetToJson(target, dataset, format, flags, maxStringLength, encoding); } - void FromDcmtkBridge::ToJson(Json::Value& target, - DcmMetaInfo& dataset, - DicomToJsonFormat format, - DicomToJsonFlags flags, - unsigned int maxStringLength) + void FromDcmtkBridge::ExtractHeaderAsJson(Json::Value& target, + DcmMetaInfo& dataset, + DicomToJsonFormat format, + DicomToJsonFlags flags, + unsigned int maxStringLength) { target = Json::objectValue; DatasetToJson(target, dataset, format, flags, maxStringLength, Encoding_Ascii);