changeset 1289:343aa1dfaa90 bugs/2020-02-invisible-slice

Ongoing work on invisible slice bug (logging + removed unused function)
author Benjamin Golinvaux <bgo@osimis.io>
date Wed, 19 Feb 2020 17:05:08 +0100
parents d8c42e5e5843
children 7def6ab2929f
files Applications/Generic/GuiAdapter.cpp Applications/Generic/GuiAdapter.h Framework/Scene2D/FloatTextureSceneLayer.cpp Framework/Scene2D/Internals/OpenGLLookupTableTextureRenderer.cpp Framework/Toolbox/DicomInstanceParameters.cpp Framework/Volumes/DicomVolumeImageMPRSlicer.cpp
diffstat 6 files changed, 75 insertions(+), 62 deletions(-) [+]
line wrap: on
line diff
--- a/Applications/Generic/GuiAdapter.cpp	Fri Feb 14 15:30:36 2020 +0100
+++ b/Applications/Generic/GuiAdapter.cpp	Wed Feb 19 17:05:08 2020 +0100
@@ -36,10 +36,14 @@
 
 namespace OrthancStone
 {
+#if 0
   void GuiAdapter::RegisterWidget(boost::shared_ptr<IGuiAdapterWidget> widget)
   {
+    LOG(INFO) << "GuiAdapter::RegisterWidget" 
+
     widgets_.push_back(widget);
   }
+#endif
 
   std::ostream& operator<<(
     std::ostream& os, const GuiAdapterKeyboardEvent& event)
--- a/Applications/Generic/GuiAdapter.h	Fri Feb 14 15:30:36 2020 +0100
+++ b/Applications/Generic/GuiAdapter.h	Wed Feb 19 17:05:08 2020 +0100
@@ -235,7 +235,10 @@
       instanceCount = 1;
     }
 
+
+#if 0
     void RegisterWidget(boost::shared_ptr<IGuiAdapterWidget> widget);
+#endif
     
     /**
       emscripten_set_resize_callback("#window", NULL, false, OnWindowResize);
@@ -362,6 +365,8 @@
     */
     void ViewportsUpdateSize();
 
+
+#if 0
     std::vector<boost::weak_ptr<IGuiAdapterWidget> > widgets_;
 
     template<typename F> void VisitWidgets(F func)
@@ -377,5 +382,6 @@
         }
       }
     }
+#endif
   };
 }
--- a/Framework/Scene2D/FloatTextureSceneLayer.cpp	Fri Feb 14 15:30:36 2020 +0100
+++ b/Framework/Scene2D/FloatTextureSceneLayer.cpp	Wed Feb 19 17:05:08 2020 +0100
@@ -43,12 +43,12 @@
 
       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);\"";
+        LOG(INFO) << "+----------------------------------------+";
+        LOG(INFO) << "|        This is not an error!           |";
+        LOG(INFO) << "+----------------------------------------+";
+        LOG(INFO) << "Work on the \"invisible slice\" bug";
+        LOG(INFO) << "in FloatTextureSceneLayer::FloatTextureSceneLayer";
+        LOG(INFO) << "will dump \"t\" after \"Orthanc::ImageProcessing::Convert(*t, texture);\"";
 
         HistogramData hd;
         double minValue = 0;
@@ -58,10 +58,10 @@
         ComputeHistogram(*t, hd, binSize);
         std::string s;
         DumpHistogramResult(s, hd);
-        LOG(ERROR) << s;
-        LOG(ERROR) << "+----------------------------------------+";
-        LOG(ERROR) << "|        end of debug dump               |";
-        LOG(ERROR) << "+----------------------------------------+";
+        LOG(INFO) << s;
+        LOG(INFO) << "+----------------------------------------+";
+        LOG(INFO) << "|        end of debug dump               |";
+        LOG(INFO) << "+----------------------------------------+";
       }
 
       SetTexture(t.release());
--- a/Framework/Scene2D/Internals/OpenGLLookupTableTextureRenderer.cpp	Fri Feb 14 15:30:36 2020 +0100
+++ b/Framework/Scene2D/Internals/OpenGLLookupTableTextureRenderer.cpp	Wed Feb 19 17:05:08 2020 +0100
@@ -127,17 +127,17 @@
 
           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 OpenGLLookupTableTextureRenderer::LoadTexture():";
-            LOG(ERROR) << "layer.GetMinValue() = " << layer.GetMinValue() << " | layer.GetMaxValue() = " << layer.GetMaxValue();
-            LOG(ERROR) << "a = " << a << " | slope = " << slope;
+            LOG(INFO) << "+----------------------------------------+";
+            LOG(INFO) << "|        This is not an error!           |";
+            LOG(INFO) << "+----------------------------------------+";
+            LOG(INFO) << "Work on the \"invisible slice\" bug";
+            LOG(INFO) << "--> in OpenGLLookupTableTextureRenderer::LoadTexture():";
+            LOG(INFO) << "layer.GetMinValue() = " << layer.GetMinValue() << " | layer.GetMaxValue() = " << layer.GetMaxValue();
+            LOG(INFO) << "a = " << a << " | slope = " << slope;
 
