diff Framework/Scene2D/FloatTextureSceneLayer.cpp @ 1287:8e82fdc6200e bugs/2020-02-invisible-slice

Heavy (temporary) logging in the path that leads from multiframe volume to slice (rendered texture)
author Benjamin Golinvaux <bgo@osimis.io>
date Fri, 14 Feb 2020 15:00:54 +0100
parents 2d8ab34c8c91
children 343aa1dfaa90
line wrap: on
line diff
--- a/Framework/Scene2D/FloatTextureSceneLayer.cpp	Fri Feb 14 14:59:32 2020 +0100
+++ b/Framework/Scene2D/FloatTextureSceneLayer.cpp	Fri Feb 14 15:00:54 2020 +0100
@@ -21,6 +21,8 @@
 
 #include "FloatTextureSceneLayer.h"
 
+#include "../Toolbox/ImageToolbox.h"
+
 #include <Core/Images/Image.h>
 #include <Core/Images/ImageProcessing.h>
 #include <Core/OrthancException.h>
@@ -38,6 +40,30 @@
                            false));
 
       Orthanc::ImageProcessing::Convert(*t, texture);
+
+      if (OrthancStone_Internals_dump_LoadTexture_histogram == 1)
+      {
+        LOG(ERROR) << "+----------------------------------------+";
+        LOG(ERROR) << "|        This is not an error!           |";
+        LOG(ERROR) << "+----------------------------------------+";
+        LOG(ERROR) << "Work on the \"invisible slice\" bug";
+        LOG(ERROR) << "in FloatTextureSceneLayer::FloatTextureSceneLayer";
+        LOG(ERROR) << "will dump \"t\" after \"Orthanc::ImageProcessing::Convert(*t, texture);\"";
+
+        HistogramData hd;
+        double minValue = 0;
+        double maxValue = 0;
+        ComputeMinMax(*t, minValue, maxValue);
+        double binSize = (maxValue - minValue) * 0.01;
+        ComputeHistogram(*t, hd, binSize);
+        std::string s;
+        DumpHistogramResult(s, hd);
+        LOG(ERROR) << s;
+        LOG(ERROR) << "+----------------------------------------+";
+        LOG(ERROR) << "|        end of debug dump               |";
+        LOG(ERROR) << "+----------------------------------------+";
+      }
+
       SetTexture(t.release());
     }