Mercurial > hg > orthanc-stone
comparison Framework/Toolbox/OrthancSlicesLoader.h @ 421:f87f28624b96 cache-in-radiography
tentative to make SmartLoader and RadiographyScene work together (not really working)
author | am@osimis.io |
---|---|
date | Tue, 20 Nov 2018 16:35:29 +0100 |
parents | 5d359b115b29 |
children |
comparison
equal
deleted
inserted
replaced
420:8bf717c4e497 | 421:f87f28624b96 |
---|---|
26 #include "IWebService.h" | 26 #include "IWebService.h" |
27 #include "OrthancApiClient.h" | 27 #include "OrthancApiClient.h" |
28 #include "SlicesSorter.h" | 28 #include "SlicesSorter.h" |
29 | 29 |
30 #include <Core/Images/Image.h> | 30 #include <Core/Images/Image.h> |
31 #include <Plugins/Samples/Common/FullOrthancDataset.h> | |
31 | 32 |
32 | 33 |
33 namespace OrthancStone | 34 namespace OrthancStone |
34 { | 35 { |
35 class OrthancSlicesLoader : public IObservable, public IObserver | 36 class OrthancSlicesLoader : public IObservable, public IObserver |
37 public: | 38 public: |
38 | 39 |
39 typedef OriginMessage<MessageType_SliceLoader_GeometryReady, OrthancSlicesLoader> SliceGeometryReadyMessage; | 40 typedef OriginMessage<MessageType_SliceLoader_GeometryReady, OrthancSlicesLoader> SliceGeometryReadyMessage; |
40 typedef OriginMessage<MessageType_SliceLoader_GeometryError, OrthancSlicesLoader> SliceGeometryErrorMessage; | 41 typedef OriginMessage<MessageType_SliceLoader_GeometryError, OrthancSlicesLoader> SliceGeometryErrorMessage; |
41 | 42 |
43 class SliceTagsReadyMessage : public OriginMessage<MessageType_SliceLoader_TagsReady, OrthancSlicesLoader> | |
44 { | |
45 private: | |
46 const OrthancPlugins::FullOrthancDataset& dicomTags_; | |
47 public: | |
48 SliceTagsReadyMessage(OrthancSlicesLoader& origin, | |
49 const OrthancPlugins::FullOrthancDataset& dicomTags) : | |
50 OriginMessage(origin), | |
51 dicomTags_(dicomTags) | |
52 { | |
53 } | |
54 | |
55 const OrthancPlugins::FullOrthancDataset& GetDicomTags() const | |
56 { | |
57 return dicomTags_; | |
58 } | |
59 }; | |
60 | |
42 class SliceImageReadyMessage : | 61 class SliceImageReadyMessage : |
43 public OriginMessage<MessageType_SliceLoader_ImageReady, OrthancSlicesLoader> | 62 public OriginMessage<MessageType_SliceLoader_ImageReady, OrthancSlicesLoader> |
44 { | 63 { |
45 private: | 64 private: |
46 unsigned int sliceIndex_; | 65 unsigned int sliceIndex_; |
47 const Slice& slice_; | 66 const Slice& slice_; |
48 const Orthanc::ImageAccessor& image_; | 67 const Orthanc::ImageAccessor& image_; |
78 } | 97 } |
79 | 98 |
80 SliceImageQuality GetEffectiveQuality() const | 99 SliceImageQuality GetEffectiveQuality() const |
81 { | 100 { |
82 return effectiveQuality_; | 101 return effectiveQuality_; |
83 } | 102 } |
84 }; | 103 }; |
85 | 104 |
86 | 105 |
87 class SliceImageErrorMessage : | 106 class SliceImageErrorMessage : |
88 public OriginMessage<MessageType_SliceLoader_ImageError, OrthancSlicesLoader> | 107 public OriginMessage<MessageType_SliceLoader_ImageError, OrthancSlicesLoader> |
89 { | 108 { |
90 private: | 109 private: |
91 const Slice& slice_; | 110 const Slice& slice_; |
92 unsigned int sliceIndex_; | 111 unsigned int sliceIndex_; |
93 SliceImageQuality effectiveQuality_; | 112 SliceImageQuality effectiveQuality_; |
114 } | 133 } |
115 | 134 |
116 SliceImageQuality GetEffectiveQuality() const | 135 SliceImageQuality GetEffectiveQuality() const |
117 { | 136 { |
118 return effectiveQuality_; | 137 return effectiveQuality_; |
119 } | 138 } |
120 }; | 139 }; |
121 | 140 |
122 private: | 141 private: |
123 enum State | 142 enum State |
124 { | 143 { |
175 | 194 |
176 void ScheduleSliceImageJpeg(const Slice& slice, | 195 void ScheduleSliceImageJpeg(const Slice& slice, |
177 size_t index, | 196 size_t index, |
178 SliceImageQuality quality); | 197 SliceImageQuality quality); |
179 | 198 |
180 void SortAndFinalizeSlices(); | 199 void SortAndFinalizeSlices(const OrthancPlugins::FullOrthancDataset& dicomTags); |
181 | 200 |
182 public: | 201 public: |
183 OrthancSlicesLoader(MessageBroker& broker, | 202 OrthancSlicesLoader(MessageBroker& broker, |
184 //ISliceLoaderObserver& callback, | 203 //ISliceLoaderObserver& callback, |
185 OrthancApiClient& orthancApi); | 204 OrthancApiClient& orthancApi); |