Mercurial > hg > orthanc
comparison OrthancFramework/Sources/DicomParsing/IDicomTranscoder.cpp @ 4953:60cb4b379485
added FromDcmtkBridge::LookupStringValue()
author | Sebastien Jodogne <s.jodogne@gmail.com> |
---|---|
date | Tue, 22 Mar 2022 12:37:24 +0100 |
parents | 43e613a7756b |
children | 0ea402b4d901 |
comparison
equal
deleted
inserted
replaced
4952:15ce7af202f1 | 4953:60cb4b379485 |
---|---|
73 { | 73 { |
74 throw OrthancException(ErrorCode_InternalError); | 74 throw OrthancException(ErrorCode_InternalError); |
75 } | 75 } |
76 | 76 |
77 DcmDataset& dataset = *dicom.getDataset(); | 77 DcmDataset& dataset = *dicom.getDataset(); |
78 | 78 |
79 const char* v = NULL; | 79 std::string s; |
80 | 80 if (FromDcmtkBridge::LookupStringValue(s, dataset, DICOM_TAG_SOP_INSTANCE_UID)) |
81 if (dataset.findAndGetString(DCM_SOPInstanceUID, v).good() && | 81 { |
82 v != NULL) | 82 return s; |
83 { | |
84 return std::string(v); | |
85 } | 83 } |
86 else | 84 else |
87 { | 85 { |
88 throw OrthancException(ErrorCode_BadFileFormat, "File without SOP instance UID"); | 86 throw OrthancException(ErrorCode_BadFileFormat, "File without SOP instance UID"); |
89 } | 87 } |