Mercurial > hg > orthanc
changeset 5416:08177310e269
merge
author | Sebastien Jodogne <s.jodogne@gmail.com> |
---|---|
date | Wed, 08 Nov 2023 09:59:31 +0100 |
parents | 1c6708a0e0c6 (diff) 62bb63346185 (current diff) |
children | 2a7a113d791d |
files | |
diffstat | 1 files changed, 59 insertions(+), 53 deletions(-) [+] |
line wrap: on
line diff
--- a/OrthancFramework/Sources/DicomFormat/DicomImageInformation.cpp Tue Oct 17 15:06:11 2023 +0200 +++ b/OrthancFramework/Sources/DicomFormat/DicomImageInformation.cpp Wed Nov 08 09:59:31 2023 +0100 @@ -59,60 +59,66 @@ try { - std::string p = values.GetValue(DICOM_TAG_PHOTOMETRIC_INTERPRETATION).GetContent(); - Toolbox::ToUpperCase(p); + std::string p; + if (values.LookupStringValue(p, DICOM_TAG_PHOTOMETRIC_INTERPRETATION, false)) { + Toolbox::ToUpperCase(p); - if (p == "RGB") - { - photometric_ = PhotometricInterpretation_RGB; - } - else if (p == "MONOCHROME1") - { - photometric_ = PhotometricInterpretation_Monochrome1; - } - else if (p == "MONOCHROME2") - { - photometric_ = PhotometricInterpretation_Monochrome2; - } - else if (p == "PALETTE COLOR") - { - photometric_ = PhotometricInterpretation_Palette; - } - else if (p == "HSV") - { - photometric_ = PhotometricInterpretation_HSV; - } - else if (p == "ARGB") - { - photometric_ = PhotometricInterpretation_ARGB; - } - else if (p == "CMYK") - { - photometric_ = PhotometricInterpretation_CMYK; - } - else if (p == "YBR_FULL") - { - photometric_ = PhotometricInterpretation_YBRFull; - } - else if (p == "YBR_FULL_422") - { - photometric_ = PhotometricInterpretation_YBRFull422; - } - else if (p == "YBR_PARTIAL_420") - { - photometric_ = PhotometricInterpretation_YBRPartial420; - } - else if (p == "YBR_PARTIAL_422") - { - photometric_ = PhotometricInterpretation_YBRPartial422; - } - else if (p == "YBR_ICT") - { - photometric_ = PhotometricInterpretation_YBR_ICT; - } - else if (p == "YBR_RCT") - { - photometric_ = PhotometricInterpretation_YBR_RCT; + if (p == "RGB") + { + photometric_ = PhotometricInterpretation_RGB; + } + else if (p == "MONOCHROME1") + { + photometric_ = PhotometricInterpretation_Monochrome1; + } + else if (p == "MONOCHROME2") + { + photometric_ = PhotometricInterpretation_Monochrome2; + } + else if (p == "PALETTE COLOR") + { + photometric_ = PhotometricInterpretation_Palette; + } + else if (p == "HSV") + { + photometric_ = PhotometricInterpretation_HSV; + } + else if (p == "ARGB") + { + photometric_ = PhotometricInterpretation_ARGB; + } + else if (p == "CMYK") + { + photometric_ = PhotometricInterpretation_CMYK; + } + else if (p == "YBR_FULL") + { + photometric_ = PhotometricInterpretation_YBRFull; + } + else if (p == "YBR_FULL_422") + { + photometric_ = PhotometricInterpretation_YBRFull422; + } + else if (p == "YBR_PARTIAL_420") + { + photometric_ = PhotometricInterpretation_YBRPartial420; + } + else if (p == "YBR_PARTIAL_422") + { + photometric_ = PhotometricInterpretation_YBRPartial422; + } + else if (p == "YBR_ICT") + { + photometric_ = PhotometricInterpretation_YBR_ICT; + } + else if (p == "YBR_RCT") + { + photometric_ = PhotometricInterpretation_YBR_RCT; + } + else + { + photometric_ = PhotometricInterpretation_Unknown; + } } else {