changeset 4825:381c2ca04860

fix DicomIntegerPixelAccessor::GetExtremeValues() on multi-channel images
author Sebastien Jodogne <s.jodogne@gmail.com>
date Thu, 25 Nov 2021 13:58:10 +0100
parents c0986ae1b9fc
children 6c276fac0cc0 4cfd96732076
files OrthancFramework/Sources/DicomFormat/DicomIntegerPixelAccessor.cpp OrthancFramework/Sources/DicomFormat/DicomIntegerPixelAccessor.h
diffstat 2 files changed, 4 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/OrthancFramework/Sources/DicomFormat/DicomIntegerPixelAccessor.cpp	Thu Nov 25 13:09:27 2021 +0100
+++ b/OrthancFramework/Sources/DicomFormat/DicomIntegerPixelAccessor.cpp	Thu Nov 25 13:58:10 2021 +0100
@@ -115,7 +115,7 @@
       {
         for (unsigned int c = 0; c < channels; c++)
         {
-          int32_t v = GetValue(x, y);
+          int32_t v = GetValue(x, y, c);
           if (v < min)
             min = v;
           if (v > max)
--- a/OrthancFramework/Sources/DicomFormat/DicomIntegerPixelAccessor.h	Thu Nov 25 13:09:27 2021 +0100
+++ b/OrthancFramework/Sources/DicomFormat/DicomIntegerPixelAccessor.h	Thu Nov 25 13:58:10 2021 +0100
@@ -64,7 +64,9 @@
     void GetExtremeValues(int32_t& min, 
                           int32_t& max) const;
 
-    int32_t GetValue(unsigned int x, unsigned int y, unsigned int channel = 0) const;
+    int32_t GetValue(unsigned int x,
+                     unsigned int y,
+                     unsigned int channel) const;
 
     const void* GetPixelData() const
     {