comparison OrthancStone/Sources/Loaders/OrthancSeriesVolumeProgressiveLoader.cpp @ 1755:1a775f4ee672

added ability to specify initial slice in BasicFetchingStrategy and using it in OrthancSeriesVolumeProgressiveLoader
author bgo@SHARKNADO.localdomain
date Mon, 26 Apr 2021 12:05:40 +0200
parents 946eb7200b82
children 4ee11b8773e2
comparison
equal deleted inserted replaced
1754:34ab7f643327 1755:1a775f4ee672
395 // QUALITY_02... Otherwise, it's only QUALITY_00 395 // QUALITY_02... Otherwise, it's only QUALITY_00
396 unsigned int maxQuality = QUALITY_00; 396 unsigned int maxQuality = QUALITY_00;
397 if (progressiveQuality_) 397 if (progressiveQuality_)
398 maxQuality = QUALITY_02; 398 maxQuality = QUALITY_02;
399 399
400 unsigned int initialSlice = 0;
401 if (startCenter_)
402 initialSlice = static_cast<unsigned int>(slicesCount) / 2;
403
400 strategy_.reset(new BasicFetchingStrategy( 404 strategy_.reset(new BasicFetchingStrategy(
401 sorter_->CreateSorter(static_cast<unsigned int>(slicesCount)), 405 sorter_->CreateSorter(static_cast<unsigned int>(slicesCount)),
402 maxQuality)); 406 maxQuality,
407 initialSlice));
403 408
404 assert(simultaneousDownloads_ != 0); 409 assert(simultaneousDownloads_ != 0);
405 for (unsigned int i = 0; i < simultaneousDownloads_; i++) 410 for (unsigned int i = 0; i < simultaneousDownloads_; i++)
406 { 411 {
407 ScheduleNextSliceDownload(); 412 ScheduleNextSliceDownload();
526 boost::shared_ptr<DicomVolumeImage> volume, 531 boost::shared_ptr<DicomVolumeImage> volume,
527 bool progressiveQuality) 532 bool progressiveQuality)
528 : loadersContext_(loadersContext) 533 : loadersContext_(loadersContext)
529 , active_(false) 534 , active_(false)
530 , progressiveQuality_(progressiveQuality) 535 , progressiveQuality_(progressiveQuality)
536 , startCenter_(false)
531 , simultaneousDownloads_(4) 537 , simultaneousDownloads_(4)
532 , volume_(volume) 538 , volume_(volume)
533 , sorter_(new BasicFetchingItemsSorter::Factory) 539 , sorter_(new BasicFetchingItemsSorter::Factory)
534 , volumeImageReadyInHighQuality_(false) 540 , volumeImageReadyInHighQuality_(false)
535 , medadataSchedulingPriority_(0) 541 , medadataSchedulingPriority_(0)
568 OrthancSeriesVolumeProgressiveLoader::~OrthancSeriesVolumeProgressiveLoader() 574 OrthancSeriesVolumeProgressiveLoader::~OrthancSeriesVolumeProgressiveLoader()
569 { 575 {
570 LOG(TRACE) << "OrthancSeriesVolumeProgressiveLoader::~OrthancSeriesVolumeProgressiveLoader()"; 576 LOG(TRACE) << "OrthancSeriesVolumeProgressiveLoader::~OrthancSeriesVolumeProgressiveLoader()";
571 } 577 }
572 578
579 void OrthancSeriesVolumeProgressiveLoader::SetStartCenter(bool startCenter)
580 {
581 startCenter_ = startCenter;
582 }
583
573 void OrthancSeriesVolumeProgressiveLoader::SetSimultaneousDownloads(unsigned int count) 584 void OrthancSeriesVolumeProgressiveLoader::SetSimultaneousDownloads(unsigned int count)
574 { 585 {
575 if (active_) 586 if (active_)
576 { 587 {
577 LOG(ERROR) << "OrthancSeriesVolumeProgressiveLoader::SetSimultaneousDownloads(): (active_)"; 588 LOG(ERROR) << "OrthancSeriesVolumeProgressiveLoader::SetSimultaneousDownloads(): (active_)";