changeset 3577:33cfcc74d1b1

argument "ignoreTagLength" to ParsedDicomFile::ExtractDicomSummary()
author Sebastien Jodogne <s.jodogne@gmail.com>
date Tue, 19 Nov 2019 17:26:02 +0100
parents 1d403ecf3391
children 8e9e0739d3e8
files Core/DicomParsing/FromDcmtkBridge.cpp Core/DicomParsing/FromDcmtkBridge.h Core/DicomParsing/ParsedDicomFile.cpp Core/DicomParsing/ParsedDicomFile.h
diffstat 4 files changed, 26 insertions(+), 7 deletions(-) [+]
line wrap: on
line diff
--- a/Core/DicomParsing/FromDcmtkBridge.cpp	Sun Nov 17 17:58:14 2019 +0100
+++ b/Core/DicomParsing/FromDcmtkBridge.cpp	Tue Nov 19 17:26:02 2019 +0100
@@ -456,10 +456,9 @@
   void FromDcmtkBridge::ExtractDicomSummary(DicomMap& target, 
                                             DcmItem& dataset,
                                             unsigned int maxStringLength,
-                                            Encoding defaultEncoding)
+                                            Encoding defaultEncoding,
+                                            const std::set<DicomTag>& ignoreTagLength)
   {
-    std::set<DicomTag> ignoreTagLength;
-
     bool hasCodeExtensions;
     Encoding encoding = DetectEncoding(hasCodeExtensions, dataset, defaultEncoding);
 
@@ -2148,11 +2147,12 @@
 
 
   void FromDcmtkBridge::ExtractDicomSummary(DicomMap& target, 
-                                            DcmItem& dataset)
+                                            DcmItem& dataset,
+                                            const std::set<DicomTag>& ignoreTagLength)
   {
     ExtractDicomSummary(target, dataset,
                         ORTHANC_MAXIMUM_TAG_LENGTH,
-                        GetDefaultDicomEncoding());
+                        GetDefaultDicomEncoding(), ignoreTagLength);
   }
 
   
--- a/Core/DicomParsing/FromDcmtkBridge.h	Sun Nov 17 17:58:14 2019 +0100
+++ b/Core/DicomParsing/FromDcmtkBridge.h	Tue Nov 19 17:26:02 2019 +0100
@@ -84,7 +84,8 @@
     static void ExtractDicomSummary(DicomMap& target, 
                                     DcmItem& dataset,
                                     unsigned int maxStringLength,
-                                    Encoding defaultEncoding);
+                                    Encoding defaultEncoding,
+                                    const std::set<DicomTag>& ignoreTagLength);
 
     static void DatasetToJson(Json::Value& parent,
                               DcmItem& item,
@@ -245,7 +246,15 @@
 #endif
 
     static void ExtractDicomSummary(DicomMap& target, 
-                                    DcmItem& dataset);
+                                    DcmItem& dataset,
+                                    const std::set<DicomTag>& ignoreTagLength);
+
+    static void ExtractDicomSummary(DicomMap& target, 
+                                    DcmItem& dataset)
+    {
+      std::set<DicomTag> none;
+      ExtractDicomSummary(target, dataset, none);
+    }
 
     static void ExtractDicomAsJson(Json::Value& target, 
                                    DcmDataset& dataset,
--- a/Core/DicomParsing/ParsedDicomFile.cpp	Sun Nov 17 17:58:14 2019 +0100
+++ b/Core/DicomParsing/ParsedDicomFile.cpp	Tue Nov 19 17:26:02 2019 +0100
@@ -1581,6 +1581,13 @@
   }
 
 
+  void ParsedDicomFile::ExtractDicomSummary(DicomMap& target,
+                                            const std::set<DicomTag>& ignoreTagLength) const
+  {
+    FromDcmtkBridge::ExtractDicomSummary(target, *pimpl_->file_->getDataset(), ignoreTagLength);
+  }
+
+
   bool ParsedDicomFile::LookupTransferSyntax(std::string& result)
   {
     return FromDcmtkBridge::LookupTransferSyntax(result, *pimpl_->file_);
--- a/Core/DicomParsing/ParsedDicomFile.h	Sun Nov 17 17:58:14 2019 +0100
+++ b/Core/DicomParsing/ParsedDicomFile.h	Tue Nov 19 17:26:02 2019 +0100
@@ -240,6 +240,9 @@
 
     void ExtractDicomSummary(DicomMap& target) const;
 
+    void ExtractDicomSummary(DicomMap& target,
+                             const std::set<DicomTag>& ignoreTagLength) const;
+
     bool LookupTransferSyntax(std::string& result);
 
     bool LookupPhotometricInterpretation(PhotometricInterpretation& result) const;