changeset 1250:a8248b08115c broker

LoadedDicomResources::MergeResource()
author Sebastien Jodogne <s.jodogne@gmail.com>
date Tue, 07 Jan 2020 20:22:02 +0100
parents 964c89e15e7e
children 96d4f4fee5bb 6525c0f13a3a
files Framework/Loaders/DicomResourcesLoader.cpp Framework/Loaders/DicomResourcesLoader.h Framework/Loaders/LoadedDicomResources.cpp Framework/Loaders/LoadedDicomResources.h Framework/Loaders/SeriesMetadataLoader.cpp
diffstat 5 files changed, 42 insertions(+), 21 deletions(-) [+]
line wrap: on
line diff
--- a/Framework/Loaders/DicomResourcesLoader.cpp	Tue Jan 07 14:23:24 2020 +0100
+++ b/Framework/Loaders/DicomResourcesLoader.cpp	Tue Jan 07 20:22:02 2020 +0100
@@ -648,12 +648,12 @@
   }
   
   
-  void DicomResourcesLoader::ScheduleWado(boost::shared_ptr<LoadedDicomResources> target,
-                                          int priority,
-                                          const DicomSource& source,
-                                          const std::string& uri,
-                                          const std::set<Orthanc::DicomTag>& includeTags,
-                                          Orthanc::IDynamicObject* userPayload)
+  void DicomResourcesLoader::ScheduleGetDicomWeb(boost::shared_ptr<LoadedDicomResources> target,
+                                                 int priority,
+                                                 const DicomSource& source,
+                                                 const std::string& uri,
+                                                 const std::set<Orthanc::DicomTag>& includeTags,
+                                                 Orthanc::IDynamicObject* userPayload)
   {
     boost::shared_ptr<Orthanc::IDynamicObject> protection(userPayload);
     
--- a/Framework/Loaders/DicomResourcesLoader.h	Tue Jan 07 14:23:24 2020 +0100
+++ b/Framework/Loaders/DicomResourcesLoader.h	Tue Jan 07 20:22:02 2020 +0100
@@ -148,21 +148,21 @@
       virtual boost::shared_ptr<IObserver> Create(ILoadersContext::ILock& stone);
     };
 
-    void ScheduleWado(boost::shared_ptr<LoadedDicomResources> target,
-                      int priority,
-                      const DicomSource& source,
-                      const std::string& uri,
-                      const std::set<Orthanc::DicomTag>& includeTags,
-                      Orthanc::IDynamicObject* userPayload);
+    void ScheduleGetDicomWeb(boost::shared_ptr<LoadedDicomResources> target,
+                             int priority,
+                             const DicomSource& source,
+                             const std::string& uri,
+                             const std::set<Orthanc::DicomTag>& includeTags,
+                             Orthanc::IDynamicObject* userPayload);
 
-    void ScheduleWado(boost::shared_ptr<LoadedDicomResources> target,
-                      int priority,
-                      const DicomSource& source,
-                      const std::string& uri,
-                      Orthanc::IDynamicObject* userPayload)
+    void ScheduleGetDicomWeb(boost::shared_ptr<LoadedDicomResources> target,
+                             int priority,
+                             const DicomSource& source,
+                             const std::string& uri,
+                             Orthanc::IDynamicObject* userPayload)
     {
       std::set<Orthanc::DicomTag> includeTags;
-      ScheduleWado(target, priority, source, uri, includeTags, userPayload);
+      ScheduleGetDicomWeb(target, priority, source, uri, includeTags, userPayload);
     }        
 
     void ScheduleQido(boost::shared_ptr<LoadedDicomResources> target,
--- a/Framework/Loaders/LoadedDicomResources.cpp	Tue Jan 07 14:23:24 2020 +0100
+++ b/Framework/Loaders/LoadedDicomResources.cpp	Tue Jan 07 20:22:02 2020 +0100
@@ -100,6 +100,23 @@
   }
 
 
+  void LoadedDicomResources::MergeResource(Orthanc::DicomMap& target,
+                                           const std::string& id) const
+  {
+    Resources::const_iterator it = resources_.find(id);
+    
+    if (it == resources_.end())
+    {
+      throw Orthanc::OrthancException(Orthanc::ErrorCode_InexistentItem);
+    }
+    else
+    {
+      assert(it->second != NULL);
+      target.Merge(*it->second);
+    }
+  }
+  
+
   bool LoadedDicomResources::LookupStringValue(std::string& target,
                                                const std::string& id,
                                                const Orthanc::DicomTag& tag) const
--- a/Framework/Loaders/LoadedDicomResources.h	Tue Jan 07 14:23:24 2020 +0100
+++ b/Framework/Loaders/LoadedDicomResources.h	Tue Jan 07 20:22:02 2020 +0100
@@ -72,6 +72,9 @@
     {
       return resources_.find(id) != resources_.end();
     }
+
+    void MergeResource(Orthanc::DicomMap& target,
+                       const std::string& id) const;
   
     bool LookupStringValue(std::string& target,
                            const std::string& id,
--- a/Framework/Loaders/SeriesMetadataLoader.cpp	Tue Jan 07 14:23:24 2020 +0100
+++ b/Framework/Loaders/SeriesMetadataLoader.cpp	Tue Jan 07 20:22:02 2020 +0100
@@ -258,9 +258,10 @@
       {
         boost::shared_ptr<LoadedDicomResources> target
           (new LoadedDicomResources(Orthanc::DICOM_TAG_SOP_INSTANCE_UID));
-        loader_->ScheduleWado(target, priority, source,
-                              "/studies/" + studyInstanceUid + "/series/" + seriesInstanceUid + "/metadata",
-                              NULL /* TODO PAYLOAD */);
+        loader_->ScheduleGetDicomWeb(
+          target, priority, source,
+          "/studies/" + studyInstanceUid + "/series/" + seriesInstanceUid + "/metadata",
+          NULL /* TODO PAYLOAD */);
 
         scheduled_[seriesInstanceUid] = priority;
       }