comparison Core/DicomFormat/DicomImageInformation.cpp @ 3519:fc26659493b6

added support for COLUMNS/ROWS tags with invalid 800\0 value observed in some US images
author amazy
date Thu, 19 Sep 2019 13:10:10 +0200
parents 4e43e67f8ecf
children 94f4a18a79cc
comparison
equal deleted inserted replaced
3513:7db879b014ff 3519:fc26659493b6
114 else 114 else
115 { 115 {
116 photometric_ = PhotometricInterpretation_Unknown; 116 photometric_ = PhotometricInterpretation_Unknown;
117 } 117 }
118 118
119 width_ = boost::lexical_cast<unsigned int>(values.GetValue(DICOM_TAG_COLUMNS).GetContent()); 119 values.GetValue(DICOM_TAG_COLUMNS).ParseFirstUnsignedInteger(width_); // in some US images, we've seen tag values of "800\0"; that's why we parse the 'first' value
120 height_ = boost::lexical_cast<unsigned int>(values.GetValue(DICOM_TAG_ROWS).GetContent()); 120 values.GetValue(DICOM_TAG_ROWS).ParseFirstUnsignedInteger(height_);
121
121 bitsAllocated_ = boost::lexical_cast<unsigned int>(values.GetValue(DICOM_TAG_BITS_ALLOCATED).GetContent()); 122 bitsAllocated_ = boost::lexical_cast<unsigned int>(values.GetValue(DICOM_TAG_BITS_ALLOCATED).GetContent());
122 123
123 try 124 try
124 { 125 {
125 samplesPerPixel_ = boost::lexical_cast<unsigned int>(values.GetValue(DICOM_TAG_SAMPLES_PER_PIXEL).GetContent()); 126 samplesPerPixel_ = boost::lexical_cast<unsigned int>(values.GetValue(DICOM_TAG_SAMPLES_PER_PIXEL).GetContent());