comparison Framework/Loaders/OrthancSeriesVolumeProgressiveLoader.cpp @ 1298:8a0a62189f46

replacing std::auto_ptr by std::unique_ptr
author Sebastien Jodogne <s.jodogne@gmail.com>
date Mon, 02 Mar 2020 16:31:30 +0100
parents 2d8ab34c8c91
children f4a06ad1580b
comparison
equal deleted inserted replaced
1296:86400fa16091 1298:8a0a62189f46
259 if (instance.empty()) 259 if (instance.empty())
260 { 260 {
261 throw Orthanc::OrthancException(Orthanc::ErrorCode_InternalError); 261 throw Orthanc::OrthancException(Orthanc::ErrorCode_InternalError);
262 } 262 }
263 263
264 std::auto_ptr<OracleCommandWithPayload> command; 264 std::unique_ptr<OracleCommandWithPayload> command;
265 265
266 if (quality == BEST_QUALITY) 266 if (quality == BEST_QUALITY)
267 { 267 {
268 std::auto_ptr<GetOrthancImageCommand> tmp(new GetOrthancImageCommand); 268 std::unique_ptr<GetOrthancImageCommand> tmp(new GetOrthancImageCommand);
269 // TODO: review the following comment. 269 // TODO: review the following comment.
270 // - Commented out by bgo on 2019-07-19 | reason: Alain has seen cases 270 // - Commented out by bgo on 2019-07-19 | reason: Alain has seen cases
271 // where gzipping the uint16 image took 11 sec to produce 5mb. 271 // where gzipping the uint16 image took 11 sec to produce 5mb.
272 // The unzipped request was much much faster. 272 // The unzipped request was much much faster.
273 // - Re-enabled on 2019-07-30. Reason: in Web Assembly, the browser 273 // - Re-enabled on 2019-07-30. Reason: in Web Assembly, the browser
279 tmp->SetExpectedPixelFormat(slice.GetExpectedPixelFormat()); 279 tmp->SetExpectedPixelFormat(slice.GetExpectedPixelFormat());
280 command.reset(tmp.release()); 280 command.reset(tmp.release());
281 } 281 }
282 else 282 else
283 { 283 {
284 std::auto_ptr<GetOrthancWebViewerJpegCommand> tmp(new GetOrthancWebViewerJpegCommand); 284 std::unique_ptr<GetOrthancWebViewerJpegCommand> tmp(new GetOrthancWebViewerJpegCommand);
285 // TODO: review the following comment. Commented out by bgo on 2019-07-19 285 // TODO: review the following comment. Commented out by bgo on 2019-07-19
286 // (gzip for jpeg seems overkill) 286 // (gzip for jpeg seems overkill)
287 //tmp->SetHttpHeader("Accept-Encoding", "gzip"); 287 //tmp->SetHttpHeader("Accept-Encoding", "gzip");
288 tmp->SetInstance(instance); 288 tmp->SetInstance(instance);
289 tmp->SetQuality((quality == 0 ? 50 : 90)); 289 tmp->SetQuality((quality == 0 ? 50 : 90));
323 for (size_t i = 0; i < instances.size(); i++) 323 for (size_t i = 0; i < instances.size(); i++)
324 { 324 {
325 Orthanc::DicomMap dicom; 325 Orthanc::DicomMap dicom;
326 dicom.FromDicomAsJson(body[instances[i]]); 326 dicom.FromDicomAsJson(body[instances[i]]);
327 327
328 std::auto_ptr<DicomInstanceParameters> instance(new DicomInstanceParameters(dicom)); 328 std::unique_ptr<DicomInstanceParameters> instance(new DicomInstanceParameters(dicom));
329 instance->SetOrthancInstanceIdentifier(instances[i]); 329 instance->SetOrthancInstanceIdentifier(instances[i]);
330 330
331 // the 3D plane corresponding to the slice 331 // the 3D plane corresponding to the slice
332 CoordinateSystem3D geometry = instance->GetGeometry(); 332 CoordinateSystem3D geometry = instance->GetGeometry();
333 slices.AddSlice(geometry, instance.release()); 333 slices.AddSlice(geometry, instance.release());
479 } 479 }
480 else 480 else
481 { 481 {
482 active_ = true; 482 active_ = true;
483 483
484 std::auto_ptr<OrthancRestApiCommand> command(new OrthancRestApiCommand); 484 std::unique_ptr<OrthancRestApiCommand> command(new OrthancRestApiCommand);
485 command->SetUri("/series/" + seriesId + "/instances-tags"); 485 command->SetUri("/series/" + seriesId + "/instances-tags");
486 486
487 // LOG(TRACE) << "OrthancSeriesVolumeProgressiveLoader::LoadSeries about to call oracle_.Schedule"; 487 // LOG(TRACE) << "OrthancSeriesVolumeProgressiveLoader::LoadSeries about to call oracle_.Schedule";
488 oracle_.Schedule(*this, command.release()); 488 oracle_.Schedule(*this, command.release());
489 // LOG(TRACE) << "OrthancSeriesVolumeProgressiveLoader::LoadSeries called oracle_.Schedule"; 489 // LOG(TRACE) << "OrthancSeriesVolumeProgressiveLoader::LoadSeries called oracle_.Schedule";