Mercurial > hg > orthanc-stone
comparison Framework/Deprecated/Loaders/DicomStructureSetLoader.h @ 1225:16738485e457 broker
deprecating DicomStructureSetLoader, OrthancMultiframeVolumeLoader and OrthancSeriesVolumeProgressiveLoader
author | Sebastien Jodogne <s.jodogne@gmail.com> |
---|---|
date | Sun, 08 Dec 2019 11:45:09 +0100 |
parents | Framework/Loaders/DicomStructureSetLoader.h@7014c2397b45 |
children | 0ca50d275b9a |
comparison
equal
deleted
inserted
replaced
1224:37bc7f115f81 | 1225:16738485e457 |
---|---|
1 /** | |
2 * Stone of Orthanc | |
3 * Copyright (C) 2012-2016 Sebastien Jodogne, Medical Physics | |
4 * Department, University Hospital of Liege, Belgium | |
5 * Copyright (C) 2017-2019 Osimis S.A., Belgium | |
6 * | |
7 * This program is free software: you can redistribute it and/or | |
8 * modify it under the terms of the GNU Affero General Public License | |
9 * as published by the Free Software Foundation, either version 3 of | |
10 * the License, or (at your option) any later version. | |
11 * | |
12 * This program is distributed in the hope that it will be useful, but | |
13 * WITHOUT ANY WARRANTY; without even the implied warranty of | |
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |
15 * Affero General Public License for more details. | |
16 * | |
17 * You should have received a copy of the GNU Affero General Public License | |
18 * along with this program. If not, see <http://www.gnu.org/licenses/>. | |
19 **/ | |
20 | |
21 | |
22 #pragma once | |
23 | |
24 #include "../../Toolbox/DicomStructureSet.h" | |
25 #include "../../Volumes/IVolumeSlicer.h" | |
26 #include "LoaderStateMachine.h" | |
27 | |
28 #include <vector> | |
29 | |
30 namespace Deprecated | |
31 { | |
32 class DicomStructureSetLoader : | |
33 public LoaderStateMachine, | |
34 public OrthancStone::IVolumeSlicer, | |
35 public OrthancStone::IObservable | |
36 { | |
37 private: | |
38 class Slice; | |
39 | |
40 // States of LoaderStateMachine | |
41 class AddReferencedInstance; // 3rd state | |
42 class LookupInstance; // 2nd state | |
43 class LoadStructure; // 1st state | |
44 | |
45 std::auto_ptr<OrthancStone::DicomStructureSet> content_; | |
46 uint64_t revision_; | |
47 std::string instanceId_; | |
48 unsigned int countProcessedInstances_; | |
49 unsigned int countReferencedInstances_; | |
50 | |
51 // will be set to true once the loading is finished | |
52 bool structuresReady_; | |
53 | |
54 /** | |
55 At load time, these strings are used to initialize the structureVisibility_ | |
56 vector. | |
57 | |
58 As a special case, if initiallyVisibleStructures_ contains a single string | |
59 that is '*', ALL structures 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 | |
71 public: | |
72 ORTHANC_STONE_DEFINE_ORIGIN_MESSAGE(__FILE__, __LINE__, StructuresReady, DicomStructureSetLoader); | |
73 | |
74 DicomStructureSetLoader(OrthancStone::IOracle& oracle, | |
75 OrthancStone::IObservable& oracleObservable); | |
76 | |
77 OrthancStone::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 | |
89 ~DicomStructureSetLoader(); | |
90 | |
91 void LoadInstance(const std::string& instanceId, | |
92 const std::vector<std::string>& initiallyVisibleStructures = std::vector<std::string>()); | |
93 | |
94 virtual IExtractedSlice* ExtractSlice(const OrthancStone::CoordinateSystem3D& cuttingPlane) ORTHANC_OVERRIDE; | |
95 | |
96 void SetStructuresReady(); | |
97 | |
98 bool AreStructuresReady() const; | |
99 }; | |
100 } |