comparison OrthancStone/Sources/Loaders/OrthancMultiframeVolumeLoader.cpp @ 1751:946eb7200b82

FastParseVector usage + timing instrumentation guarded by STONE_TIME_BLOCKING_OPS
author Benjamin Golinvaux <bgo@osimis.io>
date Mon, 22 Feb 2021 14:57:01 +0100
parents 9ac2a65d4172
children 28979b77ce90
comparison
equal deleted inserted replaced
1750:5f74ebe2516b 1751:946eb7200b82
23 #include "OrthancMultiframeVolumeLoader.h" 23 #include "OrthancMultiframeVolumeLoader.h"
24 24
25 #include <Endianness.h> 25 #include <Endianness.h>
26 #include <Toolbox.h> 26 #include <Toolbox.h>
27 27
28 #if STONE_TIME_BLOCKING_OPS
29 # include <boost/date_time/posix_time/posix_time.hpp>
30 #endif
31
28 namespace OrthancStone 32 namespace OrthancStone
29 { 33 {
30 class OrthancMultiframeVolumeLoader::LoadRTDoseGeometry : public LoaderStateMachine::State 34 class OrthancMultiframeVolumeLoader::LoadRTDoseGeometry : public LoaderStateMachine::State
31 { 35 {
32 private: 36 private:
265 269
266 template <typename T> 270 template <typename T>
267 void OrthancMultiframeVolumeLoader::CopyPixelDataAndComputeDistribution( 271 void OrthancMultiframeVolumeLoader::CopyPixelDataAndComputeDistribution(
268 const std::string& pixelData, std::map<T,uint64_t>& distribution) 272 const std::string& pixelData, std::map<T,uint64_t>& distribution)
269 { 273 {
274 #if STONE_TIME_BLOCKING_OPS
275 boost::posix_time::ptime timerStart = boost::posix_time::microsec_clock::universal_time();
276 #endif
277
270 ImageBuffer3D& target = volume_->GetPixelData(); 278 ImageBuffer3D& target = volume_->GetPixelData();
271 279
272 const unsigned int bpp = target.GetBytesPerPixel(); 280 const unsigned int bpp = target.GetBytesPerPixel();
273 const unsigned int width = target.GetWidth(); 281 const unsigned int width = target.GetWidth();
274 const unsigned int height = target.GetHeight(); 282 const unsigned int height = target.GetHeight();
352 targetAddrLine = reinterpret_cast<T*>(targetAddrLineBytes); 360 targetAddrLine = reinterpret_cast<T*>(targetAddrLineBytes);
353 } 361 }
354 #endif 362 #endif
355 } 363 }
356 } 364 }
365 #if STONE_TIME_BLOCKING_OPS
366 boost::posix_time::ptime timerEnd = boost::posix_time::microsec_clock::universal_time();
367 boost::posix_time::time_duration duration = timerEnd - timerStart;
368 int64_t durationMs = duration.total_milliseconds();
369 LOG(WARNING) << "OrthancMultiframeVolumeLoader::CopyPixelDataAndComputeDistribution took " << durationMs << " ms";
370 #endif
357 } 371 }
358 372
359 template <typename T> 373 template <typename T>
360 void OrthancMultiframeVolumeLoader::ComputeMinMaxWithOutlierRejection( 374 void OrthancMultiframeVolumeLoader::ComputeMinMaxWithOutlierRejection(
361 const std::map<T, uint64_t>& distribution) 375 const std::map<T, uint64_t>& distribution)