Mercurial > hg > orthanc-wsi
changeset 236:b0ee417b667a
migrating new definitions in namespace Orthanc to namespace OrthancWSI
author | Sebastien Jodogne <s.jodogne@gmail.com> |
---|---|
date | Tue, 23 Feb 2021 10:27:58 +0100 |
parents | 8a5b2b068e52 |
children | c2863f5204a8 |
files | Applications/ApplicationToolbox.cpp Applications/ApplicationToolbox.h Applications/Dicomizer.cpp Framework/Algorithms/ReconstructPyramidCommand.cpp Framework/Algorithms/ReconstructPyramidCommand.h Framework/Algorithms/TranscodeTileCommand.cpp Framework/Algorithms/TranscodeTileCommand.h Framework/MultiThreading/BagOfTasks.h Framework/MultiThreading/BagOfTasksProcessor.cpp Framework/MultiThreading/BagOfTasksProcessor.h Framework/MultiThreading/ICommand.h Framework/Outputs/DicomPyramidWriter.cpp |
diffstat | 12 files changed, 27 insertions(+), 27 deletions(-) [+] |
line wrap: on
line diff
--- 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<Orthanc::BagOfTasksProcessor::Handle> handle(processor.Submit(tasks)); + BagOfTasksProcessor processor(threadsCount); + std::unique_ptr<BagOfTasksProcessor::Handle> 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<Orthanc::ICommand> task(tasks.Pop()); + std::unique_ptr<ICommand> task(tasks.Pop()); if (task->Execute()) { unsigned int progress = static_cast<unsigned int>(100.0f *
--- 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,
--- 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";
--- 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,
--- 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,
--- 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)
--- 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);
--- 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 <list> #include <cstddef> -namespace Orthanc +namespace OrthancWSI { class BagOfTasks : public boost::noncopyable {
--- 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 <stdio.h> -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<IDynamicObject> obj(that->queue_.Dequeue(100)); + std::unique_ptr<Orthanc::IDynamicObject> obj(that->queue_.Dequeue(100)); if (obj.get() != NULL) { Task& task = *dynamic_cast<Task*>(obj.get()); @@ -206,7 +206,7 @@ { if (countThreads == 0) { - throw OrthancException(ErrorCode_ParameterOutOfRange); + throw Orthanc::OrthancException(Orthanc::ErrorCode_ParameterOutOfRange); } threads_.resize(countThreads);
--- 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 <stdint.h> #include <map> -namespace Orthanc +namespace OrthancWSI { class BagOfTasksProcessor : public boost::noncopyable { @@ -68,7 +68,7 @@ typedef std::map<uint64_t, Bag> Bags; typedef std::map<uint64_t, bool> ExitStatus; - SharedMessageQueue queue_; + Orthanc::SharedMessageQueue queue_; boost::mutex mutex_; uint64_t countBags_;
--- 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 <IDynamicObject.h> -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;
--- 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<DcmItem> item(new DcmItem); std::unique_ptr<DcmItem> item2(new DcmItem); - OrthancWSI::DicomToolbox::SetStringTag(*item2, DCM_SliceThickness, - boost::lexical_cast<std::string>(volume_.GetDepth())); - OrthancWSI::DicomToolbox::SetStringTag(*item2, DCM_PixelSpacing, spacing); + DicomToolbox::SetStringTag(*item2, DCM_SliceThickness, + boost::lexical_cast<std::string>(volume_.GetDepth())); + DicomToolbox::SetStringTag(*item2, DCM_PixelSpacing, spacing); std::unique_ptr<DcmSequenceOfItems> sequence2(new DcmSequenceOfItems(DCM_PixelMeasuresSequence)); if (!sequence2->insert(item2.release(), false, false).good())