Mercurial > hg > orthanc
comparison Core/DicomFormat/DicomImageInformation.cpp @ 1737:ec66a16aa398
removal of DicomStringValue and DicomNullValue
author | Sebastien Jodogne <s.jodogne@gmail.com> |
---|---|
date | Thu, 22 Oct 2015 07:52:24 +0200 |
parents | 6e7e5ed91c2d |
children | b1291df2f780 |
comparison
equal
deleted
inserted
replaced
1736:b953c6eef28d | 1737:ec66a16aa398 |
---|---|
52 unsigned int pixelRepresentation; | 52 unsigned int pixelRepresentation; |
53 unsigned int planarConfiguration = 0; | 53 unsigned int planarConfiguration = 0; |
54 | 54 |
55 try | 55 try |
56 { | 56 { |
57 std::string p = values.GetValue(DICOM_TAG_PHOTOMETRIC_INTERPRETATION).AsString(); | 57 std::string p = values.GetValue(DICOM_TAG_PHOTOMETRIC_INTERPRETATION).GetContent(); |
58 Toolbox::ToUpperCase(p); | 58 Toolbox::ToUpperCase(p); |
59 | 59 |
60 if (p == "RGB") | 60 if (p == "RGB") |
61 { | 61 { |
62 photometric_ = PhotometricInterpretation_RGB; | 62 photometric_ = PhotometricInterpretation_RGB; |
112 else | 112 else |
113 { | 113 { |
114 photometric_ = PhotometricInterpretation_Unknown; | 114 photometric_ = PhotometricInterpretation_Unknown; |
115 } | 115 } |
116 | 116 |
117 width_ = boost::lexical_cast<unsigned int>(values.GetValue(DICOM_TAG_COLUMNS).AsString()); | 117 width_ = boost::lexical_cast<unsigned int>(values.GetValue(DICOM_TAG_COLUMNS).GetContent()); |
118 height_ = boost::lexical_cast<unsigned int>(values.GetValue(DICOM_TAG_ROWS).AsString()); | 118 height_ = boost::lexical_cast<unsigned int>(values.GetValue(DICOM_TAG_ROWS).GetContent()); |
119 bitsAllocated_ = boost::lexical_cast<unsigned int>(values.GetValue(DICOM_TAG_BITS_ALLOCATED).AsString()); | 119 bitsAllocated_ = boost::lexical_cast<unsigned int>(values.GetValue(DICOM_TAG_BITS_ALLOCATED).GetContent()); |
120 | 120 |
121 try | 121 try |
122 { | 122 { |
123 samplesPerPixel_ = boost::lexical_cast<unsigned int>(values.GetValue(DICOM_TAG_SAMPLES_PER_PIXEL).AsString()); | 123 samplesPerPixel_ = boost::lexical_cast<unsigned int>(values.GetValue(DICOM_TAG_SAMPLES_PER_PIXEL).GetContent()); |
124 } | 124 } |
125 catch (OrthancException&) | 125 catch (OrthancException&) |
126 { | 126 { |
127 samplesPerPixel_ = 1; // Assume 1 color channel | 127 samplesPerPixel_ = 1; // Assume 1 color channel |
128 } | 128 } |
129 | 129 |
130 try | 130 try |
131 { | 131 { |
132 bitsStored_ = boost::lexical_cast<unsigned int>(values.GetValue(DICOM_TAG_BITS_STORED).AsString()); | 132 bitsStored_ = boost::lexical_cast<unsigned int>(values.GetValue(DICOM_TAG_BITS_STORED).GetContent()); |
133 } | 133 } |
134 catch (OrthancException&) | 134 catch (OrthancException&) |
135 { | 135 { |
136 bitsStored_ = bitsAllocated_; | 136 bitsStored_ = bitsAllocated_; |
137 } | 137 } |
138 | 138 |
139 try | 139 try |
140 { | 140 { |
141 highBit_ = boost::lexical_cast<unsigned int>(values.GetValue(DICOM_TAG_HIGH_BIT).AsString()); | 141 highBit_ = boost::lexical_cast<unsigned int>(values.GetValue(DICOM_TAG_HIGH_BIT).GetContent()); |
142 } | 142 } |
143 catch (OrthancException&) | 143 catch (OrthancException&) |
144 { | 144 { |
145 highBit_ = bitsStored_ - 1; | 145 highBit_ = bitsStored_ - 1; |
146 } | 146 } |
147 | 147 |
148 try | 148 try |
149 { | 149 { |
150 pixelRepresentation = boost::lexical_cast<unsigned int>(values.GetValue(DICOM_TAG_PIXEL_REPRESENTATION).AsString()); | 150 pixelRepresentation = boost::lexical_cast<unsigned int>(values.GetValue(DICOM_TAG_PIXEL_REPRESENTATION).GetContent()); |
151 } | 151 } |
152 catch (OrthancException&) | 152 catch (OrthancException&) |
153 { | 153 { |
154 pixelRepresentation = 0; // Assume unsigned pixels | 154 pixelRepresentation = 0; // Assume unsigned pixels |
155 } | 155 } |
158 { | 158 { |
159 // The "Planar Configuration" is only set when "Samples per Pixels" is greater than 1 | 159 // The "Planar Configuration" is only set when "Samples per Pixels" is greater than 1 |
160 // https://www.dabsoft.ch/dicom/3/C.7.6.3.1.3/ | 160 // https://www.dabsoft.ch/dicom/3/C.7.6.3.1.3/ |
161 try | 161 try |
162 { | 162 { |
163 planarConfiguration = boost::lexical_cast<unsigned int>(values.GetValue(DICOM_TAG_PLANAR_CONFIGURATION).AsString()); | 163 planarConfiguration = boost::lexical_cast<unsigned int>(values.GetValue(DICOM_TAG_PLANAR_CONFIGURATION).GetContent()); |
164 } | 164 } |
165 catch (OrthancException&) | 165 catch (OrthancException&) |
166 { | 166 { |
167 planarConfiguration = 0; // Assume interleaved color channels | 167 planarConfiguration = 0; // Assume interleaved color channels |
168 } | 168 } |
177 throw OrthancException(ErrorCode_NotImplemented); | 177 throw OrthancException(ErrorCode_NotImplemented); |
178 } | 178 } |
179 | 179 |
180 try | 180 try |
181 { | 181 { |
182 numberOfFrames_ = boost::lexical_cast<unsigned int>(values.GetValue(DICOM_TAG_NUMBER_OF_FRAMES).AsString()); | 182 numberOfFrames_ = boost::lexical_cast<unsigned int>(values.GetValue(DICOM_TAG_NUMBER_OF_FRAMES).GetContent()); |
183 } | 183 } |
184 catch (OrthancException) | 184 catch (OrthancException&) |
185 { | 185 { |
186 // If the tag "NumberOfFrames" is absent, assume there is a single frame | 186 // If the tag "NumberOfFrames" is absent, assume there is a single frame |
187 numberOfFrames_ = 1; | 187 numberOfFrames_ = 1; |
188 } | 188 } |
189 catch (boost::bad_lexical_cast&) | 189 catch (boost::bad_lexical_cast&) |