comparison Framework/Loaders/DicomStructureSetLoader.h @ 1019:29f5f2031310

Added a way to specificy which structures are to be initially displayed (the default being ALL structures displayed) + the loader maintains a list of structure display state, that can be modified continuously + the cache now takes the initial list of structure into account for computing the entry + added methods to change the loaded structure visibility + disabled the alternate loaders (DicomStructureSetLoader2 and friends) + disabled corresponding tests
author Benjamin Golinvaux <bgo@osimis.io>
date Fri, 27 Sep 2019 13:32:05 +0200
parents 50e5acf5553b
children 7014c2397b45
comparison
equal deleted inserted replaced
1018:58eed6bbcabb 1019:29f5f2031310
23 23
24 #include "../Toolbox/DicomStructureSet.h" 24 #include "../Toolbox/DicomStructureSet.h"
25 #include "../Volumes/IVolumeSlicer.h" 25 #include "../Volumes/IVolumeSlicer.h"
26 #include "LoaderStateMachine.h" 26 #include "LoaderStateMachine.h"
27 27
28 #include <vector>
29
28 namespace OrthancStone 30 namespace OrthancStone
29 { 31 {
30 class DicomStructureSetLoader : 32 class DicomStructureSetLoader :
31 public LoaderStateMachine, 33 public LoaderStateMachine,
32 public IVolumeSlicer, 34 public IVolumeSlicer,
46 unsigned int countProcessedInstances_; 48 unsigned int countProcessedInstances_;
47 unsigned int countReferencedInstances_; 49 unsigned int countReferencedInstances_;
48 50
49 // will be set to true once the loading is finished 51 // will be set to true once the loading is finished
50 bool structuresReady_; 52 bool structuresReady_;
51 53
54 /**
55 At load time, these strings is used to initialize the
56 structureVisibility_ vector.
57
58 As a special case, if initiallyVisibleStructures_ is empty, ALL structures
59 will be made visible.
60 */
61 std::vector<std::string> initiallyVisibleStructures_;
62
63 /**
64 Contains the "Should this structure be displayed?" flag for all structures.
65 Only filled when structures are loaded.
66
67 Changing this value directly affects the rendering
68 */
69 std::vector<bool> structureVisibility_;
70
52 public: 71 public:
53 ORTHANC_STONE_DEFINE_ORIGIN_MESSAGE(__FILE__, __LINE__, StructuresReady, DicomStructureSetLoader); 72 ORTHANC_STONE_DEFINE_ORIGIN_MESSAGE(__FILE__, __LINE__, StructuresReady, DicomStructureSetLoader);
54 73
55 DicomStructureSetLoader(IOracle& oracle, 74 DicomStructureSetLoader(IOracle& oracle,
56 IObservable& oracleObservable); 75 IObservable& oracleObservable);
57 76
77 DicomStructureSet* GetContent()
78 {
79 return content_.get();
80 }
81
82 void SetStructureDisplayState(size_t structureIndex, bool display);
83
84 bool GetStructureDisplayState(size_t structureIndex) const
85 {
86 return structureVisibility_.at(structureIndex);
87 }
88
58 ~DicomStructureSetLoader(); 89 ~DicomStructureSetLoader();
59 90
60 void LoadInstance(const std::string& instanceId); 91 void LoadInstance(const std::string& instanceId,
92 const std::vector<std::string>& initiallyVisibleStructures = std::vector<std::string>());
61 93
62 virtual IExtractedSlice* ExtractSlice(const CoordinateSystem3D& cuttingPlane) ORTHANC_OVERRIDE; 94 virtual IExtractedSlice* ExtractSlice(const CoordinateSystem3D& cuttingPlane) ORTHANC_OVERRIDE;
63 95
64 void SetStructuresReady(); 96 void SetStructuresReady();
65 97