# HG changeset patch # User Sebastien Jodogne # Date 1614072478 -3600 # Node ID b0ee417b667a18e091ef3d81e8a54539c8dd8b84 # Parent 8a5b2b068e52beddb77a49c56a91665b0517ec33 migrating new definitions in namespace Orthanc to namespace OrthancWSI diff -r 8a5b2b068e52 -r b0ee417b667a Applications/ApplicationToolbox.cpp --- a/Applications/ApplicationToolbox.cpp Thu Jan 14 11:18:36 2021 +0100 +++ b/Applications/ApplicationToolbox.cpp Tue Feb 23 10:27:58 2021 +0100 @@ -80,7 +80,7 @@ } - static void PrintProgress(Orthanc::BagOfTasksProcessor::Handle* handle, + static void PrintProgress(BagOfTasksProcessor::Handle* handle, bool* done) { unsigned int previous = 0; @@ -99,7 +99,7 @@ } - void Execute(Orthanc::BagOfTasks& tasks, + void Execute(BagOfTasks& tasks, unsigned int threadsCount) { if (threadsCount > 1) @@ -107,8 +107,8 @@ // Submit the tasks to a newly-created processor LOG(WARNING) << "Running " << tasks.GetSize() << " tasks"; LOG(WARNING) << "Using " << threadsCount << " threads for the computation"; - Orthanc::BagOfTasksProcessor processor(threadsCount); - std::unique_ptr handle(processor.Submit(tasks)); + BagOfTasksProcessor processor(threadsCount); + std::unique_ptr handle(processor.Submit(tasks)); // Start a thread to display the progress bool done = false; @@ -145,7 +145,7 @@ // No multithreading while (!tasks.IsEmpty()) { - std::unique_ptr task(tasks.Pop()); + std::unique_ptr task(tasks.Pop()); if (task->Execute()) { unsigned int progress = static_cast(100.0f * diff -r 8a5b2b068e52 -r b0ee417b667a Applications/ApplicationToolbox.h --- a/Applications/ApplicationToolbox.h Thu Jan 14 11:18:36 2021 +0100 +++ b/Applications/ApplicationToolbox.h Tue Feb 23 10:27:58 2021 +0100 @@ -37,7 +37,7 @@ void GlobalFinalize(); - void Execute(Orthanc::BagOfTasks& tasks, + void Execute(BagOfTasks& tasks, unsigned int threadsCount); void ParseColor(uint8_t& red, diff -r 8a5b2b068e52 -r b0ee417b667a Applications/Dicomizer.cpp --- a/Applications/Dicomizer.cpp Thu Jan 14 11:18:36 2021 +0100 +++ b/Applications/Dicomizer.cpp Tue Feb 23 10:27:58 2021 +0100 @@ -111,7 +111,7 @@ { LOG(WARNING) << "Transcoding the source pyramid (not re-encoding)"; - Orthanc::BagOfTasks tasks; + OrthancWSI::BagOfTasks tasks; for (unsigned int i = 0; i < source.GetLevelCount(); i++) { @@ -131,7 +131,7 @@ { LOG(WARNING) << "Re-encoding the source pyramid (not transcoding, slower process)"; - Orthanc::BagOfTasks tasks; + OrthancWSI::BagOfTasks tasks; unsigned int levelsCount = parameters.GetPyramidLevelsCount(target, source); LOG(WARNING) << "The target pyramid will have " << levelsCount << " levels"; diff -r 8a5b2b068e52 -r b0ee417b667a Framework/Algorithms/ReconstructPyramidCommand.cpp --- a/Framework/Algorithms/ReconstructPyramidCommand.cpp Thu Jan 14 11:18:36 2021 +0100 +++ b/Framework/Algorithms/ReconstructPyramidCommand.cpp Tue Feb 23 10:27:58 2021 +0100 @@ -160,7 +160,7 @@ } - void ReconstructPyramidCommand::PrepareBagOfTasks(Orthanc::BagOfTasks& tasks, + void ReconstructPyramidCommand::PrepareBagOfTasks(BagOfTasks& tasks, IPyramidWriter& target, ITiledPyramid& source, unsigned int countLevels, diff -r 8a5b2b068e52 -r b0ee417b667a Framework/Algorithms/ReconstructPyramidCommand.h --- a/Framework/Algorithms/ReconstructPyramidCommand.h Thu Jan 14 11:18:36 2021 +0100 +++ b/Framework/Algorithms/ReconstructPyramidCommand.h Tue Feb 23 10:27:58 2021 +0100 @@ -28,7 +28,7 @@ namespace OrthancWSI { - class ReconstructPyramidCommand : public Orthanc::ICommand + class ReconstructPyramidCommand : public ICommand { private: IPyramidWriter& target_; @@ -63,7 +63,7 @@ virtual bool Execute() ORTHANC_OVERRIDE; - static void PrepareBagOfTasks(Orthanc::BagOfTasks& tasks, + static void PrepareBagOfTasks(BagOfTasks& tasks, IPyramidWriter& target, ITiledPyramid& source, unsigned int countLevels, diff -r 8a5b2b068e52 -r b0ee417b667a Framework/Algorithms/TranscodeTileCommand.cpp --- a/Framework/Algorithms/TranscodeTileCommand.cpp Thu Jan 14 11:18:36 2021 +0100 +++ b/Framework/Algorithms/TranscodeTileCommand.cpp Tue Feb 23 10:27:58 2021 +0100 @@ -86,7 +86,7 @@ } - void TranscodeTileCommand::PrepareBagOfTasks(Orthanc::BagOfTasks& tasks, + void TranscodeTileCommand::PrepareBagOfTasks(BagOfTasks& tasks, IPyramidWriter& target, ITiledPyramid& source, const DicomizerParameters& parameters) diff -r 8a5b2b068e52 -r b0ee417b667a Framework/Algorithms/TranscodeTileCommand.h --- a/Framework/Algorithms/TranscodeTileCommand.h Thu Jan 14 11:18:36 2021 +0100 +++ b/Framework/Algorithms/TranscodeTileCommand.h Tue Feb 23 10:27:58 2021 +0100 @@ -27,7 +27,7 @@ namespace OrthancWSI { - class TranscodeTileCommand : public Orthanc::ICommand + class TranscodeTileCommand : public ICommand { private: IPyramidWriter& target_; @@ -51,7 +51,7 @@ virtual bool Execute() ORTHANC_OVERRIDE; - static void PrepareBagOfTasks(Orthanc::BagOfTasks& tasks, + static void PrepareBagOfTasks(BagOfTasks& tasks, IPyramidWriter& target, ITiledPyramid& source, const DicomizerParameters& parameters); diff -r 8a5b2b068e52 -r b0ee417b667a Framework/MultiThreading/BagOfTasks.h --- a/Framework/MultiThreading/BagOfTasks.h Thu Jan 14 11:18:36 2021 +0100 +++ b/Framework/MultiThreading/BagOfTasks.h Tue Feb 23 10:27:58 2021 +0100 @@ -26,7 +26,7 @@ #include #include -namespace Orthanc +namespace OrthancWSI { class BagOfTasks : public boost::noncopyable { diff -r 8a5b2b068e52 -r b0ee417b667a Framework/MultiThreading/BagOfTasksProcessor.cpp --- a/Framework/MultiThreading/BagOfTasksProcessor.cpp Thu Jan 14 11:18:36 2021 +0100 +++ b/Framework/MultiThreading/BagOfTasksProcessor.cpp Tue Feb 23 10:27:58 2021 +0100 @@ -27,9 +27,9 @@ #include -namespace Orthanc +namespace OrthancWSI { - class BagOfTasksProcessor::Task : public IDynamicObject + class BagOfTasksProcessor::Task : public Orthanc::IDynamicObject { private: uint64_t bag_; @@ -49,7 +49,7 @@ { return command_->Execute(); } - catch (OrthancException& e) + catch (Orthanc::OrthancException& e) { LOG(ERROR) << "Exception while processing a bag of tasks: " << e.What(); return false; @@ -91,7 +91,7 @@ { while (that->continue_) { - std::unique_ptr obj(that->queue_.Dequeue(100)); + std::unique_ptr obj(that->queue_.Dequeue(100)); if (obj.get() != NULL) { Task& task = *dynamic_cast(obj.get()); @@ -206,7 +206,7 @@ { if (countThreads == 0) { - throw OrthancException(ErrorCode_ParameterOutOfRange); + throw Orthanc::OrthancException(Orthanc::ErrorCode_ParameterOutOfRange); } threads_.resize(countThreads); diff -r 8a5b2b068e52 -r b0ee417b667a Framework/MultiThreading/BagOfTasksProcessor.h --- a/Framework/MultiThreading/BagOfTasksProcessor.h Thu Jan 14 11:18:36 2021 +0100 +++ b/Framework/MultiThreading/BagOfTasksProcessor.h Tue Feb 23 10:27:58 2021 +0100 @@ -28,7 +28,7 @@ #include #include -namespace Orthanc +namespace OrthancWSI { class BagOfTasksProcessor : public boost::noncopyable { @@ -68,7 +68,7 @@ typedef std::map Bags; typedef std::map ExitStatus; - SharedMessageQueue queue_; + Orthanc::SharedMessageQueue queue_; boost::mutex mutex_; uint64_t countBags_; diff -r 8a5b2b068e52 -r b0ee417b667a Framework/MultiThreading/ICommand.h --- a/Framework/MultiThreading/ICommand.h Thu Jan 14 11:18:36 2021 +0100 +++ b/Framework/MultiThreading/ICommand.h Tue Feb 23 10:27:58 2021 +0100 @@ -23,13 +23,13 @@ #include -namespace Orthanc +namespace OrthancWSI { /** * This class is the base class for the "Command" design pattern. * http://en.wikipedia.org/wiki/Command_pattern **/ - class ICommand : public IDynamicObject + class ICommand : public Orthanc::IDynamicObject { public: virtual bool Execute() = 0; diff -r 8a5b2b068e52 -r b0ee417b667a Framework/Outputs/DicomPyramidWriter.cpp --- a/Framework/Outputs/DicomPyramidWriter.cpp Thu Jan 14 11:18:36 2021 +0100 +++ b/Framework/Outputs/DicomPyramidWriter.cpp Tue Feb 23 10:27:58 2021 +0100 @@ -158,9 +158,9 @@ std::unique_ptr item(new DcmItem); std::unique_ptr item2(new DcmItem); - OrthancWSI::DicomToolbox::SetStringTag(*item2, DCM_SliceThickness, - boost::lexical_cast(volume_.GetDepth())); - OrthancWSI::DicomToolbox::SetStringTag(*item2, DCM_PixelSpacing, spacing); + DicomToolbox::SetStringTag(*item2, DCM_SliceThickness, + boost::lexical_cast(volume_.GetDepth())); + DicomToolbox::SetStringTag(*item2, DCM_PixelSpacing, spacing); std::unique_ptr sequence2(new DcmSequenceOfItems(DCM_PixelMeasuresSequence)); if (!sequence2->insert(item2.release(), false, false).good())