Mercurial > hg > orthanc-stone
comparison Framework/Deprecated/Loaders/OrthancSeriesVolumeProgressiveLoader.cpp @ 1299:c38c89684d83 broker
replacing std::auto_ptr by std::unique_ptr
author | Sebastien Jodogne <s.jodogne@gmail.com> |
---|---|
date | Mon, 02 Mar 2020 17:21:24 +0100 |
parents | 7ec8fea061b9 |
children | 257f2c9a02ac |
comparison
equal
deleted
inserted
replaced
1297:6ab03e429f06 | 1299:c38c89684d83 |
---|---|
269 if (instance.empty()) | 269 if (instance.empty()) |
270 { | 270 { |
271 throw Orthanc::OrthancException(Orthanc::ErrorCode_InternalError); | 271 throw Orthanc::OrthancException(Orthanc::ErrorCode_InternalError); |
272 } | 272 } |
273 | 273 |
274 std::auto_ptr<OrthancStone::OracleCommandBase> command; | 274 std::unique_ptr<OrthancStone::OracleCommandBase> command; |
275 | 275 |
276 if (quality == BEST_QUALITY) | 276 if (quality == BEST_QUALITY) |
277 { | 277 { |
278 std::auto_ptr<OrthancStone::GetOrthancImageCommand> tmp(new OrthancStone::GetOrthancImageCommand); | 278 std::unique_ptr<OrthancStone::GetOrthancImageCommand> tmp(new OrthancStone::GetOrthancImageCommand); |
279 // TODO: review the following comment. | 279 // TODO: review the following comment. |
280 // - Commented out by bgo on 2019-07-19 | reason: Alain has seen cases | 280 // - Commented out by bgo on 2019-07-19 | reason: Alain has seen cases |
281 // where gzipping the uint16 image took 11 sec to produce 5mb. | 281 // where gzipping the uint16 image took 11 sec to produce 5mb. |
282 // The unzipped request was much much faster. | 282 // The unzipped request was much much faster. |
283 // - Re-enabled on 2019-07-30. Reason: in Web Assembly, the browser | 283 // - Re-enabled on 2019-07-30. Reason: in Web Assembly, the browser |
289 tmp->SetExpectedPixelFormat(slice.GetExpectedPixelFormat()); | 289 tmp->SetExpectedPixelFormat(slice.GetExpectedPixelFormat()); |
290 command.reset(tmp.release()); | 290 command.reset(tmp.release()); |
291 } | 291 } |
292 else | 292 else |
293 { | 293 { |
294 std::auto_ptr<OrthancStone::GetOrthancWebViewerJpegCommand> tmp(new OrthancStone::GetOrthancWebViewerJpegCommand); | 294 std::unique_ptr<OrthancStone::GetOrthancWebViewerJpegCommand> tmp(new OrthancStone::GetOrthancWebViewerJpegCommand); |
295 // TODO: review the following comment. Commented out by bgo on 2019-07-19 | 295 // TODO: review the following comment. Commented out by bgo on 2019-07-19 |
296 // (gzip for jpeg seems overkill) | 296 // (gzip for jpeg seems overkill) |
297 //tmp->SetHttpHeader("Accept-Encoding", "gzip"); | 297 //tmp->SetHttpHeader("Accept-Encoding", "gzip"); |
298 tmp->SetInstance(instance); | 298 tmp->SetInstance(instance); |
299 tmp->SetQuality((quality == 0 ? 50 : 90)); | 299 tmp->SetQuality((quality == 0 ? 50 : 90)); |
335 for (size_t i = 0; i < instances.size(); i++) | 335 for (size_t i = 0; i < instances.size(); i++) |
336 { | 336 { |
337 Orthanc::DicomMap dicom; | 337 Orthanc::DicomMap dicom; |
338 dicom.FromDicomAsJson(body[instances[i]]); | 338 dicom.FromDicomAsJson(body[instances[i]]); |
339 | 339 |
340 std::auto_ptr<OrthancStone::DicomInstanceParameters> instance(new OrthancStone::DicomInstanceParameters(dicom)); | 340 std::unique_ptr<OrthancStone::DicomInstanceParameters> instance(new OrthancStone::DicomInstanceParameters(dicom)); |
341 instance->SetOrthancInstanceIdentifier(instances[i]); | 341 instance->SetOrthancInstanceIdentifier(instances[i]); |
342 | 342 |
343 // the 3D plane corresponding to the slice | 343 // the 3D plane corresponding to the slice |
344 OrthancStone::CoordinateSystem3D geometry = instance->GetGeometry(); | 344 OrthancStone::CoordinateSystem3D geometry = instance->GetGeometry(); |
345 slices.AddSlice(geometry, instance.release()); | 345 slices.AddSlice(geometry, instance.release()); |
485 } | 485 } |
486 else | 486 else |
487 { | 487 { |
488 active_ = true; | 488 active_ = true; |
489 | 489 |
490 std::auto_ptr<OrthancStone::OrthancRestApiCommand> command(new OrthancStone::OrthancRestApiCommand); | 490 std::unique_ptr<OrthancStone::OrthancRestApiCommand> command(new OrthancStone::OrthancRestApiCommand); |
491 command->SetUri("/series/" + seriesId + "/instances-tags"); | 491 command->SetUri("/series/" + seriesId + "/instances-tags"); |
492 | 492 |
493 // LOG(TRACE) << "OrthancSeriesVolumeProgressiveLoader::LoadSeries about to call oracle_.Schedule"; | 493 // LOG(TRACE) << "OrthancSeriesVolumeProgressiveLoader::LoadSeries about to call oracle_.Schedule"; |
494 boost::shared_ptr<IObserver> observer(GetSharedObserver()); | 494 boost::shared_ptr<IObserver> observer(GetSharedObserver()); |
495 oracle_.Schedule(observer, command.release()); | 495 oracle_.Schedule(observer, command.release()); |