Mercurial > hg > orthanc-stone
comparison OrthancStone/Sources/Toolbox/ImageToolbox.cpp @ 1742:911cd9a11ad3
removed "using namespace Orthanc"
author | Sebastien Jodogne <s.jodogne@gmail.com> |
---|---|
date | Sat, 30 Jan 2021 12:30:09 +0100 |
parents | 9ac2a65d4172 |
children | 3889ae96d2e9 |
comparison
equal
deleted
inserted
replaced
1741:62377949e739 | 1742:911cd9a11ad3 |
---|---|
218 } | 218 } |
219 | 219 |
220 void ComputeHistogram(const Orthanc::ImageAccessor& img, | 220 void ComputeHistogram(const Orthanc::ImageAccessor& img, |
221 HistogramData& hd, double binSize) | 221 HistogramData& hd, double binSize) |
222 { | 222 { |
223 using namespace Orthanc; | |
224 | |
225 hd.binSize = binSize; | 223 hd.binSize = binSize; |
226 | 224 |
227 // dynamic/static bridge | 225 // dynamic/static bridge |
228 switch (img.GetFormat()) | 226 switch (img.GetFormat()) |
229 { | 227 { |
230 case PixelFormat_Grayscale8: | 228 case Orthanc::PixelFormat_Grayscale8: |
231 ComputeHistogram_<PixelFormat_Grayscale8> (img, hd); | 229 ComputeHistogram_<Orthanc::PixelFormat_Grayscale8> (img, hd); |
232 break; | 230 break; |
233 case PixelFormat_Grayscale16: | 231 case Orthanc::PixelFormat_Grayscale16: |
234 ComputeHistogram_<PixelFormat_Grayscale16> (img, hd); | 232 ComputeHistogram_<Orthanc::PixelFormat_Grayscale16> (img, hd); |
235 break; | 233 break; |
236 case PixelFormat_SignedGrayscale16: | 234 case Orthanc::PixelFormat_SignedGrayscale16: |
237 ComputeHistogram_<PixelFormat_SignedGrayscale16>(img, hd); | 235 ComputeHistogram_<Orthanc::PixelFormat_SignedGrayscale16>(img, hd); |
238 break; | 236 break; |
239 case PixelFormat_Float32: | 237 case Orthanc::PixelFormat_Float32: |
240 ComputeHistogram_<PixelFormat_Float32> (img, hd); | 238 ComputeHistogram_<Orthanc::PixelFormat_Float32> (img, hd); |
241 break; | 239 break; |
242 case PixelFormat_Grayscale32: | 240 case Orthanc::PixelFormat_Grayscale32: |
243 ComputeHistogram_<PixelFormat_Grayscale32> (img, hd); | 241 ComputeHistogram_<Orthanc::PixelFormat_Grayscale32> (img, hd); |
244 break; | 242 break; |
245 case PixelFormat_Grayscale64: | 243 case Orthanc::PixelFormat_Grayscale64: |
246 ComputeHistogram_<PixelFormat_Grayscale64> (img, hd); | 244 ComputeHistogram_<Orthanc::PixelFormat_Grayscale64> (img, hd); |
247 break; | 245 break; |
248 default: | 246 default: |
249 throw Orthanc::OrthancException(Orthanc::ErrorCode_IncompatibleImageFormat); | 247 throw Orthanc::OrthancException(Orthanc::ErrorCode_IncompatibleImageFormat); |
250 } | 248 } |
251 } | 249 } |
252 | 250 |
253 void ComputeMinMax(const Orthanc::ImageAccessor& img, | 251 void ComputeMinMax(const Orthanc::ImageAccessor& img, |
254 double& minValue, double& maxValue) | 252 double& minValue, double& maxValue) |
255 { | 253 { |
256 using namespace Orthanc; | |
257 | |
258 // dynamic/static bridge | 254 // dynamic/static bridge |
259 switch (img.GetFormat()) | 255 switch (img.GetFormat()) |
260 { | 256 { |
261 case PixelFormat_Grayscale8: | 257 case Orthanc::PixelFormat_Grayscale8: |
262 ComputeMinMax_<PixelFormat_Grayscale8> (img, minValue, maxValue); | 258 ComputeMinMax_<Orthanc::PixelFormat_Grayscale8> (img, minValue, maxValue); |
263 break; | 259 break; |
264 case PixelFormat_Grayscale16: | 260 case Orthanc::PixelFormat_Grayscale16: |
265 ComputeMinMax_<PixelFormat_Grayscale16> (img, minValue, maxValue); | 261 ComputeMinMax_<Orthanc::PixelFormat_Grayscale16> (img, minValue, maxValue); |
266 break; | 262 break; |
267 case PixelFormat_SignedGrayscale16: | 263 case Orthanc::PixelFormat_SignedGrayscale16: |
268 ComputeMinMax_<PixelFormat_SignedGrayscale16>(img, minValue, maxValue); | 264 ComputeMinMax_<Orthanc::PixelFormat_SignedGrayscale16>(img, minValue, maxValue); |
269 break; | 265 break; |
270 case PixelFormat_Float32: | 266 case Orthanc::PixelFormat_Float32: |
271 ComputeMinMax_<PixelFormat_Float32> (img, minValue, maxValue); | 267 ComputeMinMax_<Orthanc::PixelFormat_Float32> (img, minValue, maxValue); |
272 break; | 268 break; |
273 case PixelFormat_Grayscale32: | 269 case Orthanc::PixelFormat_Grayscale32: |
274 ComputeMinMax_<PixelFormat_Grayscale32> (img, minValue, maxValue); | 270 ComputeMinMax_<Orthanc::PixelFormat_Grayscale32> (img, minValue, maxValue); |
275 break; | 271 break; |
276 case PixelFormat_Grayscale64: | 272 case Orthanc::PixelFormat_Grayscale64: |
277 ComputeMinMax_<PixelFormat_Grayscale64> (img, minValue, maxValue); | 273 ComputeMinMax_<Orthanc::PixelFormat_Grayscale64> (img, minValue, maxValue); |
278 break; | 274 break; |
279 default: | 275 default: |
280 throw Orthanc::OrthancException(Orthanc::ErrorCode_IncompatibleImageFormat); | 276 throw Orthanc::OrthancException(Orthanc::ErrorCode_IncompatibleImageFormat); |
281 } | 277 } |
282 | 278 |