changeset 479:9cc84d0fbea9

Extrapolate mode doesn't fail if no consensus is found in WADO-RS Retrieve Metadata
author Sebastien Jodogne <s.jodogne@gmail.com>
date Thu, 26 Nov 2020 19:51:27 +0100
parents 8121a16faf3e
children 6dc2f79b5579
files NEWS Plugin/WadoRs.cpp
diffstat 2 files changed, 9 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/NEWS	Fri Nov 06 17:54:09 2020 +0100
+++ b/NEWS	Thu Nov 26 19:51:27 2020 +0100
@@ -1,6 +1,9 @@
 Pending changes in the mainline
 ===============================
 
+* "Extrapolate" mode doesn't fail if no consensus is found in WADO-RS Retrieve Metadata.
+  This is necessary for proper behavior of the Stone Web viewer on very small series.
+
 
 Version 1.3 (2020-10-19)
 ========================
--- a/Plugin/WadoRs.cpp	Fri Nov 06 17:54:09 2020 +0100
+++ b/Plugin/WadoRs.cpp	Thu Nov 26 19:51:27 2020 +0100
@@ -25,6 +25,7 @@
 
 #include <Compatibility.h>
 #include <ChunkedBuffer.h>
+#include <Logging.h>
 #include <Toolbox.h>
 
 #include <memory>
@@ -394,11 +395,14 @@
           ++current;
         }
 
+        target.SetValue(tag, maxValue, false);
+
         // Take the ceiling of the number of available instances
         const size_t threshold = instances_.size() / 2 + 1;
-        if (maxCount >= threshold)
+        if (maxCount < threshold)
         {
-          target.SetValue(tag, maxValue, false);
+          LOG(WARNING) << "No consensus on the value of a tag during WADO-RS Retrieve "
+                       << "Metadata in Extrapolate mode: " << tag.Format();
         }
       }
     }