comparison Plugin/DecodedImageAdapter.cpp @ 172:330ecfd96aec

sync
author Sebastien Jodogne <s.jodogne@gmail.com>
date Tue, 10 Oct 2017 12:53:46 +0200
parents b0910ae2ace5
children 4f0f4f64cff3
comparison
equal deleted inserted replaced
171:b6c55352818c 172:330ecfd96aec
204 case PixelFormat_Grayscale8: 204 case PixelFormat_Grayscale8:
205 case PixelFormat_Grayscale16: 205 case PixelFormat_Grayscale16:
206 case PixelFormat_SignedGrayscale16: 206 case PixelFormat_SignedGrayscale16:
207 { 207 {
208 int64_t a, b; 208 int64_t a, b;
209 Orthanc::ImageProcessing::GetMinMaxValue(a, b, accessor); 209 Orthanc::ImageProcessing::GetMinMaxIntegerValue(a, b, accessor);
210 result["minPixelValue"] = (a < 0 ? static_cast<int32_t>(a) : 0); 210 result["minPixelValue"] = (a < 0 ? static_cast<int32_t>(a) : 0);
211 result["maxPixelValue"] = (b > 0 ? static_cast<int32_t>(b) : 1); 211 result["maxPixelValue"] = (b > 0 ? static_cast<int32_t>(b) : 1);
212 result["color"] = false; 212 result["color"] = false;
213 213
214 windowCenter = static_cast<float>(a + b) / 2.0f; 214 windowCenter = static_cast<float>(a + b) / 2.0f;
412 accessor.GetHeight(), 412 accessor.GetHeight(),
413 true /* force minimal pitch */)); 413 true /* force minimal pitch */));
414 converted = buffer->GetAccessor(); 414 converted = buffer->GetAccessor();
415 415
416 int64_t a, b; 416 int64_t a, b;
417 Orthanc::ImageProcessing::GetMinMaxValue(a, b, accessor); 417 Orthanc::ImageProcessing::GetMinMaxIntegerValue(a, b, accessor);
418 result["Orthanc"]["StretchLow"] = static_cast<int32_t>(a); 418 result["Orthanc"]["StretchLow"] = static_cast<int32_t>(a);
419 result["Orthanc"]["StretchHigh"] = static_cast<int32_t>(b); 419 result["Orthanc"]["StretchHigh"] = static_cast<int32_t>(b);
420 420
421 if (accessor.GetFormat() == Orthanc::PixelFormat_Grayscale16) 421 if (accessor.GetFormat() == Orthanc::PixelFormat_Grayscale16)
422 { 422 {