changeset 2125:b9bd52c72ba2

cleaning up
author Sebastien Jodogne <s.jodogne@gmail.com>
date Mon, 07 Nov 2016 12:38:09 +0100
parents 2b1520efa282
children 03b065778fc3
files OrthancServer/DicomInstanceToStore.cpp OrthancServer/DicomProtocol/DicomUserConnection.cpp OrthancServer/FromDcmtkBridge.cpp OrthancServer/FromDcmtkBridge.h OrthancServer/Internals/DicomFrameIndex.cpp OrthancServer/Internals/DicomImageDecoder.cpp OrthancServer/Internals/FindScp.cpp OrthancServer/Internals/MoveScp.cpp OrthancServer/Internals/StoreScp.cpp OrthancServer/ParsedDicomFile.cpp
diffstat 10 files changed, 31 insertions(+), 34 deletions(-) [+]
line wrap: on
line diff
--- a/OrthancServer/DicomInstanceToStore.cpp	Mon Nov 07 12:11:34 2016 +0100
+++ b/OrthancServer/DicomInstanceToStore.cpp	Mon Nov 07 12:38:09 2016 +0100
@@ -104,10 +104,8 @@
     if (!summary_.HasContent())
     {
       summary_.Allocate();
-      FromDcmtkBridge::Convert(summary_.GetContent(), 
-                               *parsed_.GetContent().GetDcmtkObject().getDataset(),
-                               ORTHANC_MAXIMUM_TAG_LENGTH,                               
-                               Configuration::GetDefaultEncoding());
+      FromDcmtkBridge::ExtractDicomSummary(summary_.GetContent(), 
+                                           *parsed_.GetContent().GetDcmtkObject().getDataset());
     }
     
     if (!json_.HasContent())
--- a/OrthancServer/DicomProtocol/DicomUserConnection.cpp	Mon Nov 07 12:11:34 2016 +0100
+++ b/OrthancServer/DicomProtocol/DicomUserConnection.cpp	Mon Nov 07 12:38:09 2016 +0100
@@ -398,9 +398,7 @@
       else
       {
         DicomMap m;
-        FromDcmtkBridge::Convert(m, *responseIdentifiers, 
-                                 ORTHANC_MAXIMUM_TAG_LENGTH,
-                                 Configuration::GetDefaultEncoding());
+        FromDcmtkBridge::ExtractDicomSummary(m, *responseIdentifiers);
 
         if (!m.HasTag(DICOM_TAG_QUERY_RETRIEVE_LEVEL))
         {
--- a/OrthancServer/FromDcmtkBridge.cpp	Mon Nov 07 12:11:34 2016 +0100
+++ b/OrthancServer/FromDcmtkBridge.cpp	Mon Nov 07 12:38:09 2016 +0100
@@ -363,10 +363,10 @@
   }
 
 
-  void FromDcmtkBridge::Convert(DicomMap& target, 
-                                DcmItem& dataset,
-                                unsigned int maxStringLength,
-                                Encoding defaultEncoding)
+  void FromDcmtkBridge::ExtractDicomSummary(DicomMap& target, 
+                                            DcmItem& dataset,
+                                            unsigned int maxStringLength,
+                                            Encoding defaultEncoding)
   {
     Encoding encoding = DetectEncoding(dataset, defaultEncoding);
 
--- a/OrthancServer/FromDcmtkBridge.h	Mon Nov 07 12:11:34 2016 +0100
+++ b/OrthancServer/FromDcmtkBridge.h	Mon Nov 07 12:38:09 2016 +0100
@@ -33,6 +33,7 @@
 #pragma once
 
 #include "ServerEnumerations.h"
+#include "OrthancInitialization.h"
 
 #include "../Core/DicomFormat/DicomElement.h"
 #include "../Core/DicomFormat/DicomMap.h"
@@ -45,8 +46,16 @@
 
 namespace Orthanc
 {
-  class FromDcmtkBridge
+  class FromDcmtkBridge : public boost::noncopyable
   {
+  private:
+    FromDcmtkBridge();  // Pure static class
+
+    static void ExtractDicomSummary(DicomMap& target, 
+                                    DcmItem& dataset,
+                                    unsigned int maxStringLength,
+                                    Encoding defaultEncoding);
+
   public:
     static void InitializeDictionary();
 
@@ -60,10 +69,11 @@
     static Encoding DetectEncoding(DcmItem& dataset,
                                    Encoding defaultEncoding);
 
-    static void Convert(DicomMap& target, 
-                        DcmItem& dataset,
-                        unsigned int maxStringLength,
-                        Encoding defaultEncoding);
+    static void ExtractDicomSummary(DicomMap& target, 
+                                    DcmItem& dataset)
+    {
+      ExtractDicomSummary(target, dataset, ORTHANC_MAXIMUM_TAG_LENGTH, Configuration::GetDefaultEncoding());
+    }
 
     static DicomTag Convert(const DcmTag& tag);
 
--- a/OrthancServer/Internals/DicomFrameIndex.cpp	Mon Nov 07 12:11:34 2016 +0100
+++ b/OrthancServer/Internals/DicomFrameIndex.cpp	Mon Nov 07 12:38:09 2016 +0100
@@ -404,8 +404,7 @@
 
     // Extract information about the image structure
     DicomMap tags;
-    FromDcmtkBridge::Convert(tags, dataset, ORTHANC_MAXIMUM_TAG_LENGTH,
-                             Configuration::GetDefaultEncoding());
+    FromDcmtkBridge::ExtractDicomSummary(tags, dataset);
 
     DicomImageInformation information(tags);
 
--- a/OrthancServer/Internals/DicomImageDecoder.cpp	Mon Nov 07 12:11:34 2016 +0100
+++ b/OrthancServer/Internals/DicomImageDecoder.cpp	Mon Nov 07 12:38:09 2016 +0100
@@ -250,8 +250,7 @@
       // See also: http://support.dcmtk.org/wiki/dcmtk/howto/accessing-compressed-data
 
       DicomMap m;
-      FromDcmtkBridge::Convert(m, dataset, ORTHANC_MAXIMUM_TAG_LENGTH,
-                               Configuration::GetDefaultEncoding());
+      FromDcmtkBridge::ExtractDicomSummary(m, dataset);
 
       /**
        * Create an accessor to the raw values of the DICOM image.
@@ -323,8 +322,7 @@
                                                 bool ignorePhotometricInterpretation)
   {
     DicomMap m;
-    FromDcmtkBridge::Convert(m, dataset, ORTHANC_MAXIMUM_TAG_LENGTH,
-                             Configuration::GetDefaultEncoding());
+    FromDcmtkBridge::ExtractDicomSummary(m, dataset);
 
     DicomImageInformation info(m);
     PixelFormat format;
--- a/OrthancServer/Internals/FindScp.cpp	Mon Nov 07 12:11:34 2016 +0100
+++ b/OrthancServer/Internals/FindScp.cpp	Mon Nov 07 12:38:09 2016 +0100
@@ -179,8 +179,8 @@
               }
 
               DicomMap input;
-              FromDcmtkBridge::Convert(input, *requestIdentifiers, ORTHANC_MAXIMUM_TAG_LENGTH,
-                                       Configuration::GetDefaultEncoding());
+              FromDcmtkBridge::ExtractDicomSummary(input, *requestIdentifiers);
+
               data.findHandler_->Handle(data.answers_, input, sequencesToReturn,
                                         *data.remoteIp_, *data.remoteAet_,
                                         *data.calledAet_);
--- a/OrthancServer/Internals/MoveScp.cpp	Mon Nov 07 12:11:34 2016 +0100
+++ b/OrthancServer/Internals/MoveScp.cpp	Mon Nov 07 12:38:09 2016 +0100
@@ -130,8 +130,7 @@
       if (data.lastRequest_ == NULL)
       {
         DicomMap input;
-        FromDcmtkBridge::Convert(input, *requestIdentifiers, ORTHANC_MAXIMUM_TAG_LENGTH,
-                                 Configuration::GetDefaultEncoding());
+        FromDcmtkBridge::ExtractDicomSummary(input, *requestIdentifiers);
 
         try
         {
--- a/OrthancServer/Internals/StoreScp.cpp	Mon Nov 07 12:11:34 2016 +0100
+++ b/OrthancServer/Internals/StoreScp.cpp	Mon Nov 07 12:38:09 2016 +0100
@@ -168,15 +168,12 @@
 
           try
           {
-            const Encoding defaultEncoding = Configuration::GetDefaultEncoding();
-            FromDcmtkBridge::Convert(summary, **imageDataSet, 
-                                     ORTHANC_MAXIMUM_TAG_LENGTH,
-                                     defaultEncoding);
+            FromDcmtkBridge::ExtractDicomSummary(summary, **imageDataSet);
             FromDcmtkBridge::ToJson(dicomJson, **imageDataSet,
                                     DicomToJsonFormat_Full, 
                                     DicomToJsonFlags_Default, 
                                     ORTHANC_MAXIMUM_TAG_LENGTH,
-                                    defaultEncoding);
+                                    Configuration::GetDefaultEncoding());
 
             if (!FromDcmtkBridge::SaveToMemoryBuffer(buffer, **imageDataSet))
             {
--- a/OrthancServer/ParsedDicomFile.cpp	Mon Nov 07 12:11:34 2016 +0100
+++ b/OrthancServer/ParsedDicomFile.cpp	Mon Nov 07 12:38:09 2016 +0100
@@ -1258,9 +1258,7 @@
 
   void ParsedDicomFile::Convert(DicomMap& tags)
   {
-    FromDcmtkBridge::Convert(tags, *pimpl_->file_->getDataset(), 
-                             ORTHANC_MAXIMUM_TAG_LENGTH, 
-                             Configuration::GetDefaultEncoding());
+    FromDcmtkBridge::ExtractDicomSummary(tags, *pimpl_->file_->getDataset());
   }