Mercurial > hg > orthanc-stone
comparison Framework/Toolbox/DicomInstanceParameters.cpp @ 1291:ea6c2254536d bugs/2020-02-invisible-slice
Removal of debug logs
author | Benjamin Golinvaux <bgo@osimis.io> |
---|---|
date | Fri, 21 Feb 2020 15:23:40 +0100 |
parents | 343aa1dfaa90 |
children | 6ab03e429f06 8a0a62189f46 |
comparison
equal
deleted
inserted
replaced
1290:7def6ab2929f | 1291:ea6c2254536d |
---|---|
279 { | 279 { |
280 factor *= rescaleSlope_; | 280 factor *= rescaleSlope_; |
281 offset = rescaleIntercept_; | 281 offset = rescaleIntercept_; |
282 } | 282 } |
283 | 283 |
284 if (OrthancStone_Internals_dump_LoadTexture_histogram == 1) | |
285 { | |
286 LOG(INFO) << "in DicomInstanceParameters::Data::ApplyRescaleAndDoseScaling:"; | |
287 LOG(INFO) << " doseGridScaling_ = " << doseGridScaling_ | |
288 << " hasRescale_ = " << hasRescale_ | |
289 << " rescaleSlope_ = " << rescaleSlope_ | |
290 << " rescaleIntercept_ = " << rescaleIntercept_; | |
291 LOG(INFO) << " --> factor = " << factor << " offset = " << offset; | |
292 } | |
293 | |
294 if ( (factor != 1.0) || (offset != 0.0) ) | 284 if ( (factor != 1.0) || (offset != 0.0) ) |
295 { | 285 { |
296 const unsigned int width = image.GetWidth(); | 286 const unsigned int width = image.GetWidth(); |
297 const unsigned int height = image.GetHeight(); | 287 const unsigned int height = image.GetHeight(); |
298 | 288 |
383 pixelData.GetWidth(), | 373 pixelData.GetWidth(), |
384 pixelData.GetHeight(), | 374 pixelData.GetHeight(), |
385 false)); | 375 false)); |
386 Orthanc::ImageProcessing::Convert(*converted, pixelData); | 376 Orthanc::ImageProcessing::Convert(*converted, pixelData); |
387 | 377 |
388 if (OrthancStone_Internals_dump_LoadTexture_histogram == 1) | |
389 { | |
390 LOG(INFO) << "+----------------------------------------+"; | |
391 LOG(INFO) << "| This is not an error! |"; | |
392 LOG(INFO) << "+----------------------------------------+"; | |
393 LOG(INFO) << "Work on the \"invisible slice\" bug"; | |
394 LOG(INFO) << "in: DicomInstanceParameters::ConvertToFloat()"; | |
395 LOG(INFO) << "dumping texture hist after conversion from native sliceReader to Float32"; | |
396 LOG(INFO) << "(source buffer address before conversion is: " << pixelData.GetConstBuffer() << ")"; | |
397 LOG(INFO) << " target buffer address after conversion is: " << converted->GetConstBuffer(); | |
398 | |
399 LOG(INFO) << "Target histo:"; | |
400 LOG(INFO) << "-------------"; | |
401 { | |
402 HistogramData hd; | |
403 double minValue = 0; | |
404 double maxValue = 0; | |
405 ComputeMinMax(*converted, minValue, maxValue); | |
406 double binSize = (maxValue - minValue) * 0.01; | |
407 ComputeHistogram(*converted, hd, binSize); | |
408 std::string s; | |
409 DumpHistogramResult(s, hd); | |
410 LOG(INFO) << s; | |
411 } | |
412 } | |
413 | 378 |
414 // Correct rescale slope/intercept if need be | 379 // Correct rescale slope/intercept if need be |
415 //data_.ApplyRescaleAndDoseScaling(*converted, (pixelData.GetFormat() == Orthanc::PixelFormat_Grayscale32)); | 380 //data_.ApplyRescaleAndDoseScaling(*converted, (pixelData.GetFormat() == Orthanc::PixelFormat_Grayscale32)); |
416 data_.ApplyRescaleAndDoseScaling(*converted, false); | 381 data_.ApplyRescaleAndDoseScaling(*converted, false); |
417 | 382 |
418 if (OrthancStone_Internals_dump_LoadTexture_histogram == 1) | |
419 { | |
420 | |
421 LOG(INFO) << "Target histo after data_.ApplyRescaleAndDoseScaling"; | |
422 LOG(INFO) << "---------------------------------------------------"; | |
423 { | |
424 HistogramData hd; | |
425 double minValue = 0; | |
426 double maxValue = 0; | |
427 ComputeMinMax(*converted, minValue, maxValue); | |
428 double binSize = (maxValue - minValue) * 0.01; | |
429 ComputeHistogram(*converted, hd, binSize); | |
430 std::string s; | |
431 DumpHistogramResult(s, hd); | |
432 LOG(INFO) << s; | |
433 } | |
434 LOG(INFO) << "+----------------------------------------+"; | |
435 LOG(INFO) << "| end of debug dump |"; | |
436 LOG(INFO) << "+----------------------------------------+"; | |
437 } | |
438 | |
439 return converted.release(); | 383 return converted.release(); |
440 } | 384 } |
441 | 385 |
442 | 386 |
443 TextureBaseSceneLayer* DicomInstanceParameters::CreateTexture | 387 TextureBaseSceneLayer* DicomInstanceParameters::CreateTexture |