comparison Applications/Resources/Graveyard/LoaderCache.h @ 1591:5887a4f8594b

moving platform-specific files out of the "OrthancStone" folder
author Sebastien Jodogne <s.jodogne@gmail.com>
date Fri, 23 Oct 2020 13:15:03 +0200
parents OrthancStone/Sources/Loaders/LoaderCache.h@85e117739eca
children 4fb8fdf03314
comparison
equal deleted inserted replaced
1590:7b963bccafef 1591:5887a4f8594b
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-2020 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 #pragma once
22
23 #include "../Volumes/DicomVolumeImageMPRSlicer.h"
24 #include "OrthancSeriesVolumeProgressiveLoader.h"
25 #include "OrthancMultiframeVolumeLoader.h"
26 #include "DicomStructureSetLoader.h"
27
28 #include <boost/shared_ptr.hpp>
29
30 #include <map>
31 #include <string>
32 #include <vector>
33
34 namespace OrthancStone
35 {
36 class ILoadersContext;
37 }
38
39 namespace OrthancStone
40 {
41 class LoaderCache
42 {
43 public:
44
45 virtual ~LoaderCache() {}
46
47 /**
48 By default, the CT loader in loader cache will only download the highest quality slices.
49 If you pass true for useCtProgressiveQuality, jpeg (50/100 quality), then jpeg (90/100 quality)
50 then eventually uncompressed 16-bit images will be loaded.
51 */
52 LoaderCache(OrthancStone::ILoadersContext& loadersContext,
53 bool useCtProgressiveQuality);
54
55 boost::shared_ptr<OrthancSeriesVolumeProgressiveLoader>
56 GetSeriesVolumeProgressiveLoader (std::string seriesUuid);
57
58 boost::shared_ptr<OrthancStone::DicomVolumeImageMPRSlicer>
59 GetMultiframeDicomVolumeImageMPRSlicer(std::string instanceUuid);
60
61 boost::shared_ptr<OrthancMultiframeVolumeLoader>
62 GetMultiframeVolumeLoader(std::string instanceUuid);
63
64 /**
65 The DicomStructureSetLoader instances are stored in a map and indexed
66 by a key built from instanceUuid and uniqueKey.
67
68 If instanceUuid and uniqueKey correspond to an already existing loader, it is returned.
69
70 Please note that initiallyVisibleStructures is only used if the call results in the creation
71 of a new loader. In that case, the value is passed to the constructor.
72 */
73 boost::shared_ptr<DicomStructureSetLoader>
74 GetDicomStructureSetLoader(
75 std::string instanceUuid,
76 const std::vector<std::string>& initiallyVisibleStructures,
77 const std::string& uniqueKey = "");
78
79 std::string BuildDicomStructureSetLoaderKey(
80 const std::string& instanceUuid,
81 const std::string& uniqueKey = "");
82
83 void ClearCache();
84
85 protected:
86
87 void DebugDisplayObjRefCounts();
88
89 OrthancStone::ILoadersContext& loadersContext_;
90 bool useCtProgressiveQuality_;
91
92 std::map<std::string, boost::shared_ptr<OrthancSeriesVolumeProgressiveLoader> >
93 seriesVolumeProgressiveLoaders_;
94 std::map<std::string, boost::shared_ptr<OrthancMultiframeVolumeLoader> >
95 multiframeVolumeLoaders_;
96 std::map<std::string, boost::shared_ptr<OrthancStone::DicomVolumeImageMPRSlicer> >
97 dicomVolumeImageMPRSlicers_;
98 std::map<std::string, boost::shared_ptr<DicomStructureSetLoader> >
99 dicomStructureSetLoaders_;
100 };
101 }
102