Mercurial > hg > orthanc-stone
comparison Framework/Toolbox/OrthancSlicesLoader.cpp @ 623:42dadae61fa9
renamed IObservable::EmitMessage() as BroadcastMessage()
author | Sebastien Jodogne <s.jodogne@gmail.com> |
---|---|
date | Tue, 07 May 2019 14:16:08 +0200 |
parents | b70e9be013e4 |
children | 6af3099ed8da |
comparison
equal
deleted
inserted
replaced
622:8a3a25f2d42c | 623:42dadae61fa9 |
---|---|
175 void OrthancSlicesLoader::NotifySliceImageSuccess(const Operation& operation, | 175 void OrthancSlicesLoader::NotifySliceImageSuccess(const Operation& operation, |
176 const Orthanc::ImageAccessor& image) | 176 const Orthanc::ImageAccessor& image) |
177 { | 177 { |
178 OrthancSlicesLoader::SliceImageReadyMessage msg | 178 OrthancSlicesLoader::SliceImageReadyMessage msg |
179 (*this, operation.GetSliceIndex(), operation.GetSlice(), image, operation.GetQuality()); | 179 (*this, operation.GetSliceIndex(), operation.GetSlice(), image, operation.GetQuality()); |
180 EmitMessage(msg); | 180 BroadcastMessage(msg); |
181 } | 181 } |
182 | 182 |
183 | 183 |
184 void OrthancSlicesLoader::NotifySliceImageError(const Operation& operation) | 184 void OrthancSlicesLoader::NotifySliceImageError(const Operation& operation) |
185 { | 185 { |
186 OrthancSlicesLoader::SliceImageErrorMessage msg | 186 OrthancSlicesLoader::SliceImageErrorMessage msg |
187 (*this, operation.GetSliceIndex(), operation.GetSlice(), operation.GetQuality()); | 187 (*this, operation.GetSliceIndex(), operation.GetSlice(), operation.GetQuality()); |
188 EmitMessage(msg); | 188 BroadcastMessage(msg); |
189 } | 189 } |
190 | 190 |
191 | 191 |
192 void OrthancSlicesLoader::SortAndFinalizeSlices() | 192 void OrthancSlicesLoader::SortAndFinalizeSlices() |
193 { | 193 { |
208 state_ = State_GeometryReady; | 208 state_ = State_GeometryReady; |
209 | 209 |
210 if (ok) | 210 if (ok) |
211 { | 211 { |
212 LOG(INFO) << "Loaded a series with " << slices_.GetSliceCount() << " slice(s)"; | 212 LOG(INFO) << "Loaded a series with " << slices_.GetSliceCount() << " slice(s)"; |
213 EmitMessage(SliceGeometryReadyMessage(*this)); | 213 BroadcastMessage(SliceGeometryReadyMessage(*this)); |
214 } | 214 } |
215 else | 215 else |
216 { | 216 { |
217 LOG(ERROR) << "This series is empty"; | 217 LOG(ERROR) << "This series is empty"; |
218 EmitMessage(SliceGeometryErrorMessage(*this)); | 218 BroadcastMessage(SliceGeometryErrorMessage(*this)); |
219 } | 219 } |
220 } | 220 } |
221 | 221 |
222 void OrthancSlicesLoader::OnGeometryError(const IWebService::HttpRequestErrorMessage& message) | 222 void OrthancSlicesLoader::OnGeometryError(const IWebService::HttpRequestErrorMessage& message) |
223 { | 223 { |
224 EmitMessage(SliceGeometryErrorMessage(*this)); | 224 BroadcastMessage(SliceGeometryErrorMessage(*this)); |
225 state_ = State_Error; | 225 state_ = State_Error; |
226 } | 226 } |
227 | 227 |
228 void OrthancSlicesLoader::OnSliceImageError(const IWebService::HttpRequestErrorMessage& message) | 228 void OrthancSlicesLoader::OnSliceImageError(const IWebService::HttpRequestErrorMessage& message) |
229 { | 229 { |
294 slices_.AddSlice(slice.release()); | 294 slices_.AddSlice(slice.release()); |
295 } | 295 } |
296 else | 296 else |
297 { | 297 { |
298 LOG(WARNING) << "Skipping invalid multi-frame instance " << instanceId; | 298 LOG(WARNING) << "Skipping invalid multi-frame instance " << instanceId; |
299 EmitMessage(SliceGeometryErrorMessage(*this)); | 299 BroadcastMessage(SliceGeometryErrorMessage(*this)); |
300 return; | 300 return; |
301 } | 301 } |
302 } | 302 } |
303 | 303 |
304 SortAndFinalizeSlices(); | 304 SortAndFinalizeSlices(); |
321 std::auto_ptr<Slice> slice(new Slice); | 321 std::auto_ptr<Slice> slice(new Slice); |
322 if (slice->ParseOrthancFrame(dicom, instanceId, frame)) | 322 if (slice->ParseOrthancFrame(dicom, instanceId, frame)) |
323 { | 323 { |
324 LOG(INFO) << "Loaded instance geometry " << instanceId; | 324 LOG(INFO) << "Loaded instance geometry " << instanceId; |
325 slices_.AddSlice(slice.release()); | 325 slices_.AddSlice(slice.release()); |
326 EmitMessage(SliceGeometryReadyMessage(*this)); | 326 BroadcastMessage(SliceGeometryReadyMessage(*this)); |
327 } | 327 } |
328 else | 328 else |
329 { | 329 { |
330 LOG(WARNING) << "Skipping invalid instance " << instanceId; | 330 LOG(WARNING) << "Skipping invalid instance " << instanceId; |
331 EmitMessage(SliceGeometryErrorMessage(*this)); | 331 BroadcastMessage(SliceGeometryErrorMessage(*this)); |
332 } | 332 } |
333 } | 333 } |
334 | 334 |
335 | 335 |
336 void OrthancSlicesLoader::ParseSliceImagePng(const OrthancApiClient::BinaryResponseReadyMessage& message) | 336 void OrthancSlicesLoader::ParseSliceImagePng(const OrthancApiClient::BinaryResponseReadyMessage& message) |