Mercurial > hg > orthanc-stone
comparison Framework/Loaders/DicomStructureSetLoader.h @ 1381:f4a06ad1580b
Branch broker is now the new default
author | Benjamin Golinvaux <bgo@osimis.io> |
---|---|
date | Wed, 22 Apr 2020 14:05:47 +0200 |
parents | 8a0a62189f46 13573ff63eb6 |
children | ffe9beb7c5d3 |
comparison
equal
deleted
inserted
replaced
1375:4431ffdcc2a4 | 1381:f4a06ad1580b |
---|---|
21 | 21 |
22 #pragma once | 22 #pragma once |
23 | 23 |
24 #include "../Toolbox/DicomStructureSet.h" | 24 #include "../Toolbox/DicomStructureSet.h" |
25 #include "../Volumes/IVolumeSlicer.h" | 25 #include "../Volumes/IVolumeSlicer.h" |
26 #include "../Loaders/ILoadersContext.h" | |
26 #include "LoaderStateMachine.h" | 27 #include "LoaderStateMachine.h" |
27 | 28 |
28 #include <vector> | 29 #include <vector> |
29 | 30 |
30 namespace OrthancStone | 31 namespace OrthancStone |
31 { | 32 { |
32 class DicomStructureSetLoader : | 33 class DicomStructureSetLoader : |
33 public LoaderStateMachine, | 34 public LoaderStateMachine, |
34 public IVolumeSlicer, | 35 public OrthancStone::IVolumeSlicer, |
35 public IObservable | 36 public OrthancStone::IObservable |
36 { | 37 { |
37 private: | 38 private: |
38 class Slice; | 39 class Slice; |
39 | 40 |
40 // States of LoaderStateMachine | 41 // States of LoaderStateMachine |
41 class AddReferencedInstance; // 3rd state | 42 class AddReferencedInstance; // 3rd state |
42 class LookupInstance; // 2nd state | 43 class LookupInstance; // 2nd state |
43 class LoadStructure; // 1st state | 44 class LoadStructure; // 1st state |
44 | 45 |
45 std::unique_ptr<DicomStructureSet> content_; | 46 OrthancStone::ILoadersContext& loadersContext_; |
46 uint64_t revision_; | 47 std::unique_ptr<OrthancStone::DicomStructureSet> content_; |
47 std::string instanceId_; | 48 uint64_t revision_; |
48 unsigned int countProcessedInstances_; | 49 std::string instanceId_; |
49 unsigned int countReferencedInstances_; | 50 unsigned int countProcessedInstances_; |
51 unsigned int countReferencedInstances_; | |
50 | 52 |
51 // will be set to true once the loading is finished | 53 // will be set to true once the loading is finished |
52 bool structuresReady_; | 54 bool structuresReady_; |
53 | 55 |
54 /** | 56 /** |
55 At load time, these strings are used to initialize the structureVisibility_ | 57 At load time, these strings are used to initialize the structureVisibility_ |
56 vector. | 58 vector. |
57 | 59 |
66 | 68 |
67 Changing this value directly affects the rendering | 69 Changing this value directly affects the rendering |
68 */ | 70 */ |
69 std::vector<bool> structureVisibility_; | 71 std::vector<bool> structureVisibility_; |
70 | 72 |
73 protected: | |
74 DicomStructureSetLoader(OrthancStone::ILoadersContext& loadersContext); | |
75 | |
71 public: | 76 public: |
72 ORTHANC_STONE_DEFINE_ORIGIN_MESSAGE(__FILE__, __LINE__, StructuresReady, DicomStructureSetLoader); | 77 ORTHANC_STONE_DEFINE_ORIGIN_MESSAGE(__FILE__, __LINE__, StructuresReady, DicomStructureSetLoader); |
78 ORTHANC_STONE_DEFINE_ORIGIN_MESSAGE(__FILE__, __LINE__, StructuresUpdated, DicomStructureSetLoader); | |
73 | 79 |
74 DicomStructureSetLoader(IOracle& oracle, | 80 static boost::shared_ptr<DicomStructureSetLoader> Create( |
75 IObservable& oracleObservable); | 81 OrthancStone::ILoadersContext& loadersContext); |
76 | 82 |
77 DicomStructureSet* GetContent() | 83 OrthancStone::DicomStructureSet* GetContent() |
78 { | 84 { |
79 return content_.get(); | 85 return content_.get(); |
80 } | 86 } |
81 | 87 |
82 void SetStructureDisplayState(size_t structureIndex, bool display); | 88 void SetStructureDisplayState(size_t structureIndex, bool display); |
89 ~DicomStructureSetLoader(); | 95 ~DicomStructureSetLoader(); |
90 | 96 |
91 void LoadInstance(const std::string& instanceId, | 97 void LoadInstance(const std::string& instanceId, |
92 const std::vector<std::string>& initiallyVisibleStructures = std::vector<std::string>()); | 98 const std::vector<std::string>& initiallyVisibleStructures = std::vector<std::string>()); |
93 | 99 |
94 virtual IExtractedSlice* ExtractSlice(const CoordinateSystem3D& cuttingPlane) ORTHANC_OVERRIDE; | 100 virtual IExtractedSlice* ExtractSlice(const OrthancStone::CoordinateSystem3D& cuttingPlane) ORTHANC_OVERRIDE; |
95 | 101 |
96 void SetStructuresReady(); | 102 void SetStructuresReady(); |
103 void SetStructuresUpdated(); | |
97 | 104 |
98 bool AreStructuresReady() const; | 105 bool AreStructuresReady() const; |
99 }; | 106 }; |
100 } | 107 } |