Mercurial > hg > orthanc-stone
comparison OrthancStone/Sources/Loaders/OrthancSeriesVolumeProgressiveLoader.h @ 1640:52b8b96cb55f
cleaning namespaces
author | Sebastien Jodogne <s.jodogne@gmail.com> |
---|---|
date | Tue, 10 Nov 2020 16:55:22 +0100 |
parents | 8563ea5d8ae4 |
children | 9ac2a65d4172 |
comparison
equal
deleted
inserted
replaced
1639:5cdc5b98f14d | 1640:52b8b96cb55f |
---|---|
45 /** | 45 /** |
46 This class is used to manage the progressive loading of a volume that | 46 This class is used to manage the progressive loading of a volume that |
47 is stored in a Dicom series. | 47 is stored in a Dicom series. |
48 */ | 48 */ |
49 class OrthancSeriesVolumeProgressiveLoader : | 49 class OrthancSeriesVolumeProgressiveLoader : |
50 public OrthancStone::ObserverBase<OrthancSeriesVolumeProgressiveLoader>, | 50 public ObserverBase<OrthancSeriesVolumeProgressiveLoader>, |
51 public OrthancStone::IObservable, | 51 public IObservable, |
52 public OrthancStone::IVolumeSlicer, | 52 public IVolumeSlicer, |
53 public IGeometryProvider | 53 public IGeometryProvider |
54 { | 54 { |
55 public: | 55 public: |
56 class ISlicePostProcessor | 56 class ISlicePostProcessor |
57 { | 57 { |
70 /** Helper class internal to OrthancSeriesVolumeProgressiveLoader */ | 70 /** Helper class internal to OrthancSeriesVolumeProgressiveLoader */ |
71 class SeriesGeometry : public boost::noncopyable | 71 class SeriesGeometry : public boost::noncopyable |
72 { | 72 { |
73 private: | 73 private: |
74 void CheckSlice(size_t index, | 74 void CheckSlice(size_t index, |
75 const OrthancStone::DicomInstanceParameters& reference) const; | 75 const DicomInstanceParameters& reference) const; |
76 | 76 |
77 void CheckVolume() const; | 77 void CheckVolume() const; |
78 | 78 |
79 void Clear(); | 79 void Clear(); |
80 | 80 |
81 void CheckSliceIndex(size_t index) const; | 81 void CheckSliceIndex(size_t index) const; |
82 | 82 |
83 std::unique_ptr<OrthancStone::VolumeImageGeometry> geometry_; | 83 std::unique_ptr<VolumeImageGeometry> geometry_; |
84 std::vector<OrthancStone::DicomInstanceParameters*> slices_; | 84 std::vector<DicomInstanceParameters*> slices_; |
85 std::vector<uint64_t> slicesRevision_; | 85 std::vector<uint64_t> slicesRevision_; |
86 | 86 |
87 public: | 87 public: |
88 ~SeriesGeometry() | 88 ~SeriesGeometry() |
89 { | 89 { |
90 Clear(); | 90 Clear(); |
91 } | 91 } |
92 | 92 |
93 void ComputeGeometry(OrthancStone::SlicesSorter& slices); | 93 void ComputeGeometry(SlicesSorter& slices); |
94 | 94 |
95 virtual bool HasGeometry() const | 95 virtual bool HasGeometry() const |
96 { | 96 { |
97 return geometry_.get() != NULL; | 97 return geometry_.get() != NULL; |
98 } | 98 } |
99 | 99 |
100 virtual const OrthancStone::VolumeImageGeometry& GetImageGeometry() const; | 100 virtual const VolumeImageGeometry& GetImageGeometry() const; |
101 | 101 |
102 const OrthancStone::DicomInstanceParameters& GetSliceParameters(size_t index) const; | 102 const DicomInstanceParameters& GetSliceParameters(size_t index) const; |
103 | 103 |
104 uint64_t GetSliceRevision(size_t index) const; | 104 uint64_t GetSliceRevision(size_t index) const; |
105 | 105 |
106 void IncrementSliceRevision(size_t index); | 106 void IncrementSliceRevision(size_t index); |
107 }; | 107 }; |
108 | 108 |
109 void ScheduleNextSliceDownload(); | 109 void ScheduleNextSliceDownload(); |
110 | 110 |
111 void LoadGeometry(const OrthancStone::OrthancRestApiCommand::SuccessMessage& message); | 111 void LoadGeometry(const OrthancRestApiCommand::SuccessMessage& message); |
112 | 112 |
113 void SetSliceContent(unsigned int sliceIndex, | 113 void SetSliceContent(unsigned int sliceIndex, |
114 const Orthanc::ImageAccessor& image, | 114 const Orthanc::ImageAccessor& image, |
115 unsigned int quality); | 115 unsigned int quality); |
116 | 116 |
117 void LoadBestQualitySliceContent(const OrthancStone::GetOrthancImageCommand::SuccessMessage& message); | 117 void LoadBestQualitySliceContent(const GetOrthancImageCommand::SuccessMessage& message); |
118 | 118 |
119 void LoadJpegSliceContent(const OrthancStone::GetOrthancWebViewerJpegCommand::SuccessMessage& message); | 119 void LoadJpegSliceContent(const GetOrthancWebViewerJpegCommand::SuccessMessage& message); |
120 | 120 |
121 OrthancStone::ILoadersContext& loadersContext_; | 121 ILoadersContext& loadersContext_; |
122 bool active_; | 122 bool active_; |
123 bool progressiveQuality_; | 123 bool progressiveQuality_; |
124 unsigned int simultaneousDownloads_; | 124 unsigned int simultaneousDownloads_; |
125 SeriesGeometry seriesGeometry_; | 125 SeriesGeometry seriesGeometry_; |
126 boost::shared_ptr<OrthancStone::DicomVolumeImage> volume_; | 126 boost::shared_ptr<DicomVolumeImage> volume_; |
127 std::unique_ptr<OrthancStone::IFetchingItemsSorter::IFactory> sorter_; | 127 std::unique_ptr<IFetchingItemsSorter::IFactory> sorter_; |
128 std::unique_ptr<OrthancStone::IFetchingStrategy> strategy_; | 128 std::unique_ptr<IFetchingStrategy> strategy_; |
129 | 129 std::vector<unsigned int> slicesQuality_; |
130 std::vector<unsigned int> slicesQuality_; | 130 bool volumeImageReadyInHighQuality_; |
131 bool volumeImageReadyInHighQuality_; | 131 boost::shared_ptr<ISlicePostProcessor> slicePostProcessor_; |
132 | |
133 boost::shared_ptr<ISlicePostProcessor> slicePostProcessor_; | |
134 | 132 |
135 /** See priority setters/getters below */ | 133 /** See priority setters/getters below */ |
136 int medadataSchedulingPriority_; | 134 int medadataSchedulingPriority_; |
137 | 135 |
138 /** See priority setters/getters below */ | 136 /** See priority setters/getters below */ |
139 int sliceSchedulingPriority_; | 137 int sliceSchedulingPriority_; |
140 | 138 |
141 OrthancSeriesVolumeProgressiveLoader( | 139 OrthancSeriesVolumeProgressiveLoader( |
142 OrthancStone::ILoadersContext& loadersContext, | 140 ILoadersContext& loadersContext, |
143 boost::shared_ptr<OrthancStone::DicomVolumeImage> volume, | 141 boost::shared_ptr<DicomVolumeImage> volume, |
144 bool progressiveQuality); | 142 bool progressiveQuality); |
145 | 143 |
146 public: | 144 public: |
147 ORTHANC_STONE_DEFINE_ORIGIN_MESSAGE(__FILE__, __LINE__, VolumeImageReadyInHighQuality, OrthancSeriesVolumeProgressiveLoader); | 145 ORTHANC_STONE_DEFINE_ORIGIN_MESSAGE(__FILE__, __LINE__, VolumeImageReadyInHighQuality, OrthancSeriesVolumeProgressiveLoader); |
148 | 146 |
149 /** | 147 /** |
150 See doc for the progressiveQuality_ field | 148 See doc for the progressiveQuality_ field |
151 */ | 149 */ |
152 static boost::shared_ptr<OrthancSeriesVolumeProgressiveLoader> Create( | 150 static boost::shared_ptr<OrthancSeriesVolumeProgressiveLoader> Create( |
153 OrthancStone::ILoadersContext& context, | 151 ILoadersContext& context, |
154 boost::shared_ptr<OrthancStone::DicomVolumeImage> volume, | 152 boost::shared_ptr<DicomVolumeImage> volume, |
155 bool progressiveQuality = false); | 153 bool progressiveQuality = false); |
156 | 154 |
157 virtual ~OrthancSeriesVolumeProgressiveLoader(); | 155 virtual ~OrthancSeriesVolumeProgressiveLoader(); |
158 | 156 |
159 void SetSimultaneousDownloads(unsigned int count); | 157 void SetSimultaneousDownloads(unsigned int count); |
210 } | 208 } |
211 | 209 |
212 /** | 210 /** |
213 Same remark as HasGeometry | 211 Same remark as HasGeometry |
214 */ | 212 */ |
215 const OrthancStone::VolumeImageGeometry& GetImageGeometry() const ORTHANC_OVERRIDE | 213 const VolumeImageGeometry& GetImageGeometry() const ORTHANC_OVERRIDE |
216 { | 214 { |
217 return seriesGeometry_.GetImageGeometry(); | 215 return seriesGeometry_.GetImageGeometry(); |
218 } | 216 } |
219 | 217 |
220 /** | 218 /** |
221 When a slice is requested, the strategy algorithm (that defines the | 219 When a slice is requested, the strategy algorithm (that defines the |
222 sequence of resources to be loaded from the server) is modified to | 220 sequence of resources to be loaded from the server) is modified to |
223 take into account this request (this is done in the ExtractedSlice ctor) | 221 take into account this request (this is done in the ExtractedSlice ctor) |
224 */ | 222 */ |
225 virtual IExtractedSlice* | 223 virtual IExtractedSlice* |
226 ExtractSlice(const OrthancStone::CoordinateSystem3D& cuttingPlane) ORTHANC_OVERRIDE; | 224 ExtractSlice(const CoordinateSystem3D& cuttingPlane) ORTHANC_OVERRIDE; |
227 }; | 225 }; |
228 } | 226 } |