comparison OrthancStone/Sources/Toolbox/OsiriX/CollectionOfAnnotations.h @ 1593:b782f78aed42

rendering osirix annotations
author Sebastien Jodogne <s.jodogne@gmail.com>
date Fri, 23 Oct 2020 17:39:16 +0200
parents bd180f97c734
children 4fb8fdf03314
comparison
equal deleted inserted replaced
1592:0d4b11ba86df 1593:b782f78aed42
21 21
22 #pragma once 22 #pragma once
23 23
24 #include "Annotation.h" 24 #include "Annotation.h"
25 25
26 #include <set>
26 #include <vector> 27 #include <vector>
27 28
28 namespace OrthancStone 29 namespace OrthancStone
29 { 30 {
30 namespace OsiriX 31 namespace OsiriX
31 { 32 {
32 class CollectionOfAnnotations : public boost::noncopyable 33 class CollectionOfAnnotations : public boost::noncopyable
33 { 34 {
34 private: 35 private:
36 typedef std::map<std::string, std::set<size_t> > SopInstanceUidIndex;
37
35 std::vector<Annotation*> annotations_; 38 std::vector<Annotation*> annotations_;
39 SopInstanceUidIndex index_;
36 40
37 public: 41 public:
38 ~CollectionOfAnnotations(); 42 ~CollectionOfAnnotations()
43 {
44 Clear();
45 }
39 46
47 void Clear();
48
40 size_t GetSize() const 49 size_t GetSize() const
41 { 50 {
42 return annotations_.size(); 51 return annotations_.size();
43 } 52 }
44 53
45 const Annotation& GetAnnotation(size_t i) const; 54 const Annotation& GetAnnotation(size_t i) const;
46 55
47 void AddAnnotation(Annotation* annotation); // takes ownership 56 void AddAnnotation(Annotation* annotation); // takes ownership
48 57
49 // Parse an XML from OsiriX 58 void LookupSopInstanceUid(std::set<size_t>& target,
50 void ParseXml(const std::string& xml); 59 const std::string& sopInstanceUid) const;
60
61 // Load an XML from OsiriX
62 void LoadXml(const char* xml,
63 size_t size);
64
65 void LoadXml(const std::string& xml)
66 {
67 LoadXml(xml.empty() ? NULL : xml.c_str(), xml.size());
68 }
51 }; 69 };
52 } 70 }
53 } 71 }