-            LOG(ERROR) << "SOURCE gets scaled and offset, this yields --> TEMP that gets through the lut to yield RESULT";
-            LOG(ERROR) << "The SOURCE (layer.GetTexture()) will be dumped below (format is Float32)";
-            LOG(ERROR) << "";
+            LOG(INFO) << "SOURCE gets scaled and offset, this yields --> TEMP that gets through the lut to yield RESULT";
+            LOG(INFO) << "The SOURCE (layer.GetTexture()) will be dumped below (format is Float32)";
+            LOG(INFO) << "";
             HistogramData hd;
             double minValue = 0;
             double maxValue = 0;
@@ -146,41 +146,42 @@
             ComputeHistogram(source, hd, binSize);
             std::string s;
             DumpHistogramResult(s, hd);
-            LOG(ERROR) << s;
-            LOG(ERROR) << "";
+            LOG(INFO) << s;
+            LOG(INFO) << "";
 
 
-            LOG(ERROR) << "TEMP will be dumped below (format is uint8_t)";
-            LOG(ERROR) << "";
+            LOG(INFO) << "TEMP will be dumped below (format is uint8_t)";
+            LOG(INFO) << "";
 
             {
               uint8_t vv = 0;
               do
               {
-                LOG(ERROR) << "    TEMP. Pixel " << (int)vv << " is present "
+                LOG(INFO) << "    TEMP. Pixel " << (int)vv << " is present "
                   << debugHistogram[vv] << " times";
               } while (vv++ != 255);
             }
 
-            LOG(ERROR) << "\nThe LUT will be dumped below";
-            LOG(ERROR) << "----------------------------";
-            LOG(ERROR) << "";
+            LOG(INFO) << "\nThe LUT will be dumped below";
+            LOG(INFO) << "----------------------------";
+            LOG(INFO) << "bgotag-2020-02-18-20-26";
+            LOG(INFO) << "";
 
             {
               uint8_t vv = 0;
               // proper way to loop on all unsigned values is a do while loop
               do
               {
-                LOG(ERROR) << "    LUT[" << (int)vv << "] ="
+                LOG(INFO) << "    LUT[" << (int)vv << "] ="
                   << " R:" << (int)lut[4 * vv + 0]
                   << " G:" << (int)lut[4 * vv + 1]
                   << " B:" << (int)lut[4 * vv + 2]
                   << " A:" << (int)lut[4 * vv + 3];
               } while (vv++ != 255);
             }
-            LOG(ERROR) << "+----------------------------------------+";
-            LOG(ERROR) << "|        end of debug dump               |";
-            LOG(ERROR) << "+----------------------------------------+";
+            LOG(INFO) << "+----------------------------------------+";
+            LOG(INFO) << "|        end of debug dump               |";
+            LOG(INFO) << "+----------------------------------------+";
           }
         }
 
--- a/Framework/Toolbox/DicomInstanceParameters.cpp	Fri Feb 14 15:30:36 2020 +0100
+++ b/Framework/Toolbox/DicomInstanceParameters.cpp	Wed Feb 19 17:05:08 2020 +0100
@@ -264,7 +264,6 @@
             distance <= thickness_ / 2.0);
   }
 
