Mercurial > hg > orthanc-stone
comparison OrthancStone/Sources/Loaders/OrthancSeriesVolumeProgressiveLoader.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 | 1a775f4ee672 |
comparison
equal
deleted
inserted
replaced
1750:5f74ebe2516b | 1751:946eb7200b82 |
---|---|
31 | 31 |
32 #include <Compatibility.h> | 32 #include <Compatibility.h> |
33 #include <Images/ImageProcessing.h> | 33 #include <Images/ImageProcessing.h> |
34 #include <OrthancException.h> | 34 #include <OrthancException.h> |
35 | 35 |
36 #if STONE_TIME_BLOCKING_OPS | |
37 # include <boost/date_time/posix_time/posix_time.hpp> | |
38 #endif | |
36 | 39 |
37 namespace OrthancStone | 40 namespace OrthancStone |
38 { | 41 { |
39 class OrthancSeriesVolumeProgressiveLoader::ExtractedSlice : public DicomVolumeImageMPRSlicer::Slice | 42 class OrthancSeriesVolumeProgressiveLoader::ExtractedSlice : public DicomVolumeImageMPRSlicer::Slice |
40 { | 43 { |
336 /** | 339 /** |
337 This is called in response to GET "/series/XXXXXXXXXXXXX/instances-tags" | 340 This is called in response to GET "/series/XXXXXXXXXXXXX/instances-tags" |
338 */ | 341 */ |
339 void OrthancSeriesVolumeProgressiveLoader::LoadGeometry(const OrthancRestApiCommand::SuccessMessage& message) | 342 void OrthancSeriesVolumeProgressiveLoader::LoadGeometry(const OrthancRestApiCommand::SuccessMessage& message) |
340 { | 343 { |
344 #if STONE_TIME_BLOCKING_OPS | |
345 boost::posix_time::ptime timerStart = boost::posix_time::microsec_clock::universal_time(); | |
346 #endif | |
347 | |
341 Json::Value body; | 348 Json::Value body; |
342 message.ParseJsonBody(body); | 349 message.ParseJsonBody(body); |
343 | 350 |
344 if (body.type() != Json::objectValue) | 351 if (body.type() != Json::objectValue) |
345 { | 352 { |
402 } | 409 } |
403 | 410 |
404 slicesQuality_.resize(slicesCount, 0); | 411 slicesQuality_.resize(slicesCount, 0); |
405 | 412 |
406 BroadcastMessage(DicomVolumeImage::GeometryReadyMessage(*volume_)); | 413 BroadcastMessage(DicomVolumeImage::GeometryReadyMessage(*volume_)); |
414 | |
415 #if STONE_TIME_BLOCKING_OPS | |
416 boost::posix_time::ptime timerEnd = boost::posix_time::microsec_clock::universal_time(); | |
417 boost::posix_time::time_duration duration = timerEnd - timerStart; | |
418 int64_t durationMs = duration.total_milliseconds(); | |
419 LOG(WARNING) << "OrthancSeriesVolumeProgressiveLoader::LoadGeometry took " << durationMs << " ms"; | |
420 #endif | |
421 | |
407 } | 422 } |
408 | 423 |
409 | 424 |
410 void OrthancSeriesVolumeProgressiveLoader::SetSliceContent(unsigned int sliceIndex, | 425 void OrthancSeriesVolumeProgressiveLoader::SetSliceContent(unsigned int sliceIndex, |
411 const Orthanc::ImageAccessor& image, | 426 const Orthanc::ImageAccessor& image, |