Mercurial > hg > orthanc-stone
comparison Framework/Deprecated/Loaders/OrthancSeriesVolumeProgressiveLoader.h @ 1327:4f8db2d202c8 broker
OrthancSeriesProgressiveLoader now has two modes that
can be selected at object creation :
- progressive (will first load jpeg50, then jpeg90 then PAM)
- non-progressive (will directly load PAM (uncompressed))
Please note that the slice loading order remains dynamic
and depending upon the slice that the client code wishes
to extract from the volume.
author | Benjamin Golinvaux <bgo@osimis.io> |
---|---|
date | Wed, 25 Mar 2020 14:34:27 +0100 |
parents | 7702ad9b7011 |
children |
comparison
equal
deleted
inserted
replaced
1326:55166e57a77c | 1327:4f8db2d202c8 |
---|---|
36 #include "../Volumes/IGeometryProvider.h" | 36 #include "../Volumes/IGeometryProvider.h" |
37 | 37 |
38 | 38 |
39 #include <boost/shared_ptr.hpp> | 39 #include <boost/shared_ptr.hpp> |
40 | 40 |
41 #define USE_SINGLE_QUALITY 1 | |
42 | |
43 | |
44 namespace OrthancStone | 41 namespace OrthancStone |
45 { | 42 { |
46 class ILoadersContext; | 43 class ILoadersContext; |
47 } | 44 } |
48 | 45 |
57 public OrthancStone::IObservable, | 54 public OrthancStone::IObservable, |
58 public OrthancStone::IVolumeSlicer, | 55 public OrthancStone::IVolumeSlicer, |
59 public IGeometryProvider | 56 public IGeometryProvider |
60 { | 57 { |
61 private: | 58 private: |
62 #if USE_SINGLE_QUALITY | 59 static const unsigned int QUALITY_00 = 0; |
63 static const unsigned int SINGLE_QUALITY = 0; | 60 static const unsigned int QUALITY_01 = 1; |
64 #else | 61 static const unsigned int QUALITY_02 = 2; |
65 static const unsigned int LOW_QUALITY = 0; | 62 |
66 static const unsigned int MIDDLE_QUALITY = 1; | |
67 static const unsigned int BEST_QUALITY = 2; | |
68 #endif | |
69 | |
70 | |
71 class ExtractedSlice; | 63 class ExtractedSlice; |
72 | 64 |
73 /** Helper class internal to OrthancSeriesVolumeProgressiveLoader */ | 65 /** Helper class internal to OrthancSeriesVolumeProgressiveLoader */ |
74 class SeriesGeometry : public boost::noncopyable | 66 class SeriesGeometry : public boost::noncopyable |
75 { | 67 { |
117 const Orthanc::ImageAccessor& image, | 109 const Orthanc::ImageAccessor& image, |
118 unsigned int quality); | 110 unsigned int quality); |
119 | 111 |
120 void LoadBestQualitySliceContent(const OrthancStone::GetOrthancImageCommand::SuccessMessage& message); | 112 void LoadBestQualitySliceContent(const OrthancStone::GetOrthancImageCommand::SuccessMessage& message); |
121 | 113 |
122 #if USE_SINGLE_QUALITY | |
123 #else | |
124 void LoadJpegSliceContent(const OrthancStone::GetOrthancWebViewerJpegCommand::SuccessMessage& message); | 114 void LoadJpegSliceContent(const OrthancStone::GetOrthancWebViewerJpegCommand::SuccessMessage& message); |
125 #endif | |
126 | 115 |
127 OrthancStone::ILoadersContext& loadersContext_; | 116 OrthancStone::ILoadersContext& loadersContext_; |
128 bool active_; | 117 bool active_; |
118 bool progressiveQuality_; | |
129 unsigned int simultaneousDownloads_; | 119 unsigned int simultaneousDownloads_; |
130 SeriesGeometry seriesGeometry_; | 120 SeriesGeometry seriesGeometry_; |
131 boost::shared_ptr<OrthancStone::DicomVolumeImage> volume_; | 121 boost::shared_ptr<OrthancStone::DicomVolumeImage> volume_; |
132 std::unique_ptr<OrthancStone::IFetchingItemsSorter::IFactory> sorter_; | 122 std::unique_ptr<OrthancStone::IFetchingItemsSorter::IFactory> sorter_; |
133 std::unique_ptr<OrthancStone::IFetchingStrategy> strategy_; | 123 std::unique_ptr<OrthancStone::IFetchingStrategy> strategy_; |
134 std::vector<unsigned int> slicesQuality_; | 124 std::vector<unsigned int> slicesQuality_; |
135 bool volumeImageReadyInHighQuality_; | 125 bool volumeImageReadyInHighQuality_; |
136 | 126 |
137 | |
138 OrthancSeriesVolumeProgressiveLoader( | 127 OrthancSeriesVolumeProgressiveLoader( |
139 OrthancStone::ILoadersContext& loadersContext, | 128 OrthancStone::ILoadersContext& loadersContext, |
140 const boost::shared_ptr<OrthancStone::DicomVolumeImage>& volume); | 129 boost::shared_ptr<OrthancStone::DicomVolumeImage> volume, |
130 bool progressiveQuality); | |
141 | 131 |
142 public: | 132 public: |
143 ORTHANC_STONE_DEFINE_ORIGIN_MESSAGE(__FILE__, __LINE__, VolumeImageReadyInHighQuality, OrthancSeriesVolumeProgressiveLoader); | 133 ORTHANC_STONE_DEFINE_ORIGIN_MESSAGE(__FILE__, __LINE__, VolumeImageReadyInHighQuality, OrthancSeriesVolumeProgressiveLoader); |
144 | 134 |
135 /** | |
136 See doc for the progressiveQuality_ field | |
137 */ | |
145 static boost::shared_ptr<OrthancSeriesVolumeProgressiveLoader> Create( | 138 static boost::shared_ptr<OrthancSeriesVolumeProgressiveLoader> Create( |
146 OrthancStone::ILoadersContext& context, | 139 OrthancStone::ILoadersContext& context, |
147 const boost::shared_ptr<OrthancStone::DicomVolumeImage>& volume); | 140 boost::shared_ptr<OrthancStone::DicomVolumeImage> volume, |
141 bool progressiveQuality = false); | |
148 | 142 |
149 virtual ~OrthancSeriesVolumeProgressiveLoader(); | 143 virtual ~OrthancSeriesVolumeProgressiveLoader(); |
150 | 144 |
151 void SetSimultaneousDownloads(unsigned int count); | 145 void SetSimultaneousDownloads(unsigned int count); |
152 | 146 |