annotate OrthancStone/Sources/Loaders/OrthancSeriesVolumeProgressiveLoader.h @ 2056:66c130af0d3c deep-learning

OpenGLTexture::SetClampingToZero() is not available in wasm
author Sebastien Jodogne <s.jodogne@gmail.com>
date Tue, 18 Apr 2023 15:18:36 +0200
parents 7053b8a0aaec
children 07964689cb0b
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
1337
b1396be5aa27 Moved the fixed loaders back from the dead
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
1 /**
b1396be5aa27 Moved the fixed loaders back from the dead
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
2 * Stone of Orthanc
b1396be5aa27 Moved the fixed loaders back from the dead
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
3 * Copyright (C) 2012-2016 Sebastien Jodogne, Medical Physics
b1396be5aa27 Moved the fixed loaders back from the dead
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
4 * Department, University Hospital of Liege, Belgium
1871
7053b8a0aaec upgrade to year 2022
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1870
diff changeset
5 * Copyright (C) 2017-2022 Osimis S.A., Belgium
7053b8a0aaec upgrade to year 2022
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1870
diff changeset
6 * Copyright (C) 2021-2022 Sebastien Jodogne, ICTEAM UCLouvain, Belgium
1337
b1396be5aa27 Moved the fixed loaders back from the dead
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
7 *
b1396be5aa27 Moved the fixed loaders back from the dead
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
8 * This program is free software: you can redistribute it and/or
1598
8563ea5d8ae4 relicensing some files, cf. osimis bm26 and chu agreement on 2020-05-20
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1596
diff changeset
9 * modify it under the terms of the GNU Lesser General Public License
1337
b1396be5aa27 Moved the fixed loaders back from the dead
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
10 * as published by the Free Software Foundation, either version 3 of
b1396be5aa27 Moved the fixed loaders back from the dead
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
11 * the License, or (at your option) any later version.
b1396be5aa27 Moved the fixed loaders back from the dead
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
12 *
b1396be5aa27 Moved the fixed loaders back from the dead
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
13 * This program is distributed in the hope that it will be useful, but
b1396be5aa27 Moved the fixed loaders back from the dead
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
14 * WITHOUT ANY WARRANTY; without even the implied warranty of
1598
8563ea5d8ae4 relicensing some files, cf. osimis bm26 and chu agreement on 2020-05-20
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1596
diff changeset
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
8563ea5d8ae4 relicensing some files, cf. osimis bm26 and chu agreement on 2020-05-20
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1596
diff changeset
16 * Lesser General Public License for more details.
1596
4fb8fdf03314 removed annoying whitespace
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1512
diff changeset
17 *
1598
8563ea5d8ae4 relicensing some files, cf. osimis bm26 and chu agreement on 2020-05-20
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1596
diff changeset
18 * You should have received a copy of the GNU Lesser General Public
8563ea5d8ae4 relicensing some files, cf. osimis bm26 and chu agreement on 2020-05-20
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1596
diff changeset
19 * License along with this program. If not, see
8563ea5d8ae4 relicensing some files, cf. osimis bm26 and chu agreement on 2020-05-20
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1596
diff changeset
20 * <http://www.gnu.org/licenses/>.
1337
b1396be5aa27 Moved the fixed loaders back from the dead
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
21 **/
b1396be5aa27 Moved the fixed loaders back from the dead
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
22
b1396be5aa27 Moved the fixed loaders back from the dead
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
23
b1396be5aa27 Moved the fixed loaders back from the dead
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
24 #pragma once
b1396be5aa27 Moved the fixed loaders back from the dead
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
25
1339
556b4bc19118 The loaders have been adapter to the nobroker architecture
Benjamin Golinvaux <bgo@osimis.io>
parents: 1337
diff changeset
26 #include "../Loaders/IFetchingItemsSorter.h"
556b4bc19118 The loaders have been adapter to the nobroker architecture
Benjamin Golinvaux <bgo@osimis.io>
parents: 1337
diff changeset
27 #include "../Loaders/IFetchingStrategy.h"
556b4bc19118 The loaders have been adapter to the nobroker architecture
Benjamin Golinvaux <bgo@osimis.io>
parents: 1337
diff changeset
28 #include "../Messages/IObservable.h"
556b4bc19118 The loaders have been adapter to the nobroker architecture
Benjamin Golinvaux <bgo@osimis.io>
parents: 1337
diff changeset
29 #include "../Messages/ObserverBase.h"
556b4bc19118 The loaders have been adapter to the nobroker architecture
Benjamin Golinvaux <bgo@osimis.io>
parents: 1337
diff changeset
30 #include "../Oracle/GetOrthancImageCommand.h"
556b4bc19118 The loaders have been adapter to the nobroker architecture
Benjamin Golinvaux <bgo@osimis.io>
parents: 1337
diff changeset
31 #include "../Oracle/GetOrthancWebViewerJpegCommand.h"
556b4bc19118 The loaders have been adapter to the nobroker architecture
Benjamin Golinvaux <bgo@osimis.io>
parents: 1337
diff changeset
32 #include "../Oracle/IOracle.h"
556b4bc19118 The loaders have been adapter to the nobroker architecture
Benjamin Golinvaux <bgo@osimis.io>
parents: 1337
diff changeset
33 #include "../Oracle/OrthancRestApiCommand.h"
556b4bc19118 The loaders have been adapter to the nobroker architecture
Benjamin Golinvaux <bgo@osimis.io>
parents: 1337
diff changeset
34 #include "../Toolbox/SlicesSorter.h"
556b4bc19118 The loaders have been adapter to the nobroker architecture
Benjamin Golinvaux <bgo@osimis.io>
parents: 1337
diff changeset
35 #include "../Volumes/DicomVolumeImage.h"
556b4bc19118 The loaders have been adapter to the nobroker architecture
Benjamin Golinvaux <bgo@osimis.io>
parents: 1337
diff changeset
36 #include "../Volumes/IVolumeSlicer.h"
1337
b1396be5aa27 Moved the fixed loaders back from the dead
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
37
b1396be5aa27 Moved the fixed loaders back from the dead
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
38 #include "../Volumes/IGeometryProvider.h"
b1396be5aa27 Moved the fixed loaders back from the dead
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
39
b1396be5aa27 Moved the fixed loaders back from the dead
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
40
b1396be5aa27 Moved the fixed loaders back from the dead
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
41 #include <boost/shared_ptr.hpp>
b1396be5aa27 Moved the fixed loaders back from the dead
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
42
b1396be5aa27 Moved the fixed loaders back from the dead
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
43 namespace OrthancStone
b1396be5aa27 Moved the fixed loaders back from the dead
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
44 {
1339
556b4bc19118 The loaders have been adapter to the nobroker architecture
Benjamin Golinvaux <bgo@osimis.io>
parents: 1337
diff changeset
45 class ILoadersContext;
1337
b1396be5aa27 Moved the fixed loaders back from the dead
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
46 /**
b1396be5aa27 Moved the fixed loaders back from the dead
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
47 This class is used to manage the progressive loading of a volume that
b1396be5aa27 Moved the fixed loaders back from the dead
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
48 is stored in a Dicom series.
b1396be5aa27 Moved the fixed loaders back from the dead
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
49 */
b1396be5aa27 Moved the fixed loaders back from the dead
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
50 class OrthancSeriesVolumeProgressiveLoader :
1640
52b8b96cb55f cleaning namespaces
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1598
diff changeset
51 public ObserverBase<OrthancSeriesVolumeProgressiveLoader>,
52b8b96cb55f cleaning namespaces
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1598
diff changeset
52 public IObservable,
52b8b96cb55f cleaning namespaces
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1598
diff changeset
53 public IVolumeSlicer,
1337
b1396be5aa27 Moved the fixed loaders back from the dead
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
54 public IGeometryProvider
b1396be5aa27 Moved the fixed loaders back from the dead
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
55 {
1443
60e30d73e2aa ISliceProcessor is now public
Benjamin Golinvaux <bgo@osimis.io>
parents: 1417
diff changeset
56 public:
60e30d73e2aa ISliceProcessor is now public
Benjamin Golinvaux <bgo@osimis.io>
parents: 1417
diff changeset
57 class ISlicePostProcessor
60e30d73e2aa ISliceProcessor is now public
Benjamin Golinvaux <bgo@osimis.io>
parents: 1417
diff changeset
58 {
60e30d73e2aa ISliceProcessor is now public
Benjamin Golinvaux <bgo@osimis.io>
parents: 1417
diff changeset
59 public:
60e30d73e2aa ISliceProcessor is now public
Benjamin Golinvaux <bgo@osimis.io>
parents: 1417
diff changeset
60 virtual void ProcessCTDicomSlice(const Orthanc::DicomMap& dicom) = 0;
60e30d73e2aa ISliceProcessor is now public
Benjamin Golinvaux <bgo@osimis.io>
parents: 1417
diff changeset
61 };
60e30d73e2aa ISliceProcessor is now public
Benjamin Golinvaux <bgo@osimis.io>
parents: 1417
diff changeset
62
1337
b1396be5aa27 Moved the fixed loaders back from the dead
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
63 private:
b1396be5aa27 Moved the fixed loaders back from the dead
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
64 static const unsigned int QUALITY_00 = 0;
b1396be5aa27 Moved the fixed loaders back from the dead
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
65 static const unsigned int QUALITY_01 = 1;
b1396be5aa27 Moved the fixed loaders back from the dead
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
66 static const unsigned int QUALITY_02 = 2;
b1396be5aa27 Moved the fixed loaders back from the dead
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
67
b1396be5aa27 Moved the fixed loaders back from the dead
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
68 class ExtractedSlice;
1417
afdd5be8731c when CT slices are loaded, it is now possible to act on this by implementing the ISlicePostProcessor interface and inject it in the loader.
Benjamin Golinvaux <bgo@osimis.io>
parents: 1381
diff changeset
69
1443
60e30d73e2aa ISliceProcessor is now public
Benjamin Golinvaux <bgo@osimis.io>
parents: 1417
diff changeset
70
1337
b1396be5aa27 Moved the fixed loaders back from the dead
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
71 /** Helper class internal to OrthancSeriesVolumeProgressiveLoader */
b1396be5aa27 Moved the fixed loaders back from the dead
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
72 class SeriesGeometry : public boost::noncopyable
b1396be5aa27 Moved the fixed loaders back from the dead
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
73 {
b1396be5aa27 Moved the fixed loaders back from the dead
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
74 private:
b1396be5aa27 Moved the fixed loaders back from the dead
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
75 void CheckSlice(size_t index,
1640
52b8b96cb55f cleaning namespaces
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1598
diff changeset
76 const DicomInstanceParameters& reference) const;
1337
b1396be5aa27 Moved the fixed loaders back from the dead
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
77
b1396be5aa27 Moved the fixed loaders back from the dead
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
78 void CheckVolume() const;
b1396be5aa27 Moved the fixed loaders back from the dead
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
79
b1396be5aa27 Moved the fixed loaders back from the dead
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
80 void Clear();
b1396be5aa27 Moved the fixed loaders back from the dead
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
81
b1396be5aa27 Moved the fixed loaders back from the dead
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
82 void CheckSliceIndex(size_t index) const;
b1396be5aa27 Moved the fixed loaders back from the dead
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
83
1640
52b8b96cb55f cleaning namespaces
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1598
diff changeset
84 std::unique_ptr<VolumeImageGeometry> geometry_;
52b8b96cb55f cleaning namespaces
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1598
diff changeset
85 std::vector<DicomInstanceParameters*> slices_;
1337
b1396be5aa27 Moved the fixed loaders back from the dead
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
86 std::vector<uint64_t> slicesRevision_;
b1396be5aa27 Moved the fixed loaders back from the dead
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
87
b1396be5aa27 Moved the fixed loaders back from the dead
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
88 public:
b1396be5aa27 Moved the fixed loaders back from the dead
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
89 ~SeriesGeometry()
b1396be5aa27 Moved the fixed loaders back from the dead
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
90 {
b1396be5aa27 Moved the fixed loaders back from the dead
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
91 Clear();
b1396be5aa27 Moved the fixed loaders back from the dead
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
92 }
b1396be5aa27 Moved the fixed loaders back from the dead
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
93
1640
52b8b96cb55f cleaning namespaces
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1598
diff changeset
94 void ComputeGeometry(SlicesSorter& slices);
1337
b1396be5aa27 Moved the fixed loaders back from the dead
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
95
b1396be5aa27 Moved the fixed loaders back from the dead
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
96 virtual bool HasGeometry() const
b1396be5aa27 Moved the fixed loaders back from the dead
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
97 {
b1396be5aa27 Moved the fixed loaders back from the dead
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
98 return geometry_.get() != NULL;
b1396be5aa27 Moved the fixed loaders back from the dead
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
99 }
b1396be5aa27 Moved the fixed loaders back from the dead
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
100
1640
52b8b96cb55f cleaning namespaces
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1598
diff changeset
101 virtual const VolumeImageGeometry& GetImageGeometry() const;
1337
b1396be5aa27 Moved the fixed loaders back from the dead
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
102
1640
52b8b96cb55f cleaning namespaces
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1598
diff changeset
103 const DicomInstanceParameters& GetSliceParameters(size_t index) const;
1337
b1396be5aa27 Moved the fixed loaders back from the dead
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
104
b1396be5aa27 Moved the fixed loaders back from the dead
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
105 uint64_t GetSliceRevision(size_t index) const;
b1396be5aa27 Moved the fixed loaders back from the dead
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
106
b1396be5aa27 Moved the fixed loaders back from the dead
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
107 void IncrementSliceRevision(size_t index);
b1396be5aa27 Moved the fixed loaders back from the dead
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
108 };
b1396be5aa27 Moved the fixed loaders back from the dead
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
109
b1396be5aa27 Moved the fixed loaders back from the dead
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
110 void ScheduleNextSliceDownload();
b1396be5aa27 Moved the fixed loaders back from the dead
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
111
1640
52b8b96cb55f cleaning namespaces
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1598
diff changeset
112 void LoadGeometry(const OrthancRestApiCommand::SuccessMessage& message);
1337
b1396be5aa27 Moved the fixed loaders back from the dead
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
113
b1396be5aa27 Moved the fixed loaders back from the dead
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
114 void SetSliceContent(unsigned int sliceIndex,
b1396be5aa27 Moved the fixed loaders back from the dead
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
115 const Orthanc::ImageAccessor& image,
b1396be5aa27 Moved the fixed loaders back from the dead
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
116 unsigned int quality);
b1396be5aa27 Moved the fixed loaders back from the dead
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
117
1640
52b8b96cb55f cleaning namespaces
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1598
diff changeset
118 void LoadBestQualitySliceContent(const GetOrthancImageCommand::SuccessMessage& message);
1337
b1396be5aa27 Moved the fixed loaders back from the dead
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
119
1640
52b8b96cb55f cleaning namespaces
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1598
diff changeset
120 void LoadJpegSliceContent(const GetOrthancWebViewerJpegCommand::SuccessMessage& message);
1337
b1396be5aa27 Moved the fixed loaders back from the dead
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
121
1640
52b8b96cb55f cleaning namespaces
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1598
diff changeset
122 ILoadersContext& loadersContext_;
52b8b96cb55f cleaning namespaces
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1598
diff changeset
123 bool active_;
52b8b96cb55f cleaning namespaces
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1598
diff changeset
124 bool progressiveQuality_;
1755
1a775f4ee672 added ability to specify initial slice in
bgo@SHARKNADO.localdomain
parents: 1739
diff changeset
125 bool startCenter_;
1640
52b8b96cb55f cleaning namespaces
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1598
diff changeset
126 unsigned int simultaneousDownloads_;
52b8b96cb55f cleaning namespaces
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1598
diff changeset
127 SeriesGeometry seriesGeometry_;
52b8b96cb55f cleaning namespaces
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1598
diff changeset
128 boost::shared_ptr<DicomVolumeImage> volume_;
52b8b96cb55f cleaning namespaces
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1598
diff changeset
129 std::unique_ptr<IFetchingItemsSorter::IFactory> sorter_;
52b8b96cb55f cleaning namespaces
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1598
diff changeset
130 std::unique_ptr<IFetchingStrategy> strategy_;
52b8b96cb55f cleaning namespaces
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1598
diff changeset
131 std::vector<unsigned int> slicesQuality_;
52b8b96cb55f cleaning namespaces
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1598
diff changeset
132 bool volumeImageReadyInHighQuality_;
52b8b96cb55f cleaning namespaces
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1598
diff changeset
133 boost::shared_ptr<ISlicePostProcessor> slicePostProcessor_;
1417
afdd5be8731c when CT slices are loaded, it is now possible to act on this by implementing the ISlicePostProcessor interface and inject it in the loader.
Benjamin Golinvaux <bgo@osimis.io>
parents: 1381
diff changeset
134
1448
dad6a2fe6fc7 Added setters to control relative priority of CT series loader requests.
Benjamin Golinvaux <bgo@osimis.io>
parents: 1444
diff changeset
135 /** See priority setters/getters below */
dad6a2fe6fc7 Added setters to control relative priority of CT series loader requests.
Benjamin Golinvaux <bgo@osimis.io>
parents: 1444
diff changeset
136 int medadataSchedulingPriority_;
dad6a2fe6fc7 Added setters to control relative priority of CT series loader requests.
Benjamin Golinvaux <bgo@osimis.io>
parents: 1444
diff changeset
137
dad6a2fe6fc7 Added setters to control relative priority of CT series loader requests.
Benjamin Golinvaux <bgo@osimis.io>
parents: 1444
diff changeset
138 /** See priority setters/getters below */
dad6a2fe6fc7 Added setters to control relative priority of CT series loader requests.
Benjamin Golinvaux <bgo@osimis.io>
parents: 1444
diff changeset
139 int sliceSchedulingPriority_;
dad6a2fe6fc7 Added setters to control relative priority of CT series loader requests.
Benjamin Golinvaux <bgo@osimis.io>
parents: 1444
diff changeset
140
1337
b1396be5aa27 Moved the fixed loaders back from the dead
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
141 OrthancSeriesVolumeProgressiveLoader(
1640
52b8b96cb55f cleaning namespaces
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1598
diff changeset
142 ILoadersContext& loadersContext,
52b8b96cb55f cleaning namespaces
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1598
diff changeset
143 boost::shared_ptr<DicomVolumeImage> volume,
1337
b1396be5aa27 Moved the fixed loaders back from the dead
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
144 bool progressiveQuality);
b1396be5aa27 Moved the fixed loaders back from the dead
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
145
b1396be5aa27 Moved the fixed loaders back from the dead
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
146 public:
b1396be5aa27 Moved the fixed loaders back from the dead
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
147 ORTHANC_STONE_DEFINE_ORIGIN_MESSAGE(__FILE__, __LINE__, VolumeImageReadyInHighQuality, OrthancSeriesVolumeProgressiveLoader);
b1396be5aa27 Moved the fixed loaders back from the dead
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
148
b1396be5aa27 Moved the fixed loaders back from the dead
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
149 /**
b1396be5aa27 Moved the fixed loaders back from the dead
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
150 See doc for the progressiveQuality_ field
b1396be5aa27 Moved the fixed loaders back from the dead
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
151 */
b1396be5aa27 Moved the fixed loaders back from the dead
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
152 static boost::shared_ptr<OrthancSeriesVolumeProgressiveLoader> Create(
1640
52b8b96cb55f cleaning namespaces
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1598
diff changeset
153 ILoadersContext& context,
52b8b96cb55f cleaning namespaces
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1598
diff changeset
154 boost::shared_ptr<DicomVolumeImage> volume,
1337
b1396be5aa27 Moved the fixed loaders back from the dead
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
155 bool progressiveQuality = false);
b1396be5aa27 Moved the fixed loaders back from the dead
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
156
b1396be5aa27 Moved the fixed loaders back from the dead
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
157 virtual ~OrthancSeriesVolumeProgressiveLoader();
b1396be5aa27 Moved the fixed loaders back from the dead
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
158
1755
1a775f4ee672 added ability to specify initial slice in
bgo@SHARKNADO.localdomain
parents: 1739
diff changeset
159 void SetStartCenter(bool startCenter);
1a775f4ee672 added ability to specify initial slice in
bgo@SHARKNADO.localdomain
parents: 1739
diff changeset
160
1337
b1396be5aa27 Moved the fixed loaders back from the dead
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
161 void SetSimultaneousDownloads(unsigned int count);
b1396be5aa27 Moved the fixed loaders back from the dead
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
162
1448
dad6a2fe6fc7 Added setters to control relative priority of CT series loader requests.
Benjamin Golinvaux <bgo@osimis.io>
parents: 1444
diff changeset
163 /**
dad6a2fe6fc7 Added setters to control relative priority of CT series loader requests.
Benjamin Golinvaux <bgo@osimis.io>
parents: 1444
diff changeset
164 Sets the relative priority of the requests for metadata.
dad6a2fe6fc7 Added setters to control relative priority of CT series loader requests.
Benjamin Golinvaux <bgo@osimis.io>
parents: 1444
diff changeset
165 - if p < PRIORITY_HIGH (-1) , the requests will be high priority
dad6a2fe6fc7 Added setters to control relative priority of CT series loader requests.
Benjamin Golinvaux <bgo@osimis.io>
parents: 1444
diff changeset
166 - if PRIORITY_LOW (100) > p > PRIORITY_HIGH , the requests will be medium priority
dad6a2fe6fc7 Added setters to control relative priority of CT series loader requests.
Benjamin Golinvaux <bgo@osimis.io>
parents: 1444
diff changeset
167 - if p > PRIORITY_LOW , the requests will be low priority
dad6a2fe6fc7 Added setters to control relative priority of CT series loader requests.
Benjamin Golinvaux <bgo@osimis.io>
parents: 1444
diff changeset
168
dad6a2fe6fc7 Added setters to control relative priority of CT series loader requests.
Benjamin Golinvaux <bgo@osimis.io>
parents: 1444
diff changeset
169 Default is 0 (medium)
dad6a2fe6fc7 Added setters to control relative priority of CT series loader requests.
Benjamin Golinvaux <bgo@osimis.io>
parents: 1444
diff changeset
170 */
dad6a2fe6fc7 Added setters to control relative priority of CT series loader requests.
Benjamin Golinvaux <bgo@osimis.io>
parents: 1444
diff changeset
171 void SetMetadataSchedulingPriority(int p);
dad6a2fe6fc7 Added setters to control relative priority of CT series loader requests.
Benjamin Golinvaux <bgo@osimis.io>
parents: 1444
diff changeset
172
dad6a2fe6fc7 Added setters to control relative priority of CT series loader requests.
Benjamin Golinvaux <bgo@osimis.io>
parents: 1444
diff changeset
173 /** @see SetMetadataSchedulingPriority */
dad6a2fe6fc7 Added setters to control relative priority of CT series loader requests.
Benjamin Golinvaux <bgo@osimis.io>
parents: 1444
diff changeset
174 int GetMetadataSchedulingPriority() const;
dad6a2fe6fc7 Added setters to control relative priority of CT series loader requests.
Benjamin Golinvaux <bgo@osimis.io>
parents: 1444
diff changeset
175
dad6a2fe6fc7 Added setters to control relative priority of CT series loader requests.
Benjamin Golinvaux <bgo@osimis.io>
parents: 1444
diff changeset
176 /** Same as SetMetadataSchedulingPriority, for slices. Default is 0. */
dad6a2fe6fc7 Added setters to control relative priority of CT series loader requests.
Benjamin Golinvaux <bgo@osimis.io>
parents: 1444
diff changeset
177 void SetSliceSchedulingPriority(int p);
dad6a2fe6fc7 Added setters to control relative priority of CT series loader requests.
Benjamin Golinvaux <bgo@osimis.io>
parents: 1444
diff changeset
178
dad6a2fe6fc7 Added setters to control relative priority of CT series loader requests.
Benjamin Golinvaux <bgo@osimis.io>
parents: 1444
diff changeset
179 /** @see SetSliceSchedulingPriority */
dad6a2fe6fc7 Added setters to control relative priority of CT series loader requests.
Benjamin Golinvaux <bgo@osimis.io>
parents: 1444
diff changeset
180 int GetSliceSchedulingPriority() const;
dad6a2fe6fc7 Added setters to control relative priority of CT series loader requests.
Benjamin Golinvaux <bgo@osimis.io>
parents: 1444
diff changeset
181
dad6a2fe6fc7 Added setters to control relative priority of CT series loader requests.
Benjamin Golinvaux <bgo@osimis.io>
parents: 1444
diff changeset
182 /** Sets priorities for all requests. @see SetMetadataSchedulingPriority */
dad6a2fe6fc7 Added setters to control relative priority of CT series loader requests.
Benjamin Golinvaux <bgo@osimis.io>
parents: 1444
diff changeset
183 void SetSchedulingPriority(int p);
dad6a2fe6fc7 Added setters to control relative priority of CT series loader requests.
Benjamin Golinvaux <bgo@osimis.io>
parents: 1444
diff changeset
184
1417
afdd5be8731c when CT slices are loaded, it is now possible to act on this by implementing the ISlicePostProcessor interface and inject it in the loader.
Benjamin Golinvaux <bgo@osimis.io>
parents: 1381
diff changeset
185 void SetDicomSlicePostProcessor(boost::shared_ptr<ISlicePostProcessor> slicePostProcessor)
afdd5be8731c when CT slices are loaded, it is now possible to act on this by implementing the ISlicePostProcessor interface and inject it in the loader.
Benjamin Golinvaux <bgo@osimis.io>
parents: 1381
diff changeset
186 {
afdd5be8731c when CT slices are loaded, it is now possible to act on this by implementing the ISlicePostProcessor interface and inject it in the loader.
Benjamin Golinvaux <bgo@osimis.io>
parents: 1381
diff changeset
187 // this will delete the previously stored slice processor, if any
afdd5be8731c when CT slices are loaded, it is now possible to act on this by implementing the ISlicePostProcessor interface and inject it in the loader.
Benjamin Golinvaux <bgo@osimis.io>
parents: 1381
diff changeset
188 slicePostProcessor_ = slicePostProcessor;
afdd5be8731c when CT slices are loaded, it is now possible to act on this by implementing the ISlicePostProcessor interface and inject it in the loader.
Benjamin Golinvaux <bgo@osimis.io>
parents: 1381
diff changeset
189 }
afdd5be8731c when CT slices are loaded, it is now possible to act on this by implementing the ISlicePostProcessor interface and inject it in the loader.
Benjamin Golinvaux <bgo@osimis.io>
parents: 1381
diff changeset
190
1444
687457d4018f Getter for slice processor
Benjamin Golinvaux <bgo@osimis.io>
parents: 1443
diff changeset
191 boost::shared_ptr<ISlicePostProcessor> GetDicomSlicePostProcessor()
687457d4018f Getter for slice processor
Benjamin Golinvaux <bgo@osimis.io>
parents: 1443
diff changeset
192 {
687457d4018f Getter for slice processor
Benjamin Golinvaux <bgo@osimis.io>
parents: 1443
diff changeset
193 // this could be empty!
687457d4018f Getter for slice processor
Benjamin Golinvaux <bgo@osimis.io>
parents: 1443
diff changeset
194 return slicePostProcessor_;
687457d4018f Getter for slice processor
Benjamin Golinvaux <bgo@osimis.io>
parents: 1443
diff changeset
195 }
687457d4018f Getter for slice processor
Benjamin Golinvaux <bgo@osimis.io>
parents: 1443
diff changeset
196
1337
b1396be5aa27 Moved the fixed loaders back from the dead
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
197 bool IsVolumeImageReadyInHighQuality() const
b1396be5aa27 Moved the fixed loaders back from the dead
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
198 {
b1396be5aa27 Moved the fixed loaders back from the dead
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
199 return volumeImageReadyInHighQuality_;
b1396be5aa27 Moved the fixed loaders back from the dead
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
200 }
b1396be5aa27 Moved the fixed loaders back from the dead
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
201
b1396be5aa27 Moved the fixed loaders back from the dead
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
202 void LoadSeries(const std::string& seriesId);
b1396be5aa27 Moved the fixed loaders back from the dead
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
203
b1396be5aa27 Moved the fixed loaders back from the dead
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
204 /**
b1396be5aa27 Moved the fixed loaders back from the dead
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
205 This getter is used by clients that do not receive the geometry through
b1396be5aa27 Moved the fixed loaders back from the dead
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
206 subscribing, for instance if they are created or listening only AFTER the
b1396be5aa27 Moved the fixed loaders back from the dead
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
207 "geometry loaded" message is broadcast
b1396be5aa27 Moved the fixed loaders back from the dead
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
208 */
b1396be5aa27 Moved the fixed loaders back from the dead
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
209 bool HasGeometry() const ORTHANC_OVERRIDE
b1396be5aa27 Moved the fixed loaders back from the dead
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
210 {
b1396be5aa27 Moved the fixed loaders back from the dead
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
211 return seriesGeometry_.HasGeometry();
b1396be5aa27 Moved the fixed loaders back from the dead
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
212 }
b1396be5aa27 Moved the fixed loaders back from the dead
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
213
b1396be5aa27 Moved the fixed loaders back from the dead
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
214 /**
b1396be5aa27 Moved the fixed loaders back from the dead
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
215 Same remark as HasGeometry
b1396be5aa27 Moved the fixed loaders back from the dead
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
216 */
1640
52b8b96cb55f cleaning namespaces
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1598
diff changeset
217 const VolumeImageGeometry& GetImageGeometry() const ORTHANC_OVERRIDE
1337
b1396be5aa27 Moved the fixed loaders back from the dead
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
218 {
b1396be5aa27 Moved the fixed loaders back from the dead
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
219 return seriesGeometry_.GetImageGeometry();
b1396be5aa27 Moved the fixed loaders back from the dead
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
220 }
b1396be5aa27 Moved the fixed loaders back from the dead
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
221
b1396be5aa27 Moved the fixed loaders back from the dead
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
222 /**
b1396be5aa27 Moved the fixed loaders back from the dead
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
223 When a slice is requested, the strategy algorithm (that defines the
b1396be5aa27 Moved the fixed loaders back from the dead
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
224 sequence of resources to be loaded from the server) is modified to
b1396be5aa27 Moved the fixed loaders back from the dead
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
225 take into account this request (this is done in the ExtractedSlice ctor)
b1396be5aa27 Moved the fixed loaders back from the dead
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
226 */
b1396be5aa27 Moved the fixed loaders back from the dead
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
227 virtual IExtractedSlice*
1640
52b8b96cb55f cleaning namespaces
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1598
diff changeset
228 ExtractSlice(const CoordinateSystem3D& cuttingPlane) ORTHANC_OVERRIDE;
1337
b1396be5aa27 Moved the fixed loaders back from the dead
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
229 };
b1396be5aa27 Moved the fixed loaders back from the dead
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
230 }