Mercurial > hg > orthanc-stone
annotate Framework/Loaders/LoaderCache.h @ 1028:6d5382fa45e1
fix qt
author | Sebastien Jodogne <s.jodogne@gmail.com> |
---|---|
date | Fri, 04 Oct 2019 21:58:13 +0200 |
parents | e704a53c9d0a |
children | 29f5f2031310 |
rev | line source |
---|---|
929
408bcc6c1505
Added Loader cache. Not activated yet.
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff
changeset
|
1 /** |
408bcc6c1505
Added Loader cache. Not activated yet.
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff
changeset
|
2 * Stone of Orthanc |
408bcc6c1505
Added Loader cache. Not activated yet.
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff
changeset
|
3 * Copyright (C) 2012-2016 Sebastien Jodogne, Medical Physics |
408bcc6c1505
Added Loader cache. Not activated yet.
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff
changeset
|
4 * Department, University Hospital of Liege, Belgium |
408bcc6c1505
Added Loader cache. Not activated yet.
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff
changeset
|
5 * Copyright (C) 2017-2019 Osimis S.A., Belgium |
408bcc6c1505
Added Loader cache. Not activated yet.
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff
changeset
|
6 * |
408bcc6c1505
Added Loader cache. Not activated yet.
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff
changeset
|
7 * This program is free software: you can redistribute it and/or |
408bcc6c1505
Added Loader cache. Not activated yet.
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff
changeset
|
8 * modify it under the terms of the GNU Affero General Public License |
408bcc6c1505
Added Loader cache. Not activated yet.
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff
changeset
|
9 * as published by the Free Software Foundation, either version 3 of |
408bcc6c1505
Added Loader cache. Not activated yet.
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff
changeset
|
10 * the License, or (at your option) any later version. |
408bcc6c1505
Added Loader cache. Not activated yet.
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff
changeset
|
11 * |
408bcc6c1505
Added Loader cache. Not activated yet.
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff
changeset
|
12 * This program is distributed in the hope that it will be useful, but |
408bcc6c1505
Added Loader cache. Not activated yet.
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff
changeset
|
13 * WITHOUT ANY WARRANTY; without even the implied warranty of |
408bcc6c1505
Added Loader cache. Not activated yet.
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff
changeset
|
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
408bcc6c1505
Added Loader cache. Not activated yet.
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff
changeset
|
15 * Affero General Public License for more details. |
408bcc6c1505
Added Loader cache. Not activated yet.
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff
changeset
|
16 * |
408bcc6c1505
Added Loader cache. Not activated yet.
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff
changeset
|
17 * You should have received a copy of the GNU Affero General Public License |
408bcc6c1505
Added Loader cache. Not activated yet.
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff
changeset
|
18 * along with this program. If not, see <http://www.gnu.org/licenses/>. |
408bcc6c1505
Added Loader cache. Not activated yet.
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff
changeset
|
19 **/ |
408bcc6c1505
Added Loader cache. Not activated yet.
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff
changeset
|
20 |
408bcc6c1505
Added Loader cache. Not activated yet.
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff
changeset
|
21 #pragma once |
408bcc6c1505
Added Loader cache. Not activated yet.
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff
changeset
|
22 |
408bcc6c1505
Added Loader cache. Not activated yet.
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff
changeset
|
23 #include <boost/shared_ptr.hpp> |
408bcc6c1505
Added Loader cache. Not activated yet.
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff
changeset
|
24 |
408bcc6c1505
Added Loader cache. Not activated yet.
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff
changeset
|
25 #include <map> |
408bcc6c1505
Added Loader cache. Not activated yet.
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff
changeset
|
26 #include <string> |
408bcc6c1505
Added Loader cache. Not activated yet.
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff
changeset
|
27 |
408bcc6c1505
Added Loader cache. Not activated yet.
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff
changeset
|
28 namespace OrthancStone |
408bcc6c1505
Added Loader cache. Not activated yet.
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff
changeset
|
29 { |
408bcc6c1505
Added Loader cache. Not activated yet.
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff
changeset
|
30 class OrthancSeriesVolumeProgressiveLoader; |
408bcc6c1505
Added Loader cache. Not activated yet.
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff
changeset
|
31 class DicomVolumeImageMPRSlicer; |
408bcc6c1505
Added Loader cache. Not activated yet.
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff
changeset
|
32 class DicomStructureSetLoader; |
1001
e704a53c9d0a
LoaderCache : support for the second set of structure set handling classes
Benjamin Golinvaux <bgo@osimis.io>
parents:
961
diff
changeset
|
33 class DicomStructureSetLoader2; |
e704a53c9d0a
LoaderCache : support for the second set of structure set handling classes
Benjamin Golinvaux <bgo@osimis.io>
parents:
961
diff
changeset
|
34 class DicomStructureSetSlicer2; |
e704a53c9d0a
LoaderCache : support for the second set of structure set handling classes
Benjamin Golinvaux <bgo@osimis.io>
parents:
961
diff
changeset
|
35 class DicomStructureSet2; |
929
408bcc6c1505
Added Loader cache. Not activated yet.
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff
changeset
|
36 class OrthancMultiframeVolumeLoader; |
408bcc6c1505
Added Loader cache. Not activated yet.
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff
changeset
|
37 |
408bcc6c1505
Added Loader cache. Not activated yet.
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff
changeset
|
38 #if ORTHANC_ENABLE_WASM == 1 |
930 | 39 class WebAssemblyOracle; |
929
408bcc6c1505
Added Loader cache. Not activated yet.
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff
changeset
|
40 #else |
930 | 41 class ThreadedOracle; |
929
408bcc6c1505
Added Loader cache. Not activated yet.
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff
changeset
|
42 class LockingEmitter; |
408bcc6c1505
Added Loader cache. Not activated yet.
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff
changeset
|
43 #endif |
408bcc6c1505
Added Loader cache. Not activated yet.
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff
changeset
|
44 |
408bcc6c1505
Added Loader cache. Not activated yet.
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff
changeset
|
45 class LoaderCache |
408bcc6c1505
Added Loader cache. Not activated yet.
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff
changeset
|
46 { |
408bcc6c1505
Added Loader cache. Not activated yet.
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff
changeset
|
47 public: |
408bcc6c1505
Added Loader cache. Not activated yet.
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff
changeset
|
48 #if ORTHANC_ENABLE_WASM == 1 |
930 | 49 LoaderCache(WebAssemblyOracle& oracle); |
929
408bcc6c1505
Added Loader cache. Not activated yet.
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff
changeset
|
50 #else |
930 | 51 LoaderCache(ThreadedOracle& oracle, LockingEmitter& lockingEmitter); |
929
408bcc6c1505
Added Loader cache. Not activated yet.
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff
changeset
|
52 #endif |
408bcc6c1505
Added Loader cache. Not activated yet.
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff
changeset
|
53 |
408bcc6c1505
Added Loader cache. Not activated yet.
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff
changeset
|
54 boost::shared_ptr<OrthancSeriesVolumeProgressiveLoader> |
408bcc6c1505
Added Loader cache. Not activated yet.
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff
changeset
|
55 GetSeriesVolumeProgressiveLoader (std::string seriesUuid); |
937
86ac61a040c9
Added getters and notifications to allow clients of the loaders (DicomStructureSetLoader, OrthancSeriesVolumeProgressiveLoader and OrthancMultiframeVolumeLoader) to know when the loading is finished + added ability for SDL event loop to execute a callback repeatedly (used to check the view loading state)
Benjamin Golinvaux <bgo@osimis.io>
parents:
930
diff
changeset
|
56 |
929
408bcc6c1505
Added Loader cache. Not activated yet.
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff
changeset
|
57 boost::shared_ptr<DicomVolumeImageMPRSlicer> |
408bcc6c1505
Added Loader cache. Not activated yet.
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff
changeset
|
58 GetMultiframeDicomVolumeImageMPRSlicer(std::string instanceUuid); |
937
86ac61a040c9
Added getters and notifications to allow clients of the loaders (DicomStructureSetLoader, OrthancSeriesVolumeProgressiveLoader and OrthancMultiframeVolumeLoader) to know when the loading is finished + added ability for SDL event loop to execute a callback repeatedly (used to check the view loading state)
Benjamin Golinvaux <bgo@osimis.io>
parents:
930
diff
changeset
|
59 |
86ac61a040c9
Added getters and notifications to allow clients of the loaders (DicomStructureSetLoader, OrthancSeriesVolumeProgressiveLoader and OrthancMultiframeVolumeLoader) to know when the loading is finished + added ability for SDL event loop to execute a callback repeatedly (used to check the view loading state)
Benjamin Golinvaux <bgo@osimis.io>
parents:
930
diff
changeset
|
60 boost::shared_ptr<OrthancMultiframeVolumeLoader> |
86ac61a040c9
Added getters and notifications to allow clients of the loaders (DicomStructureSetLoader, OrthancSeriesVolumeProgressiveLoader and OrthancMultiframeVolumeLoader) to know when the loading is finished + added ability for SDL event loop to execute a callback repeatedly (used to check the view loading state)
Benjamin Golinvaux <bgo@osimis.io>
parents:
930
diff
changeset
|
61 GetMultiframeVolumeLoader(std::string instanceUuid); |
86ac61a040c9
Added getters and notifications to allow clients of the loaders (DicomStructureSetLoader, OrthancSeriesVolumeProgressiveLoader and OrthancMultiframeVolumeLoader) to know when the loading is finished + added ability for SDL event loop to execute a callback repeatedly (used to check the view loading state)
Benjamin Golinvaux <bgo@osimis.io>
parents:
930
diff
changeset
|
62 |
929
408bcc6c1505
Added Loader cache. Not activated yet.
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff
changeset
|
63 boost::shared_ptr<DicomStructureSetLoader> |
408bcc6c1505
Added Loader cache. Not activated yet.
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff
changeset
|
64 GetDicomStructureSetLoader (std::string instanceUuid); |
408bcc6c1505
Added Loader cache. Not activated yet.
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff
changeset
|
65 |
1001
e704a53c9d0a
LoaderCache : support for the second set of structure set handling classes
Benjamin Golinvaux <bgo@osimis.io>
parents:
961
diff
changeset
|
66 boost::shared_ptr<DicomStructureSetLoader2> |
e704a53c9d0a
LoaderCache : support for the second set of structure set handling classes
Benjamin Golinvaux <bgo@osimis.io>
parents:
961
diff
changeset
|
67 GetDicomStructureSetLoader2(std::string instanceUuid); |
e704a53c9d0a
LoaderCache : support for the second set of structure set handling classes
Benjamin Golinvaux <bgo@osimis.io>
parents:
961
diff
changeset
|
68 |
e704a53c9d0a
LoaderCache : support for the second set of structure set handling classes
Benjamin Golinvaux <bgo@osimis.io>
parents:
961
diff
changeset
|
69 boost::shared_ptr<DicomStructureSetSlicer2> |
e704a53c9d0a
LoaderCache : support for the second set of structure set handling classes
Benjamin Golinvaux <bgo@osimis.io>
parents:
961
diff
changeset
|
70 GetDicomStructureSetSlicer2(std::string instanceUuid); |
e704a53c9d0a
LoaderCache : support for the second set of structure set handling classes
Benjamin Golinvaux <bgo@osimis.io>
parents:
961
diff
changeset
|
71 |
929
408bcc6c1505
Added Loader cache. Not activated yet.
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff
changeset
|
72 void ClearCache(); |
408bcc6c1505
Added Loader cache. Not activated yet.
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff
changeset
|
73 |
408bcc6c1505
Added Loader cache. Not activated yet.
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff
changeset
|
74 private: |
930 | 75 |
961
92e32e263ae9
Removed log in IsContextLost (too many calls) + removed glGetError guards on calls (expensive) + added shared_ptr ref count dump in LoaderCache (still needs to figure that one out)
Benjamin Golinvaux <bgo@osimis.io>
parents:
937
diff
changeset
|
76 void DebugDisplayObjRefCounts(); |
929
408bcc6c1505
Added Loader cache. Not activated yet.
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff
changeset
|
77 #if ORTHANC_ENABLE_WASM == 1 |
930 | 78 WebAssemblyOracle& oracle_; |
929
408bcc6c1505
Added Loader cache. Not activated yet.
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff
changeset
|
79 #else |
930 | 80 ThreadedOracle& oracle_; |
929
408bcc6c1505
Added Loader cache. Not activated yet.
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff
changeset
|
81 LockingEmitter& lockingEmitter_; |
408bcc6c1505
Added Loader cache. Not activated yet.
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff
changeset
|
82 #endif |
408bcc6c1505
Added Loader cache. Not activated yet.
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff
changeset
|
83 |
408bcc6c1505
Added Loader cache. Not activated yet.
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff
changeset
|
84 std::map<std::string, boost::shared_ptr<OrthancSeriesVolumeProgressiveLoader> > |
408bcc6c1505
Added Loader cache. Not activated yet.
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff
changeset
|
85 seriesVolumeProgressiveLoaders_; |
408bcc6c1505
Added Loader cache. Not activated yet.
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff
changeset
|
86 std::map<std::string, boost::shared_ptr<OrthancMultiframeVolumeLoader> > |
408bcc6c1505
Added Loader cache. Not activated yet.
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff
changeset
|
87 multiframeVolumeLoaders_; |
408bcc6c1505
Added Loader cache. Not activated yet.
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff
changeset
|
88 std::map<std::string, boost::shared_ptr<DicomVolumeImageMPRSlicer> > |
408bcc6c1505
Added Loader cache. Not activated yet.
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff
changeset
|
89 dicomVolumeImageMPRSlicers_; |
408bcc6c1505
Added Loader cache. Not activated yet.
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff
changeset
|
90 std::map<std::string, boost::shared_ptr<DicomStructureSetLoader> > |
408bcc6c1505
Added Loader cache. Not activated yet.
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff
changeset
|
91 dicomStructureSetLoaders_; |
1001
e704a53c9d0a
LoaderCache : support for the second set of structure set handling classes
Benjamin Golinvaux <bgo@osimis.io>
parents:
961
diff
changeset
|
92 std::map<std::string, boost::shared_ptr<DicomStructureSetLoader2> > |
e704a53c9d0a
LoaderCache : support for the second set of structure set handling classes
Benjamin Golinvaux <bgo@osimis.io>
parents:
961
diff
changeset
|
93 dicomStructureSetLoaders2_; |
e704a53c9d0a
LoaderCache : support for the second set of structure set handling classes
Benjamin Golinvaux <bgo@osimis.io>
parents:
961
diff
changeset
|
94 std::map<std::string, boost::shared_ptr<DicomStructureSet2> > |
e704a53c9d0a
LoaderCache : support for the second set of structure set handling classes
Benjamin Golinvaux <bgo@osimis.io>
parents:
961
diff
changeset
|
95 dicomStructureSets2_; |
e704a53c9d0a
LoaderCache : support for the second set of structure set handling classes
Benjamin Golinvaux <bgo@osimis.io>
parents:
961
diff
changeset
|
96 std::map<std::string, boost::shared_ptr<DicomStructureSetSlicer2> > |
e704a53c9d0a
LoaderCache : support for the second set of structure set handling classes
Benjamin Golinvaux <bgo@osimis.io>
parents:
961
diff
changeset
|
97 dicomStructureSetSlicers2_; |
929
408bcc6c1505
Added Loader cache. Not activated yet.
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff
changeset
|
98 }; |
408bcc6c1505
Added Loader cache. Not activated yet.
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff
changeset
|
99 } |
408bcc6c1505
Added Loader cache. Not activated yet.
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff
changeset
|
100 |