-      
   void DicomInstanceParameters::Data::ApplyRescaleAndDoseScaling(Orthanc::ImageAccessor& image,
                                                    bool useDouble) const
   {
@@ -284,12 +283,12 @@
 
     if (OrthancStone_Internals_dump_LoadTexture_histogram == 1)
     {
-      LOG(ERROR) << "in DicomInstanceParameters::Data::ApplyRescaleAndDoseScaling:";
-      LOG(ERROR) << "    doseGridScaling_ = " << doseGridScaling_ 
+      LOG(INFO) << "in DicomInstanceParameters::Data::ApplyRescaleAndDoseScaling:";
+      LOG(INFO) << "    doseGridScaling_ = " << doseGridScaling_ 
         << " hasRescale_ = " << hasRescale_ 
         << " rescaleSlope_ = " << rescaleSlope_ 
         << " rescaleIntercept_ = " << rescaleIntercept_;
-      LOG(ERROR) << "    --> factor = " << factor << " offset = " << offset;
+      LOG(INFO) << "    --> factor = " << factor << " offset = " << offset;
     }
 
     if ( (factor != 1.0) || (offset != 0.0) )
@@ -388,17 +387,17 @@
 
     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: DicomInstanceParameters::ConvertToFloat()";
-      LOG(ERROR) << "dumping texture hist after conversion from native sliceReader to Float32";
-      LOG(ERROR) << "(source buffer address before conversion is: " << pixelData.GetConstBuffer() << ")";
-      LOG(ERROR) << " target buffer address after conversion is: " << converted->GetConstBuffer();
+      LOG(INFO) << "+----------------------------------------+";
+      LOG(INFO) << "|        This is not an error!           |";
+      LOG(INFO) << "+----------------------------------------+";
+      LOG(INFO) << "Work on the \"invisible slice\" bug";
+      LOG(INFO) << "in: DicomInstanceParameters::ConvertToFloat()";
+      LOG(INFO) << "dumping texture hist after conversion from native sliceReader to Float32";
+      LOG(INFO) << "(source buffer address before conversion is: " << pixelData.GetConstBuffer() << ")";
+      LOG(INFO) << " target buffer address after conversion is: " << converted->GetConstBuffer();
 
-      LOG(ERROR) << "Target histo:";
-      LOG(ERROR) << "-------------";
+      LOG(INFO) << "Target histo:";
+      LOG(INFO) << "-------------";
       {
         HistogramData hd;
         double minValue = 0;
@@ -408,7 +407,7 @@
         ComputeHistogram(*converted, hd, binSize);
         std::string s;
         DumpHistogramResult(s, hd);
-        LOG(ERROR) << s;
+        LOG(INFO) << s;
       }
     }
                                                    
@@ -419,8 +418,8 @@
     if (OrthancStone_Internals_dump_LoadTexture_histogram == 1)
     {
 
-      LOG(ERROR) << "Target histo after data_.ApplyRescaleAndDoseScaling";
-      LOG(ERROR) << "---------------------------------------------------";
+      LOG(INFO) << "Target histo after data_.ApplyRescaleAndDoseScaling";
+      LOG(INFO) << "---------------------------------------------------";
       {
         HistogramData hd;
         double minValue = 0;
@@ -430,11 +429,11 @@
         ComputeHistogram(*converted, hd, binSize);
         std::string s;
         DumpHistogramResult(s, hd);
-        LOG(ERROR) << s;
+        LOG(INFO) << s;
       }
-      LOG(ERROR) << "+----------------------------------------+";
-      LOG(ERROR) << "|        end of debug dump               |";
-      LOG(ERROR) << "+----------------------------------------+";
+      LOG(INFO) << "+----------------------------------------+";
+      LOG(INFO) << "|        end of debug dump               |";
+      LOG(INFO) << "+----------------------------------------+";
     }
 
     return converted.release();
--- a/Framework/Volumes/DicomVolumeImageMPRSlicer.cpp	Fri Feb 14 15:30:36 2020 +0100
+++ b/Framework/Volumes/DicomVolumeImageMPRSlicer.cpp	Wed Feb 19 17:05:08 2020 +0100
@@ -77,6 +77,8 @@
                                       "A style configurator is mandatory for textures");
     }
 
+    LOG(INFO) << "DicomVolumeImageMPRSlicer::Slice::CreateSceneLayer(). volume_ address is " << (void*)(&volume_) << " and its SOPInstanceUID is " << volume_.GetDicomParameters().GetSopInstanceUid();
+
     std::auto_ptr<TextureBaseSceneLayer> texture;
       
     {
@@ -85,11 +87,12 @@
 
       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) << "InvisibleSlice -- about to dump histogram (100 buckets) for volume_ "
+        LOG(INFO) << "+----------------------------------------+";
+        LOG(INFO) << "|        This is not an error!           |";
+        LOG(INFO) << "+----------------------------------------+";
+        LOG(INFO) << "Work on the \"invisible slice\" bug";
+        LOG(INFO) << "DicomVolumeImageMPRSlicer::Slice::CreateSceneLayer";
+        LOG(INFO) << "InvisibleSlice -- about to dump histogram (100 buckets) for volume_ "
           << "with OrthancId: " << parameters.GetOrthancInstanceIdentifier()
           << " and SopInstanceUid: " << parameters.GetSopInstanceUid()
           << " for projection_ (AxiCorSag): projection_ "
@@ -103,10 +106,10 @@
         ComputeHistogram(reader.GetAccessor(), hd, binSize);
         std::string s;
         DumpHistogramResult(s, hd);
-        LOG(ERROR) << s;
-        LOG(ERROR) << "+----------------------------------------+";
-        LOG(ERROR) << "|        end of debug dump               |";
-        LOG(ERROR) << "+----------------------------------------+";
+        LOG(INFO) << s;
+        LOG(INFO) << "+----------------------------------------+";
+        LOG(INFO) << "|        end of debug dump               |";
+        LOG(INFO) << "+----------------------------------------+";
       }
 
       texture.reset(dynamic_cast<TextureBaseSceneLayer*>