changeset 4137:6774605d4341

keep only one signature for FromDcmtkBridge::ExtractDicomSummary()
author Sebastien Jodogne <s.jodogne@gmail.com>
date Thu, 06 Aug 2020 17:38:55 +0200
parents 2724977419fb
children 1a26daefc3fe
files OrthancFramework/Sources/DicomNetworking/DicomControlUserConnection.cpp OrthancFramework/Sources/DicomNetworking/Internals/FindScp.cpp OrthancFramework/Sources/DicomNetworking/Internals/GetScp.cpp OrthancFramework/Sources/DicomNetworking/Internals/MoveScp.cpp OrthancFramework/Sources/DicomNetworking/Internals/StoreScp.cpp OrthancFramework/Sources/DicomParsing/FromDcmtkBridge.cpp OrthancFramework/Sources/DicomParsing/FromDcmtkBridge.h OrthancFramework/Sources/DicomParsing/Internals/DicomFrameIndex.cpp OrthancFramework/Sources/DicomParsing/Internals/DicomImageDecoder.cpp OrthancFramework/Sources/DicomParsing/ParsedDicomDir.cpp OrthancFramework/Sources/DicomParsing/ParsedDicomFile.cpp OrthancServer/Sources/DicomInstanceToStore.cpp
diffstat 12 files changed, 27 insertions(+), 39 deletions(-) [+]
line wrap: on
line diff
--- a/OrthancFramework/Sources/DicomNetworking/DicomControlUserConnection.cpp	Thu Aug 06 15:55:03 2020 +0200
+++ b/OrthancFramework/Sources/DicomNetworking/DicomControlUserConnection.cpp	Thu Aug 06 17:38:55 2020 +0200
@@ -82,7 +82,8 @@
       else
       {
         DicomMap m;
-        FromDcmtkBridge::ExtractDicomSummary(m, *responseIdentifiers, 0 /* don't truncate tags */);
+        std::set<DicomTag> ignoreTagLength;
+        FromDcmtkBridge::ExtractDicomSummary(m, *responseIdentifiers, 0 /* don't truncate tags */, ignoreTagLength);
         
         if (!m.HasTag(DICOM_TAG_QUERY_RETRIEVE_LEVEL))
         {
--- a/OrthancFramework/Sources/DicomNetworking/Internals/FindScp.cpp	Thu Aug 06 15:55:03 2020 +0200
+++ b/OrthancFramework/Sources/DicomNetworking/Internals/FindScp.cpp	Thu Aug 06 17:38:55 2020 +0200
@@ -265,7 +265,8 @@
               }
 
               DicomMap input;
-              FromDcmtkBridge::ExtractDicomSummary(input, *requestIdentifiers, 0 /* don't truncate tags */);
+              std::set<DicomTag> ignoreTagLength;
+              FromDcmtkBridge::ExtractDicomSummary(input, *requestIdentifiers, 0 /* don't truncate tags */, ignoreTagLength);
 
               DicomMap filtered;
               FixFindQuery(filtered, input);
--- a/OrthancFramework/Sources/DicomNetworking/Internals/GetScp.cpp	Thu Aug 06 15:55:03 2020 +0200
+++ b/OrthancFramework/Sources/DicomNetworking/Internals/GetScp.cpp	Thu Aug 06 17:38:55 2020 +0200
@@ -148,7 +148,8 @@
       if (data.lastRequest_ == NULL)
       {
         DicomMap input;
-        FromDcmtkBridge::ExtractDicomSummary(input, *requestIdentifiers, 0 /* don't truncate tags */);
+        std::set<DicomTag> ignoreTagLength;
+        FromDcmtkBridge::ExtractDicomSummary(input, *requestIdentifiers, 0 /* don't truncate tags */, ignoreTagLength);
 
         try
         {
--- a/OrthancFramework/Sources/DicomNetworking/Internals/MoveScp.cpp	Thu Aug 06 15:55:03 2020 +0200
+++ b/OrthancFramework/Sources/DicomNetworking/Internals/MoveScp.cpp	Thu Aug 06 17:38:55 2020 +0200
@@ -166,7 +166,8 @@
       if (data.lastRequest_ == NULL)
       {
         DicomMap input;
-        FromDcmtkBridge::ExtractDicomSummary(input, *requestIdentifiers, 0 /* don't truncate tags */);
+        std::set<DicomTag> ignoreTagLength;
+        FromDcmtkBridge::ExtractDicomSummary(input, *requestIdentifiers, 0 /* don't truncate tags */, ignoreTagLength);
 
         try
         {
--- a/OrthancFramework/Sources/DicomNetworking/Internals/StoreScp.cpp	Thu Aug 06 15:55:03 2020 +0200
+++ b/OrthancFramework/Sources/DicomNetworking/Internals/StoreScp.cpp	Thu Aug 06 17:38:55 2020 +0200
@@ -162,7 +162,7 @@
           {
             std::set<DicomTag> ignoreTagLength;
             
-            FromDcmtkBridge::ExtractDicomSummary(summary, **imageDataSet, 0 /* don't truncate tags */);
+            FromDcmtkBridge::ExtractDicomSummary(summary, **imageDataSet, ORTHANC_MAXIMUM_TAG_LENGTH, ignoreTagLength);
             FromDcmtkBridge::ExtractDicomAsJson(dicomJson, **imageDataSet, ignoreTagLength);
 
             if (!FromDcmtkBridge::SaveToMemoryBuffer(buffer, **imageDataSet))
--- a/OrthancFramework/Sources/DicomParsing/FromDcmtkBridge.cpp	Thu Aug 06 15:55:03 2020 +0200
+++ b/OrthancFramework/Sources/DicomParsing/FromDcmtkBridge.cpp	Thu Aug 06 17:38:55 2020 +0200
@@ -470,9 +470,10 @@
   void FromDcmtkBridge::ExtractDicomSummary(DicomMap& target, 
                                             DcmItem& dataset,
                                             unsigned int maxStringLength,
-                                            Encoding defaultEncoding,
                                             const std::set<DicomTag>& ignoreTagLength)
   {
+    const Encoding defaultEncoding = GetDefaultDicomEncoding();
+    
     bool hasCodeExtensions;
     Encoding encoding = DetectEncoding(hasCodeExtensions, dataset, defaultEncoding);
 
@@ -2036,16 +2037,6 @@
   }
 
 
-  void FromDcmtkBridge::ExtractDicomSummary(DicomMap& target, 
-                                            DcmItem& dataset,
-                                            unsigned int maxStringLength,
-                                            const std::set<DicomTag>& ignoreTagLength)
-  {
-    ExtractDicomSummary(target, dataset, maxStringLength,
-                        GetDefaultDicomEncoding(), ignoreTagLength);
-  }
-
-  
   void FromDcmtkBridge::ExtractDicomAsJson(Json::Value& target, 
                                            DcmDataset& dataset,
                                            const std::set<DicomTag>& ignoreTagLength)
--- a/OrthancFramework/Sources/DicomParsing/FromDcmtkBridge.h	Thu Aug 06 15:55:03 2020 +0200
+++ b/OrthancFramework/Sources/DicomParsing/FromDcmtkBridge.h	Thu Aug 06 17:38:55 2020 +0200
@@ -62,12 +62,6 @@
   private:
     FromDcmtkBridge();  // Pure static class
 
-    static void ExtractDicomSummary(DicomMap& target, 
-                                    DcmItem& dataset,
-                                    unsigned int maxStringLength,
-                                    Encoding defaultEncoding,
-                                    const std::set<DicomTag>& ignoreTagLength);
-
     static void DatasetToJson(Json::Value& parent,
                               DcmItem& item,
                               DicomToJsonFormat format,
@@ -230,14 +224,6 @@
                                     unsigned int maxStringLength,
                                     const std::set<DicomTag>& ignoreTagLength);
 
-    static void ExtractDicomSummary(DicomMap& target, 
-                                    DcmItem& dataset,
-                                    unsigned int maxStringLength)
-    {
-      std::set<DicomTag> none;
-      ExtractDicomSummary(target, dataset, maxStringLength, none);
-    }
-
     static void ExtractDicomAsJson(Json::Value& target, 
                                    DcmDataset& dataset,
                                    const std::set<DicomTag>& ignoreTagLength);
--- a/OrthancFramework/Sources/DicomParsing/Internals/DicomFrameIndex.cpp	Thu Aug 06 15:55:03 2020 +0200
+++ b/OrthancFramework/Sources/DicomParsing/Internals/DicomFrameIndex.cpp	Thu Aug 06 17:38:55 2020 +0200
@@ -357,7 +357,8 @@
 
     // Extract information about the image structure
     DicomMap tags;
-    FromDcmtkBridge::ExtractDicomSummary(tags, dicom, 0 /* don't truncate tags */);
+    std::set<DicomTag> ignoreTagLength;
+    FromDcmtkBridge::ExtractDicomSummary(tags, dicom, ORTHANC_MAXIMUM_TAG_LENGTH, ignoreTagLength);
 
     DicomImageInformation information(tags);
 
--- a/OrthancFramework/Sources/DicomParsing/Internals/DicomImageDecoder.cpp	Thu Aug 06 15:55:03 2020 +0200
+++ b/OrthancFramework/Sources/DicomParsing/Internals/DicomImageDecoder.cpp	Thu Aug 06 17:38:55 2020 +0200
@@ -250,7 +250,8 @@
       // See also: http://support.dcmtk.org/wiki/dcmtk/howto/accessing-compressed-data
 
       DicomMap m;
-      FromDcmtkBridge::ExtractDicomSummary(m, dataset, 0 /* don't truncate tags */);
+      std::set<DicomTag> ignoreTagLength;
+      FromDcmtkBridge::ExtractDicomSummary(m, dataset, ORTHANC_MAXIMUM_TAG_LENGTH, ignoreTagLength);
 
       /**
        * Create an accessor to the raw values of the DICOM image.
@@ -322,7 +323,8 @@
                                                 bool ignorePhotometricInterpretation)
   {
     DicomMap m;
-    FromDcmtkBridge::ExtractDicomSummary(m, dataset, 0 /* don't truncate tags */);
+    std::set<DicomTag> ignoreTagLength;
+    FromDcmtkBridge::ExtractDicomSummary(m, dataset, ORTHANC_MAXIMUM_TAG_LENGTH, ignoreTagLength);
 
     DicomImageInformation info(m);
     PixelFormat format;
@@ -602,7 +604,8 @@
     }
 
     DicomMap m;
-    FromDcmtkBridge::ExtractDicomSummary(m, dataset, 0 /* don't truncate tags */);
+    std::set<DicomTag> ignoreTagLength;
+    FromDcmtkBridge::ExtractDicomSummary(m, dataset, ORTHANC_MAXIMUM_TAG_LENGTH, ignoreTagLength);
     DicomImageInformation info(m);
 
     std::unique_ptr<ImageAccessor> target(CreateImage(dataset, true));
--- a/OrthancFramework/Sources/DicomParsing/ParsedDicomDir.cpp	Thu Aug 06 15:55:03 2020 +0200
+++ b/OrthancFramework/Sources/DicomParsing/ParsedDicomDir.cpp	Thu Aug 06 17:38:55 2020 +0200
@@ -110,7 +110,9 @@
       lowerOffsets_[i] = lower;
 
       std::unique_ptr<DicomMap> entry(new DicomMap);
-      FromDcmtkBridge::ExtractDicomSummary(*entry, *item, 0 /* don't truncate tags */);
+
+      std::set<DicomTag> ignoreTagLength;
+      FromDcmtkBridge::ExtractDicomSummary(*entry, *item, 0 /* don't truncate tags */, ignoreTagLength);
 
       if (next != 0)
       {
--- a/OrthancFramework/Sources/DicomParsing/ParsedDicomFile.cpp	Thu Aug 06 15:55:03 2020 +0200
+++ b/OrthancFramework/Sources/DicomParsing/ParsedDicomFile.cpp	Thu Aug 06 17:38:55 2020 +0200
@@ -1657,7 +1657,9 @@
 
   void ParsedDicomFile::ExtractDicomSummary(DicomMap& target) const
   {
-    FromDcmtkBridge::ExtractDicomSummary(target, *GetDcmtkObject().getDataset(), ORTHANC_MAXIMUM_TAG_LENGTH);
+    std::set<DicomTag> ignoreTagLength;
+    FromDcmtkBridge::ExtractDicomSummary(target, *GetDcmtkObject().getDataset(),
+                                         ORTHANC_MAXIMUM_TAG_LENGTH, ignoreTagLength);
   }
 
 
--- a/OrthancServer/Sources/DicomInstanceToStore.cpp	Thu Aug 06 15:55:03 2020 +0200
+++ b/OrthancServer/Sources/DicomInstanceToStore.cpp	Thu Aug 06 17:38:55 2020 +0200
@@ -241,20 +241,19 @@
       assert(parsed_.HasContent());
 
       // At this point, we have parsed the DICOM file
+      std::set<DicomTag> ignoreTagLength;
     
       if (!summary_.HasContent())
       {
         summary_.Allocate();
         FromDcmtkBridge::ExtractDicomSummary(summary_.GetContent(), 
                                              *parsed_.GetContent().GetDcmtkObject().getDataset(),
-                                             ORTHANC_MAXIMUM_TAG_LENGTH);
+                                             ORTHANC_MAXIMUM_TAG_LENGTH, ignoreTagLength);
       }
     
       if (!json_.HasContent())
       {
         json_.Allocate();
-
-        std::set<DicomTag> ignoreTagLength;
         FromDcmtkBridge::ExtractDicomAsJson(json_.GetContent(), 
                                             *parsed_.GetContent().GetDcmtkObject().getDataset(),
                                             ignoreTagLength);