Mercurial > hg > orthanc-stone
comparison Framework/Deprecated/Loaders/OrthancMultiframeVolumeLoader.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 | 6ab03e429f06 |
children | 257f2c9a02ac |
comparison
equal
deleted
inserted
replaced
1297:6ab03e429f06 | 1299:c38c89684d83 |
---|---|
27 namespace Deprecated | 27 namespace Deprecated |
28 { | 28 { |
29 class OrthancMultiframeVolumeLoader::LoadRTDoseGeometry : public LoaderStateMachine::State | 29 class OrthancMultiframeVolumeLoader::LoadRTDoseGeometry : public LoaderStateMachine::State |
30 { | 30 { |
31 private: | 31 private: |
32 std::auto_ptr<Orthanc::DicomMap> dicom_; | 32 std::unique_ptr<Orthanc::DicomMap> dicom_; |
33 | 33 |
34 public: | 34 public: |
35 LoadRTDoseGeometry(OrthancMultiframeVolumeLoader& that, | 35 LoadRTDoseGeometry(OrthancMultiframeVolumeLoader& that, |
36 Orthanc::DicomMap* dicom) : | 36 Orthanc::DicomMap* dicom) : |
37 State(that), | 37 State(that), |
88 if (body.type() != Json::objectValue) | 88 if (body.type() != Json::objectValue) |
89 { | 89 { |
90 throw Orthanc::OrthancException(Orthanc::ErrorCode_NetworkProtocol); | 90 throw Orthanc::OrthancException(Orthanc::ErrorCode_NetworkProtocol); |
91 } | 91 } |
92 | 92 |
93 std::auto_ptr<Orthanc::DicomMap> dicom(new Orthanc::DicomMap); | 93 std::unique_ptr<Orthanc::DicomMap> dicom(new Orthanc::DicomMap); |
94 dicom->FromDicomAsJson(body); | 94 dicom->FromDicomAsJson(body); |
95 | 95 |
96 if (OrthancStone::StringToSopClassUid(GetSopClassUid(*dicom)) == OrthancStone::SopClassUid_RTDose) | 96 if (OrthancStone::StringToSopClassUid(GetSopClassUid(*dicom)) == OrthancStone::SopClassUid_RTDose) |
97 { | 97 { |
98 // Download the "Grid Frame Offset Vector" DICOM tag, that is | 98 // Download the "Grid Frame Offset Vector" DICOM tag, that is |
99 // mandatory for RT-DOSE, but is too long to be returned by default | 99 // mandatory for RT-DOSE, but is too long to be returned by default |
100 | 100 |
101 std::auto_ptr<OrthancStone::OrthancRestApiCommand> command(new OrthancStone::OrthancRestApiCommand); | 101 std::unique_ptr<OrthancStone::OrthancRestApiCommand> command(new OrthancStone::OrthancRestApiCommand); |
102 command->SetUri("/instances/" + loader.GetInstanceId() + "/content/" + | 102 command->SetUri("/instances/" + loader.GetInstanceId() + "/content/" + |
103 Orthanc::DICOM_TAG_GRID_FRAME_OFFSET_VECTOR.Format()); | 103 Orthanc::DICOM_TAG_GRID_FRAME_OFFSET_VECTOR.Format()); |
104 command->AcquirePayload(new LoadRTDoseGeometry(loader, dicom.release())); | 104 command->AcquirePayload(new LoadRTDoseGeometry(loader, dicom.release())); |
105 | 105 |
106 Schedule(command.release()); | 106 Schedule(command.release()); |
169 */ | 169 */ |
170 if (transferSyntaxUid_ == "1.2.840.10008.1.2" || | 170 if (transferSyntaxUid_ == "1.2.840.10008.1.2" || |
171 transferSyntaxUid_ == "1.2.840.10008.1.2.1" || | 171 transferSyntaxUid_ == "1.2.840.10008.1.2.1" || |
172 transferSyntaxUid_ == "1.2.840.10008.1.2.2") | 172 transferSyntaxUid_ == "1.2.840.10008.1.2.2") |
173 { | 173 { |
174 std::auto_ptr<OrthancStone::OrthancRestApiCommand> command(new OrthancStone::OrthancRestApiCommand); | 174 std::unique_ptr<OrthancStone::OrthancRestApiCommand> command(new OrthancStone::OrthancRestApiCommand); |
175 command->SetHttpHeader("Accept-Encoding", "gzip"); | 175 command->SetHttpHeader("Accept-Encoding", "gzip"); |
176 command->SetUri("/instances/" + instanceId_ + "/content/" + | 176 command->SetUri("/instances/" + instanceId_ + "/content/" + |
177 Orthanc::DICOM_TAG_PIXEL_DATA.Format() + "/0"); | 177 Orthanc::DICOM_TAG_PIXEL_DATA.Format() + "/0"); |
178 command->AcquirePayload(new LoadUncompressedPixelData(*this)); | 178 command->AcquirePayload(new LoadUncompressedPixelData(*this)); |
179 Schedule(command.release()); | 179 Schedule(command.release()); |
560 Start(); | 560 Start(); |
561 | 561 |
562 instanceId_ = instanceId; | 562 instanceId_ = instanceId; |
563 | 563 |
564 { | 564 { |
565 std::auto_ptr<OrthancStone::OrthancRestApiCommand> command(new OrthancStone::OrthancRestApiCommand); | 565 std::unique_ptr<OrthancStone::OrthancRestApiCommand> command(new OrthancStone::OrthancRestApiCommand); |
566 command->SetHttpHeader("Accept-Encoding", "gzip"); | 566 command->SetHttpHeader("Accept-Encoding", "gzip"); |
567 command->SetUri("/instances/" + instanceId + "/tags"); | 567 command->SetUri("/instances/" + instanceId + "/tags"); |
568 command->AcquirePayload(new LoadGeometry(*this)); | 568 command->AcquirePayload(new LoadGeometry(*this)); |
569 Schedule(command.release()); | 569 Schedule(command.release()); |
570 } | 570 } |
571 | 571 |
572 { | 572 { |
573 std::auto_ptr<OrthancStone::OrthancRestApiCommand> command(new OrthancStone::OrthancRestApiCommand); | 573 std::unique_ptr<OrthancStone::OrthancRestApiCommand> command(new OrthancStone::OrthancRestApiCommand); |
574 command->SetUri("/instances/" + instanceId + "/metadata/TransferSyntax"); | 574 command->SetUri("/instances/" + instanceId + "/metadata/TransferSyntax"); |
575 command->AcquirePayload(new LoadTransferSyntax(*this)); | 575 command->AcquirePayload(new LoadTransferSyntax(*this)); |
576 Schedule(command.release()); | 576 Schedule(command.release()); |
577 } | 577 } |
578 } | 578 } |