Mercurial > hg > orthanc
comparison OrthancServer/Sources/ServerJobs/Operations/ModifyInstanceOperation.cpp @ 4508:8f9090b137f1
Optimization in C-STORE SCP by avoiding an unnecessary DICOM parsing
author | Sebastien Jodogne <s.jodogne@gmail.com> |
---|---|
date | Thu, 11 Feb 2021 11:00:05 +0100 |
parents | d9473bd5ed43 |
children | f0038043fb97 7053502fbf97 |
comparison
equal
deleted
inserted
replaced
4507:b4c58795f3a8 | 4508:8f9090b137f1 |
---|---|
102 | 102 |
103 try | 103 try |
104 { | 104 { |
105 modification_->Apply(*modified); | 105 modification_->Apply(*modified); |
106 | 106 |
107 DicomInstanceToStore toStore; | 107 std::unique_ptr<DicomInstanceToStore> toStore(DicomInstanceToStore::CreateFromParsedDicomFile(*modified)); |
108 assert(origin_ == RequestOrigin_Lua); | 108 assert(origin_ == RequestOrigin_Lua); |
109 toStore.SetOrigin(DicomInstanceOrigin::FromLua()); | 109 toStore->SetOrigin(DicomInstanceOrigin::FromLua()); |
110 toStore.SetParsedDicomFile(*modified); | |
111 | 110 |
112 // TODO other metadata | 111 // TODO other metadata |
113 toStore.AddMetadata(ResourceType_Instance, MetadataType_ModifiedFrom, instance.GetId()); | 112 toStore->AddMetadata(ResourceType_Instance, MetadataType_ModifiedFrom, instance.GetId()); |
114 | 113 |
115 std::string modifiedId; | 114 std::string modifiedId; |
116 context_.Store(modifiedId, toStore, StoreInstanceMode_Default); | 115 context_.Store(modifiedId, *toStore, StoreInstanceMode_Default); |
117 | 116 |
118 // Only chain with other commands if this command succeeds | 117 // Only chain with other commands if this command succeeds |
119 outputs.Append(new DicomInstanceOperationValue(instance.GetServerContext(), modifiedId)); | 118 outputs.Append(new DicomInstanceOperationValue(instance.GetServerContext(), modifiedId)); |
120 } | 119 } |
121 catch (OrthancException& e) | 120 catch (OrthancException& e) |