Mercurial > hg > orthanc
comparison OrthancServer/DicomInstanceToStore.cpp @ 2189:c4b3259c8bce
New metadata automatically computed at the instance level: "TransferSyntax"
author | Sebastien Jodogne <s.jodogne@gmail.com> |
---|---|
date | Tue, 29 Nov 2016 16:07:14 +0100 |
parents | bb199bccdc45 |
children | a3a65de1840f |
comparison
equal
deleted
inserted
replaced
2188:7cfc2e0383b3 | 2189:c4b3259c8bce |
---|---|
36 #include "FromDcmtkBridge.h" | 36 #include "FromDcmtkBridge.h" |
37 #include "OrthancInitialization.h" | 37 #include "OrthancInitialization.h" |
38 #include "../Core/Logging.h" | 38 #include "../Core/Logging.h" |
39 | 39 |
40 #include <dcmtk/dcmdata/dcfilefo.h> | 40 #include <dcmtk/dcmdata/dcfilefo.h> |
41 #include <dcmtk/dcmdata/dcdeftag.h> | |
41 | 42 |
42 | 43 |
43 namespace Orthanc | 44 namespace Orthanc |
44 { | 45 { |
45 void DicomInstanceToStore::AddMetadata(ResourceType level, | 46 void DicomInstanceToStore::AddMetadata(ResourceType level, |
268 else | 269 else |
269 { | 270 { |
270 return ""; | 271 return ""; |
271 } | 272 } |
272 } | 273 } |
274 | |
275 | |
276 bool DicomInstanceToStore::LookupTransferSyntax(std::string& result) | |
277 { | |
278 ComputeMissingInformation(); | |
279 | |
280 DicomMap header; | |
281 if (DicomMap::ParseDicomMetaInformation(header, GetBufferData(), GetBufferSize())) | |
282 { | |
283 const DicomValue* value = header.TestAndGetValue(DICOM_TAG_TRANSFER_SYNTAX_UID); | |
284 if (value != NULL && | |
285 !value->IsBinary() && | |
286 !value->IsNull()) | |
287 { | |
288 result = Toolbox::StripSpaces(value->GetContent()); | |
289 return true; | |
290 } | |
291 } | |
292 | |
293 return false; | |
294 } | |
273 } | 295 } |