comparison Framework/Oracle/GenericOracleRunner.cpp @ 1148:5e164c629923 broker

timing
author Sebastien Jodogne <s.jodogne@gmail.com>
date Fri, 15 Nov 2019 10:42:16 +0100
parents 6333e6f7248e
children 2da8b4d6f8c1
comparison
equal deleted inserted replaced
1147:bc27c199eefe 1148:5e164c629923
263 263
264 LOG(TRACE) << "Parsing DICOM file, " 264 LOG(TRACE) << "Parsing DICOM file, "
265 << (command.IsPixelDataIncluded() ? "with" : "witout") 265 << (command.IsPixelDataIncluded() ? "with" : "witout")
266 << " pixel data: " << path; 266 << " pixel data: " << path;
267 267
268 boost::posix_time::ptime start = boost::posix_time::microsec_clock::local_time();
269
268 uint64_t fileSize = Orthanc::SystemToolbox::GetFileSize(path); 270 uint64_t fileSize = Orthanc::SystemToolbox::GetFileSize(path);
269 271
270 // Check for 32bit systems 272 // Check for 32bit systems
271 if (fileSize != static_cast<uint64_t>(static_cast<size_t>(fileSize))) 273 if (fileSize != static_cast<uint64_t>(static_cast<size_t>(fileSize)))
272 { 274 {
281 ok = dicom.loadFile(path.c_str()).good(); 283 ok = dicom.loadFile(path.c_str()).good();
282 } 284 }
283 else 285 else
284 { 286 {
285 #if DCMTK_VERSION_NUMBER >= 362 287 #if DCMTK_VERSION_NUMBER >= 362
286 // NB : We could stop at (0x3007, 0x0000) instead of 288 /**
287 // DCM_PixelData, cf. the Orthanc::DICOM_TAG_* constants 289 * NB : We could stop at (0x3007, 0x0000) instead of
288 290 * DCM_PixelData as the Stone framework does not use further
291 * tags (cf. the Orthanc::DICOM_TAG_* constants), but we
292 * still use "PixelData" as this does not change the runtime
293 * much, and as it is more explicit.
294 **/
289 static const DcmTagKey STOP = DCM_PixelData; 295 static const DcmTagKey STOP = DCM_PixelData;
290 //static const DcmTagKey STOP(0x3007, 0x0000); 296 //static const DcmTagKey STOP(0x3007, 0x0000);
291 297
292 ok = dicom.loadFileUntilTag(path.c_str(), EXS_Unknown, EGL_noChange, 298 ok = dicom.loadFileUntilTag(path.c_str(), EXS_Unknown, EGL_noChange,
293 DCM_MaxReadLength, ERM_autoDetect, STOP).good(); 299 DCM_MaxReadLength, ERM_autoDetect, STOP).good();
298 } 304 }
299 305
300 if (ok) 306 if (ok)
301 { 307 {
302 handler.Handle(new Orthanc::ParsedDicomFile(dicom), command, path, fileSize); 308 handler.Handle(new Orthanc::ParsedDicomFile(dicom), command, path, fileSize);
309
310 boost::posix_time::ptime end = boost::posix_time::microsec_clock::local_time();
311 LOG(TRACE) << path << ": parsed in " << (end-start).total_milliseconds() << " ms";
303 } 312 }
304 else 313 else
305 { 314 {
306 throw Orthanc::OrthancException(Orthanc::ErrorCode_BadFileFormat, 315 throw Orthanc::OrthancException(Orthanc::ErrorCode_BadFileFormat,
307 "Cannot parse file: " + path); 316 "Cannot parse file: " + path);