Mercurial > hg > orthanc-stone
comparison OrthancStone/Sources/Loaders/LoaderCache.h @ 1512:244ad1e4e76a
reorganization of folders
author | Sebastien Jodogne <s.jodogne@gmail.com> |
---|---|
date | Tue, 07 Jul 2020 16:21:02 +0200 |
parents | Framework/Loaders/LoaderCache.h@96044a18b98d |
children | 85e117739eca |
comparison
equal
deleted
inserted
replaced
1511:9dfeee74c1e6 | 1512:244ad1e4e76a |
---|---|
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, bool useCtProgressiveQuality = false); | |
53 | |
54 boost::shared_ptr<OrthancSeriesVolumeProgressiveLoader> | |
55 GetSeriesVolumeProgressiveLoader (std::string seriesUuid); | |
56 | |
57 boost::shared_ptr<OrthancStone::DicomVolumeImageMPRSlicer> | |
58 GetMultiframeDicomVolumeImageMPRSlicer(std::string instanceUuid); | |
59 | |
60 boost::shared_ptr<OrthancMultiframeVolumeLoader> | |
61 GetMultiframeVolumeLoader(std::string instanceUuid); | |
62 | |
63 /** | |
64 The DicomStructureSetLoader instances are stored in a map and indexed | |
65 by a key built from instanceUuid and uniqueKey. | |
66 | |
67 If instanceUuid and uniqueKey correspond to an already existing loader, it is returned. | |
68 | |
69 Please note that initiallyVisibleStructures is only used if the call results in the creation | |
70 of a new loader. In that case, the value is passed to the constructor. | |
71 */ | |
72 boost::shared_ptr<DicomStructureSetLoader> | |
73 GetDicomStructureSetLoader( | |
74 std::string instanceUuid, | |
75 const std::vector<std::string>& initiallyVisibleStructures, | |
76 const std::string& uniqueKey = ""); | |
77 | |
78 std::string BuildDicomStructureSetLoaderKey( | |
79 const std::string& instanceUuid, | |
80 const std::string& uniqueKey = ""); | |
81 | |
82 void ClearCache(); | |
83 | |
84 /** | |
85 Service method static and exposed for unit tests. | |
86 */ | |
87 static void NormalizeUuid(std::string& uuid); | |
88 | |
89 protected: | |
90 | |
91 void DebugDisplayObjRefCounts(); | |
92 | |
93 OrthancStone::ILoadersContext& loadersContext_; | |
94 bool useCtProgressiveQuality_; | |
95 | |
96 std::map<std::string, boost::shared_ptr<OrthancSeriesVolumeProgressiveLoader> > | |
97 seriesVolumeProgressiveLoaders_; | |
98 std::map<std::string, boost::shared_ptr<OrthancMultiframeVolumeLoader> > | |
99 multiframeVolumeLoaders_; | |
100 std::map<std::string, boost::shared_ptr<OrthancStone::DicomVolumeImageMPRSlicer> > | |
101 dicomVolumeImageMPRSlicers_; | |
102 std::map<std::string, boost::shared_ptr<DicomStructureSetLoader> > | |
103 dicomStructureSetLoaders_; | |
104 }; | |
105 } | |
106 |