comparison Plugin/DecodedImageAdapter.cpp @ 296:d179f3928342

removed "using namespace Orthanc"
author Sebastien Jodogne <s.jodogne@gmail.com>
date Sat, 30 Jan 2021 12:26:50 +0100
parents e376158e2dbb
children fb7d62e3235e
comparison
equal deleted inserted replaced
295:fc57bf7c0c83 296:d179f3928342
185 185
186 bool DecodedImageAdapter::GetCornerstoneMetadata(Json::Value& result, 186 bool DecodedImageAdapter::GetCornerstoneMetadata(Json::Value& result,
187 const Json::Value& tags, 187 const Json::Value& tags,
188 OrthancImage& image) 188 OrthancImage& image)
189 { 189 {
190 using namespace Orthanc;
191
192 float windowCenter, windowWidth; 190 float windowCenter, windowWidth;
193 191
194 Orthanc::ImageAccessor accessor; 192 Orthanc::ImageAccessor accessor;
195 accessor.AssignReadOnly(OrthancPlugins::Convert(image.GetPixelFormat()), image.GetWidth(), 193 accessor.AssignReadOnly(OrthancPlugins::Convert(image.GetPixelFormat()), image.GetWidth(),
196 image.GetHeight(), image.GetPitch(), image.GetBuffer()); 194 image.GetHeight(), image.GetPitch(), image.GetBuffer());
197 195
198 switch (accessor.GetFormat()) 196 switch (accessor.GetFormat())
199 { 197 {
200 case PixelFormat_Grayscale8: 198 case Orthanc::PixelFormat_Grayscale8:
201 case PixelFormat_Grayscale16: 199 case Orthanc::PixelFormat_Grayscale16:
202 case PixelFormat_SignedGrayscale16: 200 case Orthanc::PixelFormat_SignedGrayscale16:
203 { 201 {
204 int64_t a, b; 202 int64_t a, b;
205 Orthanc::ImageProcessing::GetMinMaxIntegerValue(a, b, accessor); 203 Orthanc::ImageProcessing::GetMinMaxIntegerValue(a, b, accessor);
206 result["minPixelValue"] = (a < 0 ? static_cast<int32_t>(a) : 0); 204 result["minPixelValue"] = (a < 0 ? static_cast<int32_t>(a) : 0);
207 result["maxPixelValue"] = (b > 0 ? static_cast<int32_t>(b) : 1); 205 result["maxPixelValue"] = (b > 0 ? static_cast<int32_t>(b) : 1);
219 } 217 }
220 218
221 break; 219 break;
222 } 220 }
223 221
224 case PixelFormat_RGB24: 222 case Orthanc::PixelFormat_RGB24:
225 case PixelFormat_RGB48: 223 case Orthanc::PixelFormat_RGB48:
226 result["minPixelValue"] = 0; 224 result["minPixelValue"] = 0;
227 result["maxPixelValue"] = 255; 225 result["maxPixelValue"] = 255;
228 result["color"] = true; 226 result["color"] = true;
229 windowCenter = 127.5f; 227 windowCenter = 127.5f;
230 windowWidth = 256.0f; 228 windowWidth = 256.0f;