Mercurial > hg > orthanc
comparison OrthancFramework/Sources/DicomFormat/DicomImageInformation.cpp @ 5415:1c6708a0e0c6
tolerance if photometric interpretation is not set
author | Sebastien Jodogne <s.jodogne@gmail.com> |
---|---|
date | Wed, 08 Nov 2023 09:59:13 +0100 |
parents | 138e9d0c08c1 |
children | 59e3b6f8c5be |
comparison
equal
deleted
inserted
replaced
5398:08b5516c6e5e | 5415:1c6708a0e0c6 |
---|---|
57 uint32_t pixelRepresentation = 0; | 57 uint32_t pixelRepresentation = 0; |
58 uint32_t planarConfiguration = 0; | 58 uint32_t planarConfiguration = 0; |
59 | 59 |
60 try | 60 try |
61 { | 61 { |
62 std::string p = values.GetValue(DICOM_TAG_PHOTOMETRIC_INTERPRETATION).GetContent(); | 62 std::string p; |
63 Toolbox::ToUpperCase(p); | 63 if (values.LookupStringValue(p, DICOM_TAG_PHOTOMETRIC_INTERPRETATION, false)) { |
64 | 64 Toolbox::ToUpperCase(p); |
65 if (p == "RGB") | 65 |
66 { | 66 if (p == "RGB") |
67 photometric_ = PhotometricInterpretation_RGB; | 67 { |
68 } | 68 photometric_ = PhotometricInterpretation_RGB; |
69 else if (p == "MONOCHROME1") | 69 } |
70 { | 70 else if (p == "MONOCHROME1") |
71 photometric_ = PhotometricInterpretation_Monochrome1; | 71 { |
72 } | 72 photometric_ = PhotometricInterpretation_Monochrome1; |
73 else if (p == "MONOCHROME2") | 73 } |
74 { | 74 else if (p == "MONOCHROME2") |
75 photometric_ = PhotometricInterpretation_Monochrome2; | 75 { |
76 } | 76 photometric_ = PhotometricInterpretation_Monochrome2; |
77 else if (p == "PALETTE COLOR") | 77 } |
78 { | 78 else if (p == "PALETTE COLOR") |
79 photometric_ = PhotometricInterpretation_Palette; | 79 { |
80 } | 80 photometric_ = PhotometricInterpretation_Palette; |
81 else if (p == "HSV") | 81 } |
82 { | 82 else if (p == "HSV") |
83 photometric_ = PhotometricInterpretation_HSV; | 83 { |
84 } | 84 photometric_ = PhotometricInterpretation_HSV; |
85 else if (p == "ARGB") | 85 } |
86 { | 86 else if (p == "ARGB") |
87 photometric_ = PhotometricInterpretation_ARGB; | 87 { |
88 } | 88 photometric_ = PhotometricInterpretation_ARGB; |
89 else if (p == "CMYK") | 89 } |
90 { | 90 else if (p == "CMYK") |
91 photometric_ = PhotometricInterpretation_CMYK; | 91 { |
92 } | 92 photometric_ = PhotometricInterpretation_CMYK; |
93 else if (p == "YBR_FULL") | 93 } |
94 { | 94 else if (p == "YBR_FULL") |
95 photometric_ = PhotometricInterpretation_YBRFull; | 95 { |
96 } | 96 photometric_ = PhotometricInterpretation_YBRFull; |
97 else if (p == "YBR_FULL_422") | 97 } |
98 { | 98 else if (p == "YBR_FULL_422") |
99 photometric_ = PhotometricInterpretation_YBRFull422; | 99 { |
100 } | 100 photometric_ = PhotometricInterpretation_YBRFull422; |
101 else if (p == "YBR_PARTIAL_420") | 101 } |
102 { | 102 else if (p == "YBR_PARTIAL_420") |
103 photometric_ = PhotometricInterpretation_YBRPartial420; | 103 { |
104 } | 104 photometric_ = PhotometricInterpretation_YBRPartial420; |
105 else if (p == "YBR_PARTIAL_422") | 105 } |
106 { | 106 else if (p == "YBR_PARTIAL_422") |
107 photometric_ = PhotometricInterpretation_YBRPartial422; | 107 { |
108 } | 108 photometric_ = PhotometricInterpretation_YBRPartial422; |
109 else if (p == "YBR_ICT") | 109 } |
110 { | 110 else if (p == "YBR_ICT") |
111 photometric_ = PhotometricInterpretation_YBR_ICT; | 111 { |
112 } | 112 photometric_ = PhotometricInterpretation_YBR_ICT; |
113 else if (p == "YBR_RCT") | 113 } |
114 { | 114 else if (p == "YBR_RCT") |
115 photometric_ = PhotometricInterpretation_YBR_RCT; | 115 { |
116 photometric_ = PhotometricInterpretation_YBR_RCT; | |
117 } | |
118 else | |
119 { | |
120 photometric_ = PhotometricInterpretation_Unknown; | |
121 } | |
116 } | 122 } |
117 else | 123 else |
118 { | 124 { |
119 photometric_ = PhotometricInterpretation_Unknown; | 125 photometric_ = PhotometricInterpretation_Unknown; |
120 } | 126 } |