comparison OrthancStone/Sources/Loaders/DicomStructureSetLoader.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 4ee11b8773e2
comparison
equal deleted inserted replaced
1750:5f74ebe2516b 1751:946eb7200b82
26 #include "../StoneException.h" 26 #include "../StoneException.h"
27 #include "../Toolbox/GeometryToolbox.h" 27 #include "../Toolbox/GeometryToolbox.h"
28 28
29 #include <Toolbox.h> 29 #include <Toolbox.h>
30 30
31 #if STONE_TIME_BLOCKING_OPS
32 # include <boost/date_time/posix_time/posix_time.hpp>
33 #endif
34
31 #include <algorithm> 35 #include <algorithm>
32 36
33 namespace OrthancStone 37 namespace OrthancStone
34 { 38 {
35 39
185 { 189 {
186 } 190 }
187 191
188 virtual void Handle(const OrthancRestApiCommand::SuccessMessage& message) ORTHANC_OVERRIDE 192 virtual void Handle(const OrthancRestApiCommand::SuccessMessage& message) ORTHANC_OVERRIDE
189 { 193 {
194 #if STONE_TIME_BLOCKING_OPS
195 boost::posix_time::ptime timerStart = boost::posix_time::microsec_clock::universal_time();
196 #endif
197
190 DicomStructureSetLoader& loader = GetLoader<DicomStructureSetLoader>(); 198 DicomStructureSetLoader& loader = GetLoader<DicomStructureSetLoader>();
191 199
192 // Set the actual structure set content 200 // Set the actual structure set content
193 { 201 {
194 FullOrthancDataset dicom(message.GetAnswer()); 202 FullOrthancDataset dicom(message.GetAnswer());
217 if(instance != "") 225 if(instance != "")
218 nonEmptyInstances.insert(instance); 226 nonEmptyInstances.insert(instance);
219 } 227 }
220 228
221 loader.RetrieveReferencedSlices(nonEmptyInstances); 229 loader.RetrieveReferencedSlices(nonEmptyInstances);
230 #if STONE_TIME_BLOCKING_OPS
231 boost::posix_time::ptime timerEnd = boost::posix_time::microsec_clock::universal_time();
232 boost::posix_time::time_duration duration = timerEnd - timerStart;
233 int64_t durationMs = duration.total_milliseconds();
234 LOG(WARNING) << "DicomStructureSetLoader::LoadStructure::Handle took " << durationMs << " ms";
235 #endif
236
222 } 237 }
223 238
224 void SetDefaultStructureVisibility() 239 void SetDefaultStructureVisibility()
225 { 240 {
226 DicomStructureSetLoader& loader = GetLoader<DicomStructureSetLoader>(); 241 DicomStructureSetLoader& loader = GetLoader<DicomStructureSetLoader>();