comparison Framework/Inputs/DicomPyramidInstance.cpp @ 61:147bd6dc28db

refactoring using new items in the plugin toolbox of Orthanc
author Sebastien Jodogne <s.jodogne@gmail.com>
date Fri, 25 Nov 2016 17:15:55 +0100
parents 7a3853d51c45
children f45cec2c32e2
comparison
equal deleted inserted replaced
60:a59fdb848a7b 61:147bd6dc28db
90 throw Orthanc::OrthancException(Orthanc::ErrorCode_NotImplemented); 90 throw Orthanc::OrthancException(Orthanc::ErrorCode_NotImplemented);
91 } 91 }
92 } 92 }
93 93
94 94
95 ImageCompression DicomPyramidInstance::GetImageCompression(IOrthancConnection& orthanc) 95 ImageCompression DicomPyramidInstance::GetImageCompression(OrthancPlugins::IOrthancConnection& orthanc)
96 { 96 {
97 /** 97 /**
98 * Lazy detection of the image compression using the transfer 98 * Lazy detection of the image compression using the transfer
99 * syntax stored inside the DICOM header. Given the fact that 99 * syntax stored inside the DICOM header. Given the fact that
100 * reading the header is a time-consuming operation (it implies 100 * reading the header is a time-consuming operation (it implies
104 **/ 104 **/
105 105
106 if (!hasCompression_) 106 if (!hasCompression_)
107 { 107 {
108 Json::Value header; 108 Json::Value header;
109 IOrthancConnection::RestApiGet(header, orthanc, "/instances/" + instanceId_ + "/header?simplify"); 109 OrthancPlugins::IOrthancConnection::RestApiGet
110 (header, orthanc, "/instances/" + instanceId_ + "/header?simplify");
110 111
111 hasCompression_ = true; 112 hasCompression_ = true;
112 compression_ = DetectImageCompression(header); 113 compression_ = DetectImageCompression(header);
113 } 114 }
114 115
115 return compression_; 116 return compression_;
116 } 117 }
117 118
118 119
119 DicomPyramidInstance::DicomPyramidInstance(IOrthancConnection& orthanc, 120 DicomPyramidInstance::DicomPyramidInstance(OrthancPlugins::IOrthancConnection& orthanc,
120 const std::string& instanceId) : 121 const std::string& instanceId) :
121 instanceId_(instanceId), 122 instanceId_(instanceId),
122 hasCompression_(false) 123 hasCompression_(false)
123 { 124 {
124 Json::Value dicom; 125 Json::Value dicom;
125 IOrthancConnection::RestApiGet(dicom, orthanc, "/instances/" + instanceId + "/tags?simplify"); 126 OrthancPlugins::IOrthancConnection::RestApiGet
127 (dicom, orthanc, "/instances/" + instanceId + "/tags?simplify");
126 128
127 if (DicomToolbox::GetMandatoryStringTag(dicom, "SOPClassUID") != "1.2.840.10008.5.1.4.1.1.77.1.6" || 129 if (DicomToolbox::GetMandatoryStringTag(dicom, "SOPClassUID") != "1.2.840.10008.5.1.4.1.1.77.1.6" ||
128 DicomToolbox::GetMandatoryStringTag(dicom, "Modality") != "SM") 130 DicomToolbox::GetMandatoryStringTag(dicom, "Modality") != "SM")
129 { 131 {
130 throw Orthanc::OrthancException(Orthanc::ErrorCode_ParameterOutOfRange); 132 throw Orthanc::OrthancException(Orthanc::ErrorCode_ParameterOutOfRange);