diff Framework/Loaders/LoaderCache.cpp @ 1438:96044a18b98d

DicomStructureSetLoader instances are now indexed by their instanceid AND a uniquekey that is passed (*not* depending on the initially visible structures anymore)
author Benjamin Golinvaux <bgo@osimis.io>
date Tue, 19 May 2020 15:29:47 +0200
parents 998697c5ec74
children 4e233e3ea53b
line wrap: on
line diff
--- a/Framework/Loaders/LoaderCache.cpp	Tue May 19 15:28:55 2020 +0200
+++ b/Framework/Loaders/LoaderCache.cpp	Tue May 19 15:29:47 2020 +0200
@@ -187,21 +187,25 @@
       return s.str();
     }
   }
-  
-  boost::shared_ptr<DicomStructureSetLoader> 
-    LoaderCache::GetDicomStructureSetLoader(
+
+  std::string LoaderCache::BuildDicomStructureSetLoaderKey(
+    const std::string& instanceUuid,
+    const std::string& uniqueKey)
+  {
+    return instanceUuid + "_" + uniqueKey;
+  }
+
+  boost::shared_ptr<DicomStructureSetLoader> LoaderCache::GetDicomStructureSetLoader(
       std::string inInstanceUuid, 
-      const std::vector<std::string>& initiallyVisibleStructures)
+      const std::vector<std::string>& initiallyVisibleStructures,
+      const std::string& uniqueKey)
   {
     try
     {
       // normalize keys a little
       NormalizeUuid(inInstanceUuid);
 
-      std::string initiallyVisibleStructuresKey = 
-        SortAndJoin(initiallyVisibleStructures);
-
-      std::string entryKey = inInstanceUuid + "_" + initiallyVisibleStructuresKey;
+      std::string entryKey = BuildDicomStructureSetLoaderKey(inInstanceUuid, uniqueKey);
 
       // find in cache
       if (dicomStructureSetLoaders_.find(entryKey) == dicomStructureSetLoaders_.end())