changeset 3874:2effa961f67f transcoding

forcing use of DicomAssociationParameters if creating an SCU
author Sebastien Jodogne <s.jodogne@gmail.com>
date Thu, 30 Apr 2020 15:00:20 +0200
parents ae5bdde751fd
children ea1d32861cfc
files Core/DicomNetworking/DicomControlUserConnection.cpp Core/DicomNetworking/DicomControlUserConnection.h Core/DicomNetworking/DicomStoreUserConnection.cpp Core/DicomNetworking/DicomStoreUserConnection.h OrthancServer/OrthancMoveRequestHandler.cpp OrthancServer/OrthancRestApi/OrthancRestModalities.cpp OrthancServer/QueryRetrieveHandler.cpp OrthancServer/ServerJobs/DicomModalityStoreJob.cpp OrthancServer/ServerJobs/DicomMoveScuJob.cpp
diffstat 9 files changed, 31 insertions(+), 50 deletions(-) [+]
line wrap: on
line diff
--- a/Core/DicomNetworking/DicomControlUserConnection.cpp	Thu Apr 30 14:49:35 2020 +0200
+++ b/Core/DicomNetworking/DicomControlUserConnection.cpp	Thu Apr 30 15:00:20 2020 +0200
@@ -434,15 +434,6 @@
   }
     
 
-  DicomControlUserConnection::DicomControlUserConnection(const std::string& localAet,
-                                                         const RemoteModalityParameters& remote) :
-    parameters_(localAet, remote),
-    association_(new DicomAssociation)
-  {
-    SetupPresentationContexts();
-  }
-    
-
   void DicomControlUserConnection::Close()
   {
     assert(association_.get() != NULL);
--- a/Core/DicomNetworking/DicomControlUserConnection.h	Thu Apr 30 14:49:35 2020 +0200
+++ b/Core/DicomNetworking/DicomControlUserConnection.h	Thu Apr 30 15:00:20 2020 +0200
@@ -65,9 +65,6 @@
                       const DicomMap& fields);
     
   public:
-    DicomControlUserConnection(const std::string& localAet,
-                               const RemoteModalityParameters& remote);
-    
     DicomControlUserConnection(const DicomAssociationParameters& params);
     
     const DicomAssociationParameters& GetParameters() const
--- a/Core/DicomNetworking/DicomStoreUserConnection.cpp	Thu Apr 30 14:49:35 2020 +0200
+++ b/Core/DicomNetworking/DicomStoreUserConnection.cpp	Thu Apr 30 15:00:20 2020 +0200
@@ -139,29 +139,14 @@
   }
 
 
-  void DicomStoreUserConnection::Setup()
-  {
-    association_.reset(new DicomAssociation);
-    proposeCommonClasses_ = true;
-    proposeUncompressedSyntaxes_ = true;
-    proposeRetiredBigEndian_ = false;
-  }
-    
-        
-  DicomStoreUserConnection::DicomStoreUserConnection(
-    const std::string& localAet,
-    const RemoteModalityParameters& remote) :
-    parameters_(localAet, remote)
-  {
-    Setup();
-  }
-  
-
   DicomStoreUserConnection::DicomStoreUserConnection(
     const DicomAssociationParameters& params) :
-    parameters_(params)
+    parameters_(params),
+    association_(new DicomAssociation),
+    proposeCommonClasses_(true),
+    proposeUncompressedSyntaxes_(true),
+    proposeRetiredBigEndian_(false)
   {
-    Setup();
   }
     
 
--- a/Core/DicomNetworking/DicomStoreUserConnection.h	Thu Apr 30 14:49:35 2020 +0200
+++ b/Core/DicomNetworking/DicomStoreUserConnection.h	Thu Apr 30 15:00:20 2020 +0200
@@ -78,16 +78,11 @@
     bool                                 proposeUncompressedSyntaxes_;
     bool                                 proposeRetiredBigEndian_;
 
-    void Setup();
-
     // Return "false" if there is not enough room remaining in the association
     bool ProposeStorageClass(const std::string& sopClassUid,
                              const std::set<DicomTransferSyntax>& syntaxes);
 
   public:
-    DicomStoreUserConnection(const std::string& localAet,
-                             const RemoteModalityParameters& remote);
-    
     DicomStoreUserConnection(const DicomAssociationParameters& params);
     
     const DicomAssociationParameters& GetParameters() const
--- a/OrthancServer/OrthancMoveRequestHandler.cpp	Thu Apr 30 14:49:35 2020 +0200
+++ b/OrthancServer/OrthancMoveRequestHandler.cpp	Thu Apr 30 15:00:20 2020 +0200
@@ -113,7 +113,8 @@
 
         if (connection_.get() == NULL)
         {
-          connection_.reset(new DicomStoreUserConnection(localAet_, remote_));
+          DicomAssociationParameters params(localAet_, remote_);
+          connection_.reset(new DicomStoreUserConnection(params));
         }
 
         std::string sopClassUid, sopInstanceUid;  // Unused
--- a/OrthancServer/OrthancRestApi/OrthancRestModalities.cpp	Thu Apr 30 14:49:35 2020 +0200
+++ b/OrthancServer/OrthancRestApi/OrthancRestModalities.cpp	Thu Apr 30 15:00:20 2020 +0200
@@ -86,7 +86,8 @@
 
     try
     {
-      DicomControlUserConnection connection(localAet, remote);
+      DicomAssociationParameters params(localAet, remote);
+      DicomControlUserConnection connection(params);
 
       // New in Orthanc 1.7.0
       if (timeout != -1)
@@ -214,7 +215,8 @@
     DicomFindAnswers answers(false);
 
     {
-      DicomControlUserConnection connection(localAet, remote);
+      DicomAssociationParameters params(localAet, remote);
+      DicomControlUserConnection connection(params);
       FindPatient(answers, connection, fields);
     }
 
@@ -248,7 +250,8 @@
     DicomFindAnswers answers(false);
 
     {
-      DicomControlUserConnection connection(localAet, remote);
+      DicomAssociationParameters params(localAet, remote);
+      DicomControlUserConnection connection(params);
       FindStudy(answers, connection, fields);
     }
 
@@ -283,7 +286,8 @@
     DicomFindAnswers answers(false);
 
     {
-      DicomControlUserConnection connection(localAet, remote);
+      DicomAssociationParameters params(localAet, remote);
+      DicomControlUserConnection connection(params);
       FindSeries(answers, connection, fields);
     }
 
@@ -319,7 +323,8 @@
     DicomFindAnswers answers(false);
 
     {
-      DicomControlUserConnection connection(localAet, remote);
+      DicomAssociationParameters params(localAet, remote);
+      DicomControlUserConnection connection(params);
       FindInstance(answers, connection, fields);
     }
 
@@ -357,7 +362,8 @@
     RemoteModalityParameters remote =
       MyGetModalityUsingSymbolicName(call.GetUriComponent("id", ""));
 
-    DicomControlUserConnection connection(localAet, remote);
+    DicomAssociationParameters params(localAet, remote);
+    DicomControlUserConnection connection(params);
     
     DicomFindAnswers patients(false);
     FindPatient(patients, connection, m);
@@ -1006,7 +1012,8 @@
     RemoteModalityParameters remote =
       MyGetModalityUsingSymbolicName(call.GetUriComponent("id", ""));
 
-    DicomStoreUserConnection connection(localAet, remote);
+    DicomAssociationParameters params(localAet, remote);
+    DicomStoreUserConnection connection(params);
 
     std::string sopClassUid, sopInstanceUid;
     connection.Store(sopClassUid, sopInstanceUid,
@@ -1053,7 +1060,8 @@
     const RemoteModalityParameters source =
       MyGetModalityUsingSymbolicName(call.GetUriComponent("id", ""));
 
-    DicomControlUserConnection connection(localAet, source);
+    DicomAssociationParameters params(localAet, source);
+    DicomControlUserConnection connection(params);
 
     if (timeout > -1)
     {
@@ -1341,7 +1349,8 @@
       DicomFindAnswers answers(true);
 
       {
-        DicomControlUserConnection connection(localAet, remote);
+        DicomAssociationParameters params(localAet, remote);
+        DicomControlUserConnection connection(params);
         connection.FindWorklist(answers, *query);
       }
 
--- a/OrthancServer/QueryRetrieveHandler.cpp	Thu Apr 30 14:49:35 2020 +0200
+++ b/OrthancServer/QueryRetrieveHandler.cpp	Thu Apr 30 15:00:20 2020 +0200
@@ -82,7 +82,8 @@
       FixQueryLua(fixed, context_, modality_.GetApplicationEntityTitle()); 
 
       {
-        DicomControlUserConnection connection(localAet_, modality_);
+        DicomAssociationParameters params(localAet_, modality_);
+        DicomControlUserConnection connection(params);
         connection.Find(answers_, level_, fixed, findNormalized_);
       }
 
--- a/OrthancServer/ServerJobs/DicomModalityStoreJob.cpp	Thu Apr 30 14:49:35 2020 +0200
+++ b/OrthancServer/ServerJobs/DicomModalityStoreJob.cpp	Thu Apr 30 15:00:20 2020 +0200
@@ -48,7 +48,8 @@
   {
     if (connection_.get() == NULL)
     {
-      connection_.reset(new DicomStoreUserConnection(localAet_, remote_));
+      DicomAssociationParameters params(localAet_, remote_);
+      connection_.reset(new DicomStoreUserConnection(params));
 
       if (timeout_ > -1)
       {
--- a/OrthancServer/ServerJobs/DicomMoveScuJob.cpp	Thu Apr 30 14:49:35 2020 +0200
+++ b/OrthancServer/ServerJobs/DicomMoveScuJob.cpp	Thu Apr 30 15:00:20 2020 +0200
@@ -97,7 +97,8 @@
   {
     if (connection_.get() == NULL)
     {
-      connection_.reset(new DicomControlUserConnection(localAet_, remote_));
+      DicomAssociationParameters params(localAet_, remote_);
+      connection_.reset(new DicomControlUserConnection(params));
     }
     
     if (timeout_ > -1)