changeset 4312:6d49e3b6ff77

fix abi of DicomImageInformation
author Sebastien Jodogne <s.jodogne@gmail.com>
date Mon, 09 Nov 2020 15:22:43 +0100
parents cb9aef006229
children 91554aecff9a
files OrthancFramework/Sources/DicomFormat/DicomImageInformation.cpp OrthancFramework/Sources/DicomFormat/DicomImageInformation.h OrthancFramework/Sources/DicomParsing/Internals/DicomFrameIndex.cpp OrthancFramework/Sources/DicomParsing/Internals/DicomImageDecoder.cpp
diffstat 4 files changed, 21 insertions(+), 16 deletions(-) [+]
line wrap: on
line diff
--- a/OrthancFramework/Sources/DicomFormat/DicomImageInformation.cpp	Mon Nov 09 15:07:55 2020 +0100
+++ b/OrthancFramework/Sources/DicomFormat/DicomImageInformation.cpp	Mon Nov 09 15:22:43 2020 +0100
@@ -337,4 +337,10 @@
             GetBytesPerValue() *
             GetChannelCount());
   }
+
+
+  unsigned int DicomImageInformation::GetUsefulTagLength()
+  {
+    return 256;
+  }
 }
--- a/OrthancFramework/Sources/DicomFormat/DicomImageInformation.h	Mon Nov 09 15:07:55 2020 +0100
+++ b/OrthancFramework/Sources/DicomFormat/DicomImageInformation.h	Mon Nov 09 15:22:43 2020 +0100
@@ -29,18 +29,7 @@
 namespace Orthanc
 {
   class ORTHANC_PUBLIC DicomImageInformation
-  {
-  public:
-    /**
-     * This constant gives a bound on the maximum tag length that is
-     * useful to class "DicomImageInformation", in order to avoid
-     * using too much memory when copying DICOM tags from "DcmDataset"
-     * to "DicomMap" using "ExtractDicomSummary()". The value 256
-     * corresponds to ORTHANC_MAXIMUM_TAG_LENGTH that was implicitly
-     * used in Orthanc <= 1.7.2.
-     **/
-    static const unsigned int USEFUL_TAG_LENGTH = 256;
-  
+  {  
   private:
     unsigned int width_;
     unsigned int height_;
@@ -95,5 +84,15 @@
                             bool ignorePhotometricInterpretation) const;
 
     size_t GetFrameSize() const;
+
+    /**
+     * This constant gives a bound on the maximum tag length that is
+     * useful to class "DicomImageInformation", in order to avoid
+     * using too much memory when copying DICOM tags from "DcmDataset"
+     * to "DicomMap" using "ExtractDicomSummary()". It answers the
+     * value 256, which corresponds to ORTHANC_MAXIMUM_TAG_LENGTH that
+     * was implicitly used in Orthanc <= 1.7.2.
+     **/
+    static unsigned int GetUsefulTagLength();
   };
 }
--- a/OrthancFramework/Sources/DicomParsing/Internals/DicomFrameIndex.cpp	Mon Nov 09 15:07:55 2020 +0100
+++ b/OrthancFramework/Sources/DicomParsing/Internals/DicomFrameIndex.cpp	Mon Nov 09 15:22:43 2020 +0100
@@ -350,7 +350,7 @@
     // Extract information about the image structure
     DicomMap tags;
     std::set<DicomTag> ignoreTagLength;
-    FromDcmtkBridge::ExtractDicomSummary(tags, dicom, DicomImageInformation::USEFUL_TAG_LENGTH, ignoreTagLength);
+    FromDcmtkBridge::ExtractDicomSummary(tags, dicom, DicomImageInformation::GetUsefulTagLength(), ignoreTagLength);
 
     DicomImageInformation information(tags);
 
--- a/OrthancFramework/Sources/DicomParsing/Internals/DicomImageDecoder.cpp	Mon Nov 09 15:07:55 2020 +0100
+++ b/OrthancFramework/Sources/DicomParsing/Internals/DicomImageDecoder.cpp	Mon Nov 09 15:22:43 2020 +0100
@@ -252,7 +252,7 @@
 
       DicomMap m;
       std::set<DicomTag> ignoreTagLength;
-      FromDcmtkBridge::ExtractDicomSummary(m, dataset, DicomImageInformation::USEFUL_TAG_LENGTH, ignoreTagLength);
+      FromDcmtkBridge::ExtractDicomSummary(m, dataset, DicomImageInformation::GetUsefulTagLength(), ignoreTagLength);
 
       /**
        * Create an accessor to the raw values of the DICOM image.
@@ -325,7 +325,7 @@
   {
     DicomMap m;
     std::set<DicomTag> ignoreTagLength;
-    FromDcmtkBridge::ExtractDicomSummary(m, dataset, DicomImageInformation::USEFUL_TAG_LENGTH, ignoreTagLength);
+    FromDcmtkBridge::ExtractDicomSummary(m, dataset, DicomImageInformation::GetUsefulTagLength(), ignoreTagLength);
 
     DicomImageInformation info(m);
     PixelFormat format;
@@ -614,7 +614,7 @@
 
     DicomMap m;
     std::set<DicomTag> ignoreTagLength;
-    FromDcmtkBridge::ExtractDicomSummary(m, dataset, DicomImageInformation::USEFUL_TAG_LENGTH, ignoreTagLength);
+    FromDcmtkBridge::ExtractDicomSummary(m, dataset, DicomImageInformation::GetUsefulTagLength(), ignoreTagLength);
     DicomImageInformation info(m);
 
     std::unique_ptr<ImageAccessor> target(CreateImage(dataset, true));