diff OrthancStone/Sources/Toolbox/SortedFrames.h @ 1602:b2941196cabf

SortedFrames::LookupFrame()
author Sebastien Jodogne <s.jodogne@gmail.com>
date Wed, 28 Oct 2020 16:35:45 +0100
parents b253b79906fa
children 78509230f0d7
line wrap: on
line diff
--- a/OrthancStone/Sources/Toolbox/SortedFrames.h	Wed Oct 28 15:46:25 2020 +0100
+++ b/OrthancStone/Sources/Toolbox/SortedFrames.h	Wed Oct 28 16:35:45 2020 +0100
@@ -98,12 +98,17 @@
     // Maps "SOPInstanceUID" to an index in "instances_"
     typedef std::map<std::string, size_t>  InstancesIndex;
 
+    // Maps pair "(SOPInstanceUID, FrameNumber)" to an index in
+    // "frames_" (only once "Sort()" is called)
+    typedef std::map<std::pair<std::string, unsigned int>, size_t>  FramesIndex;
+
     std::string             studyInstanceUid_;
     std::string             seriesInstanceUid_;
     std::vector<Instance*>  instances_;
     std::vector<Frame>      frames_;
     bool                    sorted_;
     InstancesIndex          instancesIndex_;
+    FramesIndex             framesIndex_;
 
     const Instance& GetInstance(size_t instanceIndex) const;
 
@@ -194,6 +199,10 @@
       return GetFrame(frameIndex).GetInstance().IsMonochrome1();
     }
 
+    bool LookupFrame(size_t& frameIndex,
+                     const std::string& sopInstanceUid,
+                     unsigned int frameNumber) const;
+
     void Sort();
   };
 }