comparison OrthancServer/FromDcmtkBridge.cpp @ 464:5987dd8e0776

fix reading signed values in dicom
author Sebastien Jodogne <s.jodogne@gmail.com>
date Fri, 12 Jul 2013 10:37:31 +0200
parents 6f47a4262618
children 7a966b440f19
comparison
equal deleted inserted replaced
463:005aaeb63414 464:5987dd8e0776
1138 for (unsigned int y = 0; y < accessor.GetHeight(); y++) 1138 for (unsigned int y = 0; y < accessor.GetHeight(); y++)
1139 { 1139 {
1140 for (unsigned int x = 0; x < accessor.GetWidth(); x++, pixel++) 1140 for (unsigned int x = 0; x < accessor.GetWidth(); x++, pixel++)
1141 { 1141 {
1142 int32_t v = accessor.GetValue(x, y); 1142 int32_t v = accessor.GetValue(x, y);
1143 if (v < std::numeric_limits<T>::min()) 1143 if (v < static_cast<int32_t>(std::numeric_limits<T>::min()))
1144 *pixel = std::numeric_limits<T>::min(); 1144 *pixel = std::numeric_limits<T>::min();
1145 else if (v > std::numeric_limits<T>::max()) 1145 else if (v > static_cast<int32_t>(std::numeric_limits<T>::max()))
1146 *pixel = std::numeric_limits<T>::max(); 1146 *pixel = std::numeric_limits<T>::max();
1147 else 1147 else
1148 *pixel = static_cast<T>(v); 1148 *pixel = static_cast<T>(v);
1149 } 1149 }
1150 } 1150 }