comparison OrthancServer/OrthancRestApi/OrthancRestAnonymizeModify.cpp @ 3903:d1273d7cc200 transcoding

avoid unnecessary dicom serialization
author Sebastien Jodogne <s.jodogne@gmail.com>
date Thu, 07 May 2020 16:43:08 +0200
parents 603a7b86fa5f
children f0dd5ded8927
comparison
equal deleted inserted replaced
3902:7459fcb1bdf7 3903:d1273d7cc200
128 128
129 modification.Apply(*modified); 129 modification.Apply(*modified);
130 130
131 if (transcode) 131 if (transcode)
132 { 132 {
133 std::string saved; 133 std::set<DicomTransferSyntax> ts;
134 modified->SaveToMemoryBuffer(saved); 134 ts.insert(targetSyntax);
135 135
136 std::string transcoded; 136 std::string transcoded;
137 bool hasSopInstanceUidChanged; 137 bool hasSopInstanceUidChanged;
138 std::set<DicomTransferSyntax> ts; 138
139 ts.insert(targetSyntax); 139 if (context.Transcode(transcoded, hasSopInstanceUidChanged, *modified, ts, true))
140 if (context.TranscodeMemoryBuffer(transcoded, hasSopInstanceUidChanged, saved, ts, true))
141 { 140 {
142 call.GetOutput().AnswerBuffer(transcoded, MimeType_Dicom); 141 call.GetOutput().AnswerBuffer(transcoded, MimeType_Dicom);
143 } 142 }
144 else 143 else
145 { 144 {