# HG changeset patch # User Sebastien Jodogne # Date 1605023722 -3600 # Node ID 52b8b96cb55f0ded3f268a9d87181561856b7350 # Parent 5cdc5b98f14d0bb476ec988118ae881ac93c0894 cleaning namespaces diff -r 5cdc5b98f14d -r 52b8b96cb55f Applications/Samples/Common/RtViewerApp.h --- a/Applications/Samples/Common/RtViewerApp.h Tue Nov 10 16:41:11 2020 +0100 +++ b/Applications/Samples/Common/RtViewerApp.h Tue Nov 10 16:55:22 2020 +0100 @@ -73,8 +73,8 @@ #if ORTHANC_ENABLE_SDL public: void RunSdl(int argc, char* argv[]); - void SdlRunLoop(const std::vector >& views, - OrthancStone::DefaultViewportInteractor& interactor); + void SdlRunLoop(const std::vector >& views, + DefaultViewportInteractor& interactor); private: void ProcessOptions(int argc, char* argv[]); void HandleApplicationEvent(const SDL_Event& event); @@ -126,10 +126,10 @@ // TODO: wire this void HandleCTLoaded(const OrthancSeriesVolumeProgressiveLoader::VolumeImageReadyInHighQuality& message); - void HandleCTContentUpdated(const OrthancStone::DicomVolumeImage::ContentUpdatedMessage& message); - void HandleDoseLoaded(const OrthancStone::DicomVolumeImage::ContentUpdatedMessage& message); - void HandleStructuresReady(const OrthancStone::DicomStructureSetLoader::StructuresReady& message); - void HandleStructuresUpdated(const OrthancStone::DicomStructureSetLoader::StructuresUpdated& message); + void HandleCTContentUpdated(const DicomVolumeImage::ContentUpdatedMessage& message); + void HandleDoseLoaded(const DicomVolumeImage::ContentUpdatedMessage& message); + void HandleStructuresReady(const DicomStructureSetLoader::StructuresReady& message); + void HandleStructuresUpdated(const DicomStructureSetLoader::StructuresUpdated& message); private: @@ -156,7 +156,7 @@ reference for the geometry (position and dimensions of the volume + size of each voxel). It could be changed to be the dose instead, but the CT is chosen because it usually has a better spatial resolution. */ - boost::shared_ptr geometryProvider_; + boost::shared_ptr geometryProvider_; boost::shared_ptr activeTracker_; diff -r 5cdc5b98f14d -r 52b8b96cb55f Applications/Samples/Common/RtViewerView.cpp --- a/Applications/Samples/Common/RtViewerView.cpp Tue Nov 10 16:41:11 2020 +0100 +++ b/Applications/Samples/Common/RtViewerView.cpp Tue Nov 10 16:55:22 2020 +0100 @@ -74,7 +74,7 @@ Scene2D& scene = controller.GetScene(); // do not try to use stuff too early! - const OrthancStone::ICompositor& compositor = lock->GetCompositor(); + const ICompositor& compositor = lock->GetCompositor(); std::stringstream msg; @@ -161,14 +161,14 @@ void RtViewerView::Invalidate() { - std::unique_ptr lock(viewport_->Lock()); + std::unique_ptr lock(viewport_->Lock()); lock->GetCompositor().FitContent(lock->GetController().GetScene()); lock->Invalidate(); } void RtViewerView::FitContent() { - std::unique_ptr lock(viewport_->Lock()); + std::unique_ptr lock(viewport_->Lock()); lock->GetCompositor().FitContent(lock->GetController().GetScene()); lock->Invalidate(); } @@ -314,15 +314,15 @@ this->SetStructureSet(rtstructLoader); } - void RtViewerView::SetCtVolumeSlicer(const boost::shared_ptr& volume, - OrthancStone::ILayerStyleConfigurator* style) + void RtViewerView::SetCtVolumeSlicer(const boost::shared_ptr& volume, + ILayerStyleConfigurator* style) { std::unique_ptr lock(viewport_->Lock()); ViewportController& controller = lock->GetController(); Scene2D& scene = controller.GetScene(); int depth = scene.GetMaxDepth() + 1; - ctVolumeLayerSource_.reset(new OrthancStone::VolumeSceneLayerSource(viewport_, depth, volume)); + ctVolumeLayerSource_.reset(new VolumeSceneLayerSource(viewport_, depth, volume)); if (style != NULL) { @@ -332,15 +332,15 @@ ctLayer_ = depth; } - void RtViewerView::SetDoseVolumeSlicer(const boost::shared_ptr& volume, - OrthancStone::ILayerStyleConfigurator* style) + void RtViewerView::SetDoseVolumeSlicer(const boost::shared_ptr& volume, + ILayerStyleConfigurator* style) { std::unique_ptr lock(viewport_->Lock()); ViewportController& controller = lock->GetController(); Scene2D& scene = controller.GetScene(); int depth = scene.GetMaxDepth() + 1; - doseVolumeLayerSource_.reset(new OrthancStone::VolumeSceneLayerSource(viewport_, depth, volume)); + doseVolumeLayerSource_.reset(new VolumeSceneLayerSource(viewport_, depth, volume)); if (style != NULL) { @@ -348,13 +348,13 @@ } } - void RtViewerView::SetStructureSet(const boost::shared_ptr& volume) + void RtViewerView::SetStructureSet(const boost::shared_ptr& volume) { std::unique_ptr lock(viewport_->Lock()); ViewportController& controller = lock->GetController(); Scene2D& scene = controller.GetScene(); int depth = scene.GetMaxDepth() + 1; - structLayerSource_.reset(new OrthancStone::VolumeSceneLayerSource(viewport_, depth, volume)); + structLayerSource_.reset(new VolumeSceneLayerSource(viewport_, depth, volume)); } } diff -r 5cdc5b98f14d -r 52b8b96cb55f Applications/Samples/Common/RtViewerView.h --- a/Applications/Samples/Common/RtViewerView.h Tue Nov 10 16:41:11 2020 +0100 +++ b/Applications/Samples/Common/RtViewerView.h Tue Nov 10 16:55:22 2020 +0100 @@ -135,13 +135,11 @@ boost::weak_ptr app_; boost::shared_ptr ctVolumeLayerSource_, doseVolumeLayerSource_, structLayerSource_; - // collection of cutting planes for this particular view - std::vector planes_; - size_t currentPlane_; - - VolumeProjection projection_; - - std::map infoTextMap_; + // collection of cutting planes for this particular view + std::vector planes_; + size_t currentPlane_; + VolumeProjection projection_; + std::map infoTextMap_; int FLOATING_INFOTEXT_LAYER_ZINDEX; int FIXED_INFOTEXT_LAYER_ZINDEX; diff -r 5cdc5b98f14d -r 52b8b96cb55f Applications/Samples/Sdl/RtViewer/RtViewerSdl.cpp --- a/Applications/Samples/Sdl/RtViewer/RtViewerSdl.cpp Tue Nov 10 16:41:11 2020 +0100 +++ b/Applications/Samples/Sdl/RtViewer/RtViewerSdl.cpp Tue Nov 10 16:55:22 2020 +0100 @@ -232,30 +232,30 @@ Orthanc::IImageWriter::WriteToFile(writer, target, png); } - static boost::shared_ptr GetViewFromWindowId( - const std::vector >& views, + static boost::shared_ptr GetViewFromWindowId( + const std::vector >& views, Uint32 windowID) { using namespace OrthancStone; for (size_t i = 0; i < views.size(); ++i) { - boost::shared_ptr view = views[i]; + boost::shared_ptr view = views[i]; boost::shared_ptr viewport = view->GetViewport(); boost::shared_ptr sdlViewport = boost::dynamic_pointer_cast(viewport); Uint32 curWindowID = sdlViewport->GetSdlWindowId(); if (windowID == curWindowID) return view; } - return boost::shared_ptr(); + return boost::shared_ptr(); } - void RtViewerApp::SdlRunLoop(const std::vector >& views, - OrthancStone::DefaultViewportInteractor& interactor) + void RtViewerApp::SdlRunLoop(const std::vector >& views, + DefaultViewportInteractor& interactor) { using namespace OrthancStone; - // const std::vector >& views - std::vector > viewports; + // const std::vector >& views + std::vector > viewports; for (size_t i = 0; i < views.size(); ++i) { boost::shared_ptr view = views[i]; @@ -334,7 +334,7 @@ boost::dynamic_pointer_cast(view->GetViewport()); { - std::unique_ptr lock(sdlViewport->Lock()); + std::unique_ptr lock(sdlViewport->Lock()); lock->RefreshCanvasSize(); } } @@ -356,7 +356,7 @@ case SDLK_s: { - std::unique_ptr lock(view->GetViewport()->Lock()); + std::unique_ptr lock(view->GetViewport()->Lock()); lock->GetCompositor().FitContent(lock->GetController().GetScene()); lock->Invalidate(); } @@ -377,10 +377,10 @@ boost::shared_ptr view = GetViewFromWindowId( views, sdlEvent.window.windowID); - std::unique_ptr lock(view->GetViewport()->Lock()); + std::unique_ptr lock(view->GetViewport()->Lock()); if (lock->HasCompositor()) { - OrthancStone::PointerEvent p; + PointerEvent p; OrthancStoneHelpers::GetPointerEvent(p, lock->GetCompositor(), sdlEvent, keyboardState, scancodeCount); diff -r 5cdc5b98f14d -r 52b8b96cb55f Applications/Samples/WebAssembly/RtViewer/RtViewerWasm.cpp --- a/Applications/Samples/WebAssembly/RtViewer/RtViewerWasm.cpp Tue Nov 10 16:41:11 2020 +0100 +++ b/Applications/Samples/WebAssembly/RtViewer/RtViewerWasm.cpp Tue Nov 10 16:55:22 2020 +0100 @@ -131,7 +131,7 @@ void RtViewerApp::RunWasm() { - loadersContext_.reset(new OrthancStone::WebAssemblyLoadersContext(1, 4, 1)); + loadersContext_.reset(new WebAssemblyLoadersContext(1, 4, 1)); // we are in WASM --> downcast to concrete type boost::shared_ptr loadersContext = diff -r 5cdc5b98f14d -r 52b8b96cb55f OrthancStone/Sources/Loaders/DicomResourcesLoader.cpp --- a/OrthancStone/Sources/Loaders/DicomResourcesLoader.cpp Tue Nov 10 16:41:11 2020 +0100 +++ b/OrthancStone/Sources/Loaders/DicomResourcesLoader.cpp Tue Nov 10 16:55:22 2020 +0100 @@ -387,7 +387,7 @@ #if ORTHANC_ENABLE_DCMTK == 1 - static void ExploreDicomDir(OrthancStone::LoadedDicomResources& instances, + static void ExploreDicomDir(LoadedDicomResources& instances, const Orthanc::ParsedDicomDir& dicomDir, Orthanc::ResourceType level, size_t index, diff -r 5cdc5b98f14d -r 52b8b96cb55f OrthancStone/Sources/Loaders/DicomResourcesLoader.h --- a/OrthancStone/Sources/Loaders/DicomResourcesLoader.h Tue Nov 10 16:41:11 2020 +0100 +++ b/OrthancStone/Sources/Loaders/DicomResourcesLoader.h Tue Nov 10 16:55:22 2020 +0100 @@ -103,7 +103,7 @@ public: - class SuccessMessage : public OrthancStone::OriginMessage + class SuccessMessage : public OriginMessage { ORTHANC_STONE_MESSAGE(__FILE__, __LINE__); diff -r 5cdc5b98f14d -r 52b8b96cb55f OrthancStone/Sources/Loaders/DicomStructureSetLoader.cpp --- a/OrthancStone/Sources/Loaders/DicomStructureSetLoader.cpp Tue Nov 10 16:41:11 2020 +0100 +++ b/OrthancStone/Sources/Loaders/DicomStructureSetLoader.cpp Tue Nov 10 16:55:22 2020 +0100 @@ -92,7 +92,7 @@ { } - virtual void Handle(const OrthancStone::OrthancRestApiCommand::SuccessMessage& message) ORTHANC_OVERRIDE + virtual void Handle(const OrthancRestApiCommand::SuccessMessage& message) ORTHANC_OVERRIDE { Json::Value tags; message.ParseJsonBody(tags); @@ -121,7 +121,7 @@ { } - virtual void Handle(const OrthancStone::OrthancRestApiCommand::SuccessMessage& message) ORTHANC_OVERRIDE + virtual void Handle(const OrthancRestApiCommand::SuccessMessage& message) ORTHANC_OVERRIDE { DicomStructureSetLoader& loader = GetLoader(); @@ -138,7 +138,7 @@ { std::stringstream msg; msg << "Unknown resource! message.GetAnswer() = " << message.GetAnswer() << " message.GetAnswerHeaders() = "; - for (OrthancStone::OrthancRestApiCommand::HttpHeaders::const_iterator it = message.GetAnswerHeaders().begin(); + for (OrthancRestApiCommand::HttpHeaders::const_iterator it = message.GetAnswerHeaders().begin(); it != message.GetAnswerHeaders().end(); ++it) { msg << "\nkey: \"" << it->first << "\" value: \"" << it->second << "\"\n"; @@ -151,7 +151,7 @@ const std::string instanceId = lookup[0]["ID"].asString(); { - std::unique_ptr command(new OrthancStone::OrthancRestApiCommand); + std::unique_ptr command(new OrthancRestApiCommand); command->SetHttpHeader("Accept-Encoding", "gzip"); std::string uri = "/instances/" + instanceId + "/tags"; command->SetUri(uri); @@ -168,7 +168,7 @@ it != nonEmptyInstances.end(); ++it) { - std::unique_ptr command(new OrthancStone::OrthancRestApiCommand); + std::unique_ptr command(new OrthancRestApiCommand); command->SetUri("/tools/lookup"); command->SetMethod(Orthanc::HttpMethod_Post); command->SetBody(*it); @@ -185,7 +185,7 @@ { } - virtual void Handle(const OrthancStone::OrthancRestApiCommand::SuccessMessage& message) ORTHANC_OVERRIDE + virtual void Handle(const OrthancRestApiCommand::SuccessMessage& message) ORTHANC_OVERRIDE { DicomStructureSetLoader& loader = GetLoader(); @@ -193,7 +193,7 @@ { FullOrthancDataset dicom(message.GetAnswer()); - loader.content_.reset(new OrthancStone::DicomStructureSet(dicom)); + loader.content_.reset(new DicomStructureSet(dicom)); } // initialize visibility flags @@ -273,7 +273,7 @@ class DicomStructureSetLoader::Slice : public IExtractedSlice { private: - const OrthancStone::DicomStructureSet& content_; + const DicomStructureSet& content_; uint64_t revision_; bool isValid_; std::vector visibility_; @@ -289,9 +289,9 @@ In the second case, the visibility of each structure is defined by the content of the vector at the corresponding index. */ - Slice(const OrthancStone::DicomStructureSet& content, + Slice(const DicomStructureSet& content, uint64_t revision, - const OrthancStone::CoordinateSystem3D& cuttingPlane, + const CoordinateSystem3D& cuttingPlane, const std::vector& visibility) : content_(content), revision_(revision), @@ -302,11 +302,11 @@ bool opposite; - const OrthancStone::Vector normal = content.GetNormal(); + const Vector normal = content.GetNormal(); isValid_ = ( - OrthancStone::GeometryToolbox::IsParallelOrOpposite(opposite, normal, cuttingPlane.GetNormal()) || - OrthancStone::GeometryToolbox::IsParallelOrOpposite(opposite, normal, cuttingPlane.GetAxisX()) || - OrthancStone::GeometryToolbox::IsParallelOrOpposite(opposite, normal, cuttingPlane.GetAxisY())); + GeometryToolbox::IsParallelOrOpposite(opposite, normal, cuttingPlane.GetNormal()) || + GeometryToolbox::IsParallelOrOpposite(opposite, normal, cuttingPlane.GetAxisX()) || + GeometryToolbox::IsParallelOrOpposite(opposite, normal, cuttingPlane.GetAxisY())); } virtual bool IsValid() ORTHANC_OVERRIDE @@ -319,23 +319,23 @@ return revision_; } - virtual OrthancStone::ISceneLayer* CreateSceneLayer( - const OrthancStone::ILayerStyleConfigurator* configurator, - const OrthancStone::CoordinateSystem3D& cuttingPlane) ORTHANC_OVERRIDE + virtual ISceneLayer* CreateSceneLayer( + const ILayerStyleConfigurator* configurator, + const CoordinateSystem3D& cuttingPlane) ORTHANC_OVERRIDE { assert(isValid_); - std::unique_ptr layer(new OrthancStone::PolylineSceneLayer); + std::unique_ptr layer(new PolylineSceneLayer); layer->SetThickness(2); for (size_t i = 0; i < content_.GetStructuresCount(); i++) { if ((visibility_.size() == 0) || visibility_.at(i)) { - const OrthancStone::Color& color = content_.GetStructureColor(i); + const Color& color = content_.GetStructureColor(i); #ifdef USE_BOOST_UNION_FOR_POLYGONS - std::vector< std::vector > polygons; + std::vector< std::vector > polygons; if (content_.ProjectStructure(polygons, i, cuttingPlane)) { @@ -353,17 +353,17 @@ } } #else - std::vector< std::pair > segments; + std::vector< std::pair > segments; if (content_.ProjectStructure(segments, i, cuttingPlane)) { for (size_t j = 0; j < segments.size(); j++) { - OrthancStone::PolylineSceneLayer::Chain chain; + PolylineSceneLayer::Chain chain; chain.resize(2); - chain[0] = OrthancStone::ScenePoint2D(segments[j].first.x, segments[j].first.y); - chain[1] = OrthancStone::ScenePoint2D(segments[j].second.x, segments[j].second.y); + chain[0] = ScenePoint2D(segments[j].first.x, segments[j].first.y); + chain[1] = ScenePoint2D(segments[j].second.x, segments[j].second.y); layer->AddChain(chain, false /* NOT closed */, color); } @@ -378,7 +378,7 @@ DicomStructureSetLoader::DicomStructureSetLoader( - OrthancStone::ILoadersContext& loadersContext) + ILoadersContext& loadersContext) : LoaderStateMachine(loadersContext) , loadersContext_(loadersContext) , revision_(0) @@ -390,7 +390,7 @@ instanceLookupHandler_ = RestInstanceLookupHandler::Create(*this); } - boost::shared_ptr DicomStructureSetLoader::Create(OrthancStone::ILoadersContext& loadersContext) + boost::shared_ptr DicomStructureSetLoader::Create(ILoadersContext& loadersContext) { boost::shared_ptr obj( new DicomStructureSetLoader( @@ -445,7 +445,7 @@ initiallyVisibleStructures_ = initiallyVisibleStructures; { - std::unique_ptr command(new OrthancStone::OrthancRestApiCommand); + std::unique_ptr command(new OrthancRestApiCommand); command->SetHttpHeader("Accept-Encoding", "gzip"); std::string uri = "/instances/" + instanceId + "/tags?ignore-length=3006-0050"; @@ -463,12 +463,12 @@ LoadInstance(instanceId, initiallyVisibleStructures); } - OrthancStone::IVolumeSlicer::IExtractedSlice* DicomStructureSetLoader::ExtractSlice(const OrthancStone::CoordinateSystem3D& cuttingPlane) + IVolumeSlicer::IExtractedSlice* DicomStructureSetLoader::ExtractSlice(const CoordinateSystem3D& cuttingPlane) { if (content_.get() == NULL) { // Geometry is not available yet - return new OrthancStone::IVolumeSlicer::InvalidSlice; + return new IVolumeSlicer::InvalidSlice; } else { diff -r 5cdc5b98f14d -r 52b8b96cb55f OrthancStone/Sources/Loaders/DicomStructureSetLoader.h --- a/OrthancStone/Sources/Loaders/DicomStructureSetLoader.h Tue Nov 10 16:41:11 2020 +0100 +++ b/OrthancStone/Sources/Loaders/DicomStructureSetLoader.h Tue Nov 10 16:55:22 2020 +0100 @@ -33,8 +33,8 @@ { class DicomStructureSetLoader : public LoaderStateMachine, - public OrthancStone::IVolumeSlicer, - public OrthancStone::IObservable + public IVolumeSlicer, + public IObservable { public: ORTHANC_STONE_DEFINE_ORIGIN_MESSAGE(__FILE__, __LINE__, StructuresReady, DicomStructureSetLoader); @@ -62,14 +62,14 @@ class RestInstanceLookupHandler; static boost::shared_ptr Create( - OrthancStone::ILoadersContext& loadersContext); + ILoadersContext& loadersContext); void SetInstanceLookupHandler(boost::shared_ptr instanceLookupHandler) { instanceLookupHandler_ = instanceLookupHandler; } - OrthancStone::DicomStructureSet* GetContent() + DicomStructureSet* GetContent() { return content_.get(); } @@ -89,7 +89,7 @@ void LoadInstanceFullVisibility(const std::string& instanceId); - virtual IExtractedSlice* ExtractSlice(const OrthancStone::CoordinateSystem3D& cuttingPlane) ORTHANC_OVERRIDE; + virtual IExtractedSlice* ExtractSlice(const CoordinateSystem3D& cuttingPlane) ORTHANC_OVERRIDE; void SetStructuresReady(); void SetStructuresUpdated(); @@ -108,15 +108,15 @@ // Only state of LoaderStateMachine class LoadStructure; // 1st state - OrthancStone::ILoadersContext& loadersContext_; - std::unique_ptr content_; - uint64_t revision_; - std::string instanceId_; - unsigned int countProcessedInstances_; - unsigned int countReferencedInstances_; + ILoadersContext& loadersContext_; + std::unique_ptr content_; + uint64_t revision_; + std::string instanceId_; + unsigned int countProcessedInstances_; + unsigned int countReferencedInstances_; // will be set to true once the loading is finished - bool structuresReady_; + bool structuresReady_; /** At load time, these strings are used to initialize the structureVisibility_ @@ -142,6 +142,6 @@ void RetrieveReferencedSlices(const std::set& nonEmptyInstances); protected: - explicit DicomStructureSetLoader(OrthancStone::ILoadersContext& loadersContext); + explicit DicomStructureSetLoader(ILoadersContext& loadersContext); }; } diff -r 5cdc5b98f14d -r 52b8b96cb55f OrthancStone/Sources/Loaders/DicomVolumeLoader.cpp --- a/OrthancStone/Sources/Loaders/DicomVolumeLoader.cpp Tue Nov 10 16:41:11 2020 +0100 +++ b/OrthancStone/Sources/Loaders/DicomVolumeLoader.cpp Tue Nov 10 16:55:22 2020 +0100 @@ -33,7 +33,7 @@ started_(false), remaining_(0) { - volume_.reset(new OrthancStone::DicomVolumeImage); + volume_.reset(new DicomVolumeImage); const SeriesOrderedFrames& frames = framesLoader_->GetOrderedFrames(); @@ -43,11 +43,11 @@ // TODO - Is "0" the good choice for the reference frame? // Shouldn't we use "count - 1" depending on the direction // of the normal? - const OrthancStone::DicomInstanceParameters& parameters = frames.GetInstanceParameters(0); + const DicomInstanceParameters& parameters = frames.GetInstanceParameters(0); - OrthancStone::CoordinateSystem3D plane(frames.GetInstance(0)); + CoordinateSystem3D plane(frames.GetInstance(0)); - OrthancStone::VolumeImageGeometry geometry; + VolumeImageGeometry geometry; geometry.SetSizeInVoxels(parameters.GetImageInformation().GetWidth(), parameters.GetImageInformation().GetHeight(), static_cast(frames.GetFramesCount())); @@ -83,7 +83,7 @@ } - void DicomVolumeLoader::Handle(const OrthancStone::SeriesFramesLoader::FrameLoadedMessage& message) + void DicomVolumeLoader::Handle(const SeriesFramesLoader::FrameLoadedMessage& message) { if (remaining_ == 0 || !message.HasUserPayload()) diff -r 5cdc5b98f14d -r 52b8b96cb55f OrthancStone/Sources/Loaders/DicomVolumeLoader.h --- a/OrthancStone/Sources/Loaders/DicomVolumeLoader.h Tue Nov 10 16:41:11 2020 +0100 +++ b/OrthancStone/Sources/Loaders/DicomVolumeLoader.h Tue Nov 10 16:55:22 2020 +0100 @@ -42,7 +42,7 @@ DicomVolumeLoader(boost::shared_ptr& framesLoader, bool computeRange); - void Handle(const OrthancStone::SeriesFramesLoader::FrameLoadedMessage& message); + void Handle(const SeriesFramesLoader::FrameLoadedMessage& message); public: class VolumeReadyMessage : public OriginMessage diff -r 5cdc5b98f14d -r 52b8b96cb55f OrthancStone/Sources/Loaders/LoaderStateMachine.cpp --- a/OrthancStone/Sources/Loaders/LoaderStateMachine.cpp Tue Nov 10 16:41:11 2020 +0100 +++ b/OrthancStone/Sources/Loaders/LoaderStateMachine.cpp Tue Nov 10 16:55:22 2020 +0100 @@ -28,29 +28,29 @@ namespace OrthancStone { - void LoaderStateMachine::State::Handle(const OrthancStone::OrthancRestApiCommand::SuccessMessage& message) + void LoaderStateMachine::State::Handle(const OrthancRestApiCommand::SuccessMessage& message) { throw Orthanc::OrthancException(Orthanc::ErrorCode_NotImplemented); } - void LoaderStateMachine::State::Handle(const OrthancStone::GetOrthancImageCommand::SuccessMessage& message) + void LoaderStateMachine::State::Handle(const GetOrthancImageCommand::SuccessMessage& message) { throw Orthanc::OrthancException(Orthanc::ErrorCode_NotImplemented); } - void LoaderStateMachine::State::Handle(const OrthancStone::GetOrthancWebViewerJpegCommand::SuccessMessage& message) + void LoaderStateMachine::State::Handle(const GetOrthancWebViewerJpegCommand::SuccessMessage& message) { throw Orthanc::OrthancException(Orthanc::ErrorCode_NotImplemented); } - void LoaderStateMachine::Schedule(OrthancStone::OracleCommandBase* command) + void LoaderStateMachine::Schedule(OracleCommandBase* command) { LOG(TRACE) << "LoaderStateMachine(" << std::hex << this << std::dec << ")::Schedule()"; - std::unique_ptr protection(command); + std::unique_ptr protection(command); if (command == NULL) { @@ -93,7 +93,7 @@ activeCommands_ < simultaneousDownloads_) { - OrthancStone::IOracleCommand* nextCommand = pendingCommands_.front(); + IOracleCommand* nextCommand = pendingCommands_.front(); LOG(TRACE) << " LoaderStateMachine(" << std::hex << this << std::dec << ")::Step(): activeCommands_ (" << activeCommands_ << @@ -101,7 +101,7 @@ ") --> will Schedule command addr " << std::hex << nextCommand << std::dec; { - std::unique_ptr lock(loadersContext_.Lock()); + std::unique_ptr lock(loadersContext_.Lock()); boost::shared_ptr observer(GetSharedObserver()); lock->Schedule(observer, 0, nextCommand); // TODO: priority! } @@ -132,7 +132,7 @@ } - void LoaderStateMachine::HandleExceptionMessage(const OrthancStone::OracleCommandExceptionMessage& message) + void LoaderStateMachine::HandleExceptionMessage(const OracleCommandExceptionMessage& message) { LOG(ERROR) << "LoaderStateMachine::HandleExceptionMessage: error in the state machine, stopping all processing"; LOG(ERROR) << "Error: " << message.GetException().What() << " Details: " << @@ -164,34 +164,31 @@ LoaderStateMachine::LoaderStateMachine( - OrthancStone::ILoadersContext& loadersContext) + ILoadersContext& loadersContext) : loadersContext_(loadersContext) , active_(false) , simultaneousDownloads_(4) , activeCommands_(0) { - using OrthancStone::ILoadersContext; - - LOG(TRACE) - << "LoaderStateMachine(" << std::hex << this - << std::dec << ")::LoaderStateMachine()"; + LOG(TRACE) << "LoaderStateMachine(" << std::hex << this + << std::dec << ")::LoaderStateMachine()"; } void LoaderStateMachine::PostConstructor() { - std::unique_ptr + std::unique_ptr lock(loadersContext_.Lock()); - OrthancStone::IObservable& observable = lock->GetOracleObservable(); + IObservable& observable = lock->GetOracleObservable(); // TODO => Move this out of constructor - Register( + Register( observable, &LoaderStateMachine::HandleSuccessMessage); - Register( + Register( observable, &LoaderStateMachine::HandleSuccessMessage); - Register( + Register( observable, &LoaderStateMachine::HandleSuccessMessage); - Register( + Register( observable, &LoaderStateMachine::HandleExceptionMessage); } diff -r 5cdc5b98f14d -r 52b8b96cb55f OrthancStone/Sources/Loaders/LoaderStateMachine.h --- a/OrthancStone/Sources/Loaders/LoaderStateMachine.h Tue Nov 10 16:41:11 2020 +0100 +++ b/OrthancStone/Sources/Loaders/LoaderStateMachine.h Tue Nov 10 16:55:22 2020 +0100 @@ -50,7 +50,7 @@ an answer is received. */ - class LoaderStateMachine : public OrthancStone::ObserverBase + class LoaderStateMachine : public ObserverBase { public: class State : public Orthanc::IDynamicObject @@ -69,7 +69,7 @@ { } - void Schedule(OrthancStone::OracleCommandBase* command) const + void Schedule(OracleCommandBase* command) const { that_.Schedule(command); } @@ -80,14 +80,14 @@ return dynamic_cast(that_); } - virtual void Handle(const OrthancStone::OrthancRestApiCommand::SuccessMessage& message); + virtual void Handle(const OrthancRestApiCommand::SuccessMessage& message); - virtual void Handle(const OrthancStone::GetOrthancImageCommand::SuccessMessage& message); + virtual void Handle(const GetOrthancImageCommand::SuccessMessage& message); - virtual void Handle(const OrthancStone::GetOrthancWebViewerJpegCommand::SuccessMessage& message); + virtual void Handle(const GetOrthancWebViewerJpegCommand::SuccessMessage& message); }; - void Schedule(OrthancStone::OracleCommandBase* command); + void Schedule(OracleCommandBase* command); void Start(); @@ -96,14 +96,14 @@ void Clear(); - void HandleExceptionMessage(const OrthancStone::OracleCommandExceptionMessage& message); + void HandleExceptionMessage(const OracleCommandExceptionMessage& message); template void HandleSuccessMessage(const T& message); - typedef std::list PendingCommands; + typedef std::list PendingCommands; - OrthancStone::ILoadersContext& loadersContext_; + ILoadersContext& loadersContext_; bool active_; unsigned int simultaneousDownloads_; PendingCommands pendingCommands_; @@ -111,7 +111,7 @@ public: - explicit LoaderStateMachine(OrthancStone::ILoadersContext& loadersContext); + explicit LoaderStateMachine(ILoadersContext& loadersContext); void PostConstructor(); diff -r 5cdc5b98f14d -r 52b8b96cb55f OrthancStone/Sources/Loaders/OracleScheduler.cpp --- a/OrthancStone/Sources/Loaders/OracleScheduler.cpp Tue Nov 10 16:41:11 2020 +0100 +++ b/OrthancStone/Sources/Loaders/OracleScheduler.cpp Tue Nov 10 16:55:22 2020 +0100 @@ -88,7 +88,7 @@ return receiver_; } - bool IsSameReceiver(boost::shared_ptr receiver) const + bool IsSameReceiver(boost::shared_ptr receiver) const { boost::shared_ptr lock(receiver_.lock()); diff -r 5cdc5b98f14d -r 52b8b96cb55f OrthancStone/Sources/Loaders/OrthancMultiframeVolumeLoader.cpp --- a/OrthancStone/Sources/Loaders/OrthancMultiframeVolumeLoader.cpp Tue Nov 10 16:41:11 2020 +0100 +++ b/OrthancStone/Sources/Loaders/OrthancMultiframeVolumeLoader.cpp Tue Nov 10 16:55:22 2020 +0100 @@ -45,7 +45,7 @@ } - virtual void Handle(const OrthancStone::OrthancRestApiCommand::SuccessMessage& message) ORTHANC_OVERRIDE + virtual void Handle(const OrthancRestApiCommand::SuccessMessage& message) ORTHANC_OVERRIDE { // Complete the DICOM tags with just-received "Grid Frame Offset Vector" std::string s = Orthanc::Toolbox::StripSpaces(message.GetAnswer()); @@ -79,7 +79,7 @@ { } - virtual void Handle(const OrthancStone::OrthancRestApiCommand::SuccessMessage& message) + virtual void Handle(const OrthancRestApiCommand::SuccessMessage& message) { OrthancMultiframeVolumeLoader& loader = GetLoader(); @@ -94,12 +94,12 @@ std::unique_ptr dicom(new Orthanc::DicomMap); dicom->FromDicomAsJson(body); - if (OrthancStone::StringToSopClassUid(GetSopClassUid(*dicom)) == OrthancStone::SopClassUid_RTDose) + if (StringToSopClassUid(GetSopClassUid(*dicom)) == SopClassUid_RTDose) { // Download the "Grid Frame Offset Vector" DICOM tag, that is // mandatory for RT-DOSE, but is too long to be returned by default - std::unique_ptr command(new OrthancStone::OrthancRestApiCommand); + std::unique_ptr command(new OrthancRestApiCommand); command->SetUri("/instances/" + loader.GetInstanceId() + "/content/" + Orthanc::DICOM_TAG_GRID_FRAME_OFFSET_VECTOR.Format()); command->AcquirePayload(new LoadRTDoseGeometry(loader, dicom.release())); @@ -121,7 +121,7 @@ { } - virtual void Handle(const OrthancStone::OrthancRestApiCommand::SuccessMessage& message) + virtual void Handle(const OrthancRestApiCommand::SuccessMessage& message) { GetLoader().SetTransferSyntax(message.GetAnswer()); } @@ -135,7 +135,7 @@ { } - virtual void Handle(const OrthancStone::OrthancRestApiCommand::SuccessMessage& message) + virtual void Handle(const OrthancRestApiCommand::SuccessMessage& message) { GetLoader().SetUncompressedPixelData(message.GetAnswer()); } @@ -172,7 +172,7 @@ transferSyntaxUid_ == "1.2.840.10008.1.2.1" || transferSyntaxUid_ == "1.2.840.10008.1.2.2") { - std::unique_ptr command(new OrthancStone::OrthancRestApiCommand); + std::unique_ptr command(new OrthancRestApiCommand); command->SetHttpHeader("Accept-Encoding", "gzip"); command->SetUri("/instances/" + instanceId_ + "/content/" + Orthanc::DICOM_TAG_PIXEL_DATA.Format() + "/0"); @@ -195,7 +195,7 @@ void OrthancMultiframeVolumeLoader::SetGeometry(const Orthanc::DicomMap& dicom) { - OrthancStone::DicomInstanceParameters parameters(dicom); + DicomInstanceParameters parameters(dicom); volume_->SetDicomParameters(parameters); Orthanc::PixelFormat format; @@ -207,7 +207,7 @@ double spacingZ; switch (parameters.GetSopClassUid()) { - case OrthancStone::SopClassUid_RTDose: + case SopClassUid_RTDose: spacingZ = parameters.GetSliceThickness(); break; @@ -222,7 +222,7 @@ const unsigned int depth = parameters.GetImageInformation().GetNumberOfFrames(); { - OrthancStone::VolumeImageGeometry geometry; + VolumeImageGeometry geometry; geometry.SetSizeInVoxels(width, height, depth); geometry.SetAxialGeometry(parameters.GetGeometry()); geometry.SetVoxelDimensions(parameters.GetPixelSpacingX(), @@ -236,7 +236,7 @@ - BroadcastMessage(OrthancStone::DicomVolumeImage::GeometryReadyMessage(*volume_)); + BroadcastMessage(DicomVolumeImage::GeometryReadyMessage(*volume_)); } @@ -267,7 +267,7 @@ void OrthancMultiframeVolumeLoader::CopyPixelDataAndComputeDistribution( const std::string& pixelData, std::map& distribution) { - OrthancStone::ImageBuffer3D& target = volume_->GetPixelData(); + ImageBuffer3D& target = volume_->GetPixelData(); const unsigned int bpp = target.GetBytesPerPixel(); const unsigned int width = target.GetWidth(); @@ -309,7 +309,7 @@ for (unsigned int z = 0; z < depth; z++) { - OrthancStone::ImageBuffer3D::SliceWriter writer(target, OrthancStone::VolumeProjection_Axial, z); + ImageBuffer3D::SliceWriter writer(target, VolumeProjection_Axial, z); assert(writer.GetAccessor().GetWidth() == width && writer.GetAccessor().GetHeight() == height); @@ -366,7 +366,7 @@ } else { - OrthancStone::ImageBuffer3D& target = volume_->GetPixelData(); + ImageBuffer3D& target = volume_->GetPixelData(); const uint64_t width = target.GetWidth(); const uint64_t height = target.GetHeight(); @@ -517,7 +517,7 @@ volume_->IncrementRevision(); pixelDataLoaded_ = true; - BroadcastMessage(OrthancStone::DicomVolumeImage::ContentUpdatedMessage(*volume_)); + BroadcastMessage(DicomVolumeImage::ContentUpdatedMessage(*volume_)); } bool OrthancMultiframeVolumeLoader::HasGeometry() const @@ -525,14 +525,14 @@ return volume_->HasGeometry(); } - const OrthancStone::VolumeImageGeometry& OrthancMultiframeVolumeLoader::GetImageGeometry() const + const VolumeImageGeometry& OrthancMultiframeVolumeLoader::GetImageGeometry() const { return volume_->GetGeometry(); } OrthancMultiframeVolumeLoader::OrthancMultiframeVolumeLoader( - OrthancStone::ILoadersContext& loadersContext, - boost::shared_ptr volume, + ILoadersContext& loadersContext, + boost::shared_ptr volume, float outliersHalfRejectionRate) : LoaderStateMachine(loadersContext) , volume_(volume) @@ -552,8 +552,8 @@ boost::shared_ptr OrthancMultiframeVolumeLoader::Create( - OrthancStone::ILoadersContext& loadersContext, - boost::shared_ptr volume, + ILoadersContext& loadersContext, + boost::shared_ptr volume, float outliersHalfRejectionRate /*= 0.0005*/) { boost::shared_ptr obj( @@ -599,7 +599,7 @@ instanceId_ = instanceId; { - std::unique_ptr command(new OrthancStone::OrthancRestApiCommand); + std::unique_ptr command(new OrthancRestApiCommand); command->SetHttpHeader("Accept-Encoding", "gzip"); command->SetUri("/instances/" + instanceId + "/tags"); command->AcquirePayload(new LoadGeometry(*this)); @@ -607,7 +607,7 @@ } { - std::unique_ptr command(new OrthancStone::OrthancRestApiCommand); + std::unique_ptr command(new OrthancRestApiCommand); command->SetUri("/instances/" + instanceId + "/metadata/TransferSyntax"); command->AcquirePayload(new LoadTransferSyntax(*this)); Schedule(command.release()); diff -r 5cdc5b98f14d -r 52b8b96cb55f OrthancStone/Sources/Loaders/OrthancMultiframeVolumeLoader.h --- a/OrthancStone/Sources/Loaders/OrthancMultiframeVolumeLoader.h Tue Nov 10 16:41:11 2020 +0100 +++ b/OrthancStone/Sources/Loaders/OrthancMultiframeVolumeLoader.h Tue Nov 10 16:55:22 2020 +0100 @@ -32,7 +32,7 @@ { class OrthancMultiframeVolumeLoader : public LoaderStateMachine, - public OrthancStone::IObservable, + public IObservable, public IGeometryProvider { private: @@ -41,7 +41,7 @@ class LoadTransferSyntax; class LoadUncompressedPixelData; - boost::shared_ptr volume_; + boost::shared_ptr volume_; std::string instanceId_; std::string transferSyntaxUid_; bool pixelDataLoaded_; @@ -80,34 +80,31 @@ /** Service method for CopyPixelDataAndComputeMinMax*/ template - void CopyPixelDataAndComputeDistribution( - const std::string& pixelData, - std::map& distribution); + void CopyPixelDataAndComputeDistribution(const std::string& pixelData, + std::map& distribution); /** Service method for CopyPixelDataAndComputeMinMax*/ template - void ComputeMinMaxWithOutlierRejection( - const std::map& distribution); + void ComputeMinMaxWithOutlierRejection(const std::map& distribution); void SetUncompressedPixelData(const std::string& pixelData); protected: - OrthancMultiframeVolumeLoader( - OrthancStone::ILoadersContext& loadersContext, - boost::shared_ptr volume, - float outliersHalfRejectionRate); + OrthancMultiframeVolumeLoader(ILoadersContext& loadersContext, + boost::shared_ptr volume, + float outliersHalfRejectionRate); + public: - static boost::shared_ptr Create( - OrthancStone::ILoadersContext& loadersContext, - boost::shared_ptr volume, + ILoadersContext& loadersContext, + boost::shared_ptr volume, float outliersHalfRejectionRate = 0.0005); virtual ~OrthancMultiframeVolumeLoader(); bool HasGeometry() const ORTHANC_OVERRIDE; - virtual const OrthancStone::VolumeImageGeometry& GetImageGeometry() const ORTHANC_OVERRIDE; + virtual const VolumeImageGeometry& GetImageGeometry() const ORTHANC_OVERRIDE; bool IsPixelDataLoaded() const { diff -r 5cdc5b98f14d -r 52b8b96cb55f OrthancStone/Sources/Loaders/OrthancSeriesVolumeProgressiveLoader.cpp --- a/OrthancStone/Sources/Loaders/OrthancSeriesVolumeProgressiveLoader.cpp Tue Nov 10 16:41:11 2020 +0100 +++ b/OrthancStone/Sources/Loaders/OrthancSeriesVolumeProgressiveLoader.cpp Tue Nov 10 16:55:22 2020 +0100 @@ -36,22 +36,20 @@ namespace OrthancStone { - using OrthancStone::ILoadersContext; - - class OrthancSeriesVolumeProgressiveLoader::ExtractedSlice : public OrthancStone::DicomVolumeImageMPRSlicer::Slice + class OrthancSeriesVolumeProgressiveLoader::ExtractedSlice : public DicomVolumeImageMPRSlicer::Slice { private: const OrthancSeriesVolumeProgressiveLoader& that_; public: ExtractedSlice(const OrthancSeriesVolumeProgressiveLoader& that, - const OrthancStone::CoordinateSystem3D& plane) : - OrthancStone::DicomVolumeImageMPRSlicer::Slice(*that.volume_, plane), + const CoordinateSystem3D& plane) : + DicomVolumeImageMPRSlicer::Slice(*that.volume_, plane), that_(that) { if (IsValid()) { - if (GetProjection() == OrthancStone::VolumeProjection_Axial) + if (GetProjection() == VolumeProjection_Axial) { // For coronal and sagittal projections, we take the global // revision of the volume because even if a single slice changes, @@ -61,7 +59,7 @@ } if (that_.strategy_.get() != NULL && - GetProjection() == OrthancStone::VolumeProjection_Axial) + GetProjection() == VolumeProjection_Axial) { that_.strategy_->SetCurrent(GetSliceIndex()); } @@ -70,11 +68,11 @@ }; void OrthancSeriesVolumeProgressiveLoader::SeriesGeometry::CheckSlice( - size_t index, const OrthancStone::DicomInstanceParameters& reference) const + size_t index, const DicomInstanceParameters& reference) const { - const OrthancStone::DicomInstanceParameters& slice = *slices_[index]; + const DicomInstanceParameters& slice = *slices_[index]; - if (!OrthancStone::GeometryToolbox::IsParallel( + if (!GeometryToolbox::IsParallel( reference.GetGeometry().GetNormal(), slice.GetGeometry().GetNormal())) { @@ -95,8 +93,8 @@ "The width/height of slices are not constant in the volume image"); } - if (!OrthancStone::LinearAlgebra::IsNear(reference.GetPixelSpacingX(), slice.GetPixelSpacingX()) || - !OrthancStone::LinearAlgebra::IsNear(reference.GetPixelSpacingY(), slice.GetPixelSpacingY())) + if (!LinearAlgebra::IsNear(reference.GetPixelSpacingX(), slice.GetPixelSpacingX()) || + !LinearAlgebra::IsNear(reference.GetPixelSpacingY(), slice.GetPixelSpacingY())) { throw Orthanc::OrthancException(Orthanc::ErrorCode_BadGeometry, "The pixel spacing of the slices change across the volume image"); @@ -118,7 +116,7 @@ if (slices_.size() != 0) { - const OrthancStone::DicomInstanceParameters& reference = *slices_[0]; + const DicomInstanceParameters& reference = *slices_[0]; for (size_t i = 1; i < slices_.size(); i++) { @@ -162,7 +160,7 @@ // WARNING: The payload of "slices" must be of class "DicomInstanceParameters" // (called with the slices created in LoadGeometry) - void OrthancSeriesVolumeProgressiveLoader::SeriesGeometry::ComputeGeometry(OrthancStone::SlicesSorter& slices) + void OrthancSeriesVolumeProgressiveLoader::SeriesGeometry::ComputeGeometry(SlicesSorter& slices) { Clear(); @@ -174,7 +172,7 @@ if (slices.GetSlicesCount() == 0) { - geometry_.reset(new OrthancStone::VolumeImageGeometry); + geometry_.reset(new VolumeImageGeometry); } else { @@ -183,9 +181,9 @@ for (size_t i = 0; i < slices.GetSlicesCount(); i++) { - const OrthancStone::DicomInstanceParameters& slice = - dynamic_cast(slices.GetSlicePayload(i)); - slices_.push_back(new OrthancStone::DicomInstanceParameters(slice)); + const DicomInstanceParameters& slice = + dynamic_cast(slices.GetSlicePayload(i)); + slices_.push_back(new DicomInstanceParameters(slice)); } CheckVolume(); @@ -196,9 +194,9 @@ { LOG(TRACE) << "Computed spacing between slices: " << spacingZ << "mm"; - const OrthancStone::DicomInstanceParameters& parameters = *slices_[0]; + const DicomInstanceParameters& parameters = *slices_[0]; - geometry_.reset(new OrthancStone::VolumeImageGeometry); + geometry_.reset(new VolumeImageGeometry); geometry_->SetSizeInVoxels(parameters.GetImageInformation().GetWidth(), parameters.GetImageInformation().GetHeight(), static_cast(slices.GetSlicesCount())); @@ -215,7 +213,7 @@ } - const OrthancStone::VolumeImageGeometry& OrthancSeriesVolumeProgressiveLoader::SeriesGeometry::GetImageGeometry() const + const VolumeImageGeometry& OrthancSeriesVolumeProgressiveLoader::SeriesGeometry::GetImageGeometry() const { if (!HasGeometry()) { @@ -230,7 +228,7 @@ } - const OrthancStone::DicomInstanceParameters& OrthancSeriesVolumeProgressiveLoader::SeriesGeometry::GetSliceParameters(size_t index) const + const DicomInstanceParameters& OrthancSeriesVolumeProgressiveLoader::SeriesGeometry::GetSliceParameters(size_t index) const { CheckSliceIndex(index); return *slices_[index]; @@ -251,7 +249,7 @@ } - static unsigned int GetSliceIndexPayload(const OrthancStone::OracleCommandBase& command) + static unsigned int GetSliceIndexPayload(const OracleCommandBase& command) { assert(command.HasPayload()); return dynamic_cast< const Orthanc::SingleValueObject& >(command.GetPayload()).GetValue(); @@ -272,7 +270,7 @@ << "OrthancSeriesVolumeProgressiveLoader::ScheduleNextSliceDownload"); } - const OrthancStone::DicomInstanceParameters& slice = seriesGeometry_.GetSliceParameters(sliceIndex); + const DicomInstanceParameters& slice = seriesGeometry_.GetSliceParameters(sliceIndex); const std::string& instance = slice.GetOrthancInstanceIdentifier(); if (instance.empty()) @@ -280,11 +278,11 @@ throw Orthanc::OrthancException(Orthanc::ErrorCode_InternalError); } - std::unique_ptr command; + std::unique_ptr command; if (!progressiveQuality_ || quality == QUALITY_02) { - std::unique_ptr tmp(new OrthancStone::GetOrthancImageCommand); + std::unique_ptr tmp(new GetOrthancImageCommand); // TODO: review the following comment. // - Commented out by bgo on 2019-07-19 | reason: Alain has seen cases // where gzipping the uint16 image took 11 sec to produce 5mb. @@ -304,8 +302,8 @@ } else // progressive mode is true AND quality is not final (different from QUALITY_02 { - std::unique_ptr tmp( - new OrthancStone::GetOrthancWebViewerJpegCommand); + std::unique_ptr tmp( + new GetOrthancWebViewerJpegCommand); // TODO: review the following comment. Commented out by bgo on 2019-07-19 // (gzip for jpeg seems overkill) @@ -322,7 +320,7 @@ command->AcquirePayload(new Orthanc::SingleValueObject(sliceIndex)); { - std::unique_ptr lock(loadersContext_.Lock()); + std::unique_ptr lock(loadersContext_.Lock()); boost::shared_ptr observer(GetSharedObserver()); lock->Schedule(observer, sliceSchedulingPriority_, command.release()); } @@ -338,7 +336,7 @@ /** This is called in response to GET "/series/XXXXXXXXXXXXX/instances-tags" */ - void OrthancSeriesVolumeProgressiveLoader::LoadGeometry(const OrthancStone::OrthancRestApiCommand::SuccessMessage& message) + void OrthancSeriesVolumeProgressiveLoader::LoadGeometry(const OrthancRestApiCommand::SuccessMessage& message) { Json::Value body; message.ParseJsonBody(body); @@ -351,18 +349,18 @@ { Json::Value::Members instances = body.getMemberNames(); - OrthancStone::SlicesSorter slices; + SlicesSorter slices; for (size_t i = 0; i < instances.size(); i++) { Orthanc::DicomMap dicom; dicom.FromDicomAsJson(body[instances[i]]); - std::unique_ptr instance(new OrthancStone::DicomInstanceParameters(dicom)); + std::unique_ptr instance(new DicomInstanceParameters(dicom)); instance->SetOrthancInstanceIdentifier(instances[i]); // the 3D plane corresponding to the slice - OrthancStone::CoordinateSystem3D geometry = instance->GetGeometry(); + CoordinateSystem3D geometry = instance->GetGeometry(); slices.AddSlice(geometry, instance.release()); if (slicePostProcessor_) @@ -380,7 +378,7 @@ } else { - const OrthancStone::DicomInstanceParameters& parameters = seriesGeometry_.GetSliceParameters(0); + const DicomInstanceParameters& parameters = seriesGeometry_.GetSliceParameters(0); volume_->Initialize(seriesGeometry_.GetImageGeometry(), parameters.GetExpectedPixelFormat()); volume_->SetDicomParameters(parameters); @@ -392,7 +390,7 @@ if (progressiveQuality_) maxQuality = QUALITY_02; - strategy_.reset(new OrthancStone::BasicFetchingStrategy( + strategy_.reset(new BasicFetchingStrategy( sorter_->CreateSorter(static_cast(slicesCount)), maxQuality)); @@ -405,7 +403,7 @@ slicesQuality_.resize(slicesCount, 0); - BroadcastMessage(OrthancStone::DicomVolumeImage::GeometryReadyMessage(*volume_)); + BroadcastMessage(DicomVolumeImage::GeometryReadyMessage(*volume_)); } @@ -425,8 +423,8 @@ if (quality >= slicesQuality_[sliceIndex]) { { - OrthancStone::ImageBuffer3D::SliceWriter writer(volume_->GetPixelData(), - OrthancStone::VolumeProjection_Axial, + ImageBuffer3D::SliceWriter writer(volume_->GetPixelData(), + VolumeProjection_Axial, sliceIndex); Orthanc::ImageProcessing::Copy(writer.GetAccessor(), image); @@ -436,7 +434,7 @@ seriesGeometry_.IncrementSliceRevision(sliceIndex); slicesQuality_[sliceIndex] = quality; - BroadcastMessage(OrthancStone::DicomVolumeImage::ContentUpdatedMessage(*volume_)); + BroadcastMessage(DicomVolumeImage::ContentUpdatedMessage(*volume_)); } LOG(TRACE) << "SetSliceContent sliceIndex = " << sliceIndex << " -- will " << " now call ScheduleNextSliceDownload()"; @@ -444,7 +442,7 @@ } void OrthancSeriesVolumeProgressiveLoader::LoadBestQualitySliceContent( - const OrthancStone::GetOrthancImageCommand::SuccessMessage& message) + const GetOrthancImageCommand::SuccessMessage& message) { unsigned int quality = QUALITY_00; if (progressiveQuality_) @@ -456,7 +454,7 @@ } void OrthancSeriesVolumeProgressiveLoader::LoadJpegSliceContent( - const OrthancStone::GetOrthancWebViewerJpegCommand::SuccessMessage& message) + const GetOrthancWebViewerJpegCommand::SuccessMessage& message) { ORTHANC_ASSERT(progressiveQuality_, "INTERNAL ERROR: OrthancSeriesVolumeProgressiveLoader::LoadJpegSliceContent" << " called while progressiveQuality_ is false!"); @@ -464,7 +462,7 @@ LOG(TRACE) << "OrthancSeriesVolumeProgressiveLoader::LoadJpegSliceContent"; unsigned int quality; - switch (dynamic_cast(message.GetOrigin()).GetQuality()) + switch (dynamic_cast(message.GetOrigin()).GetQuality()) { case 50: quality = QUALITY_00; @@ -509,15 +507,15 @@ } OrthancSeriesVolumeProgressiveLoader::OrthancSeriesVolumeProgressiveLoader( - OrthancStone::ILoadersContext& loadersContext, - boost::shared_ptr volume, + ILoadersContext& loadersContext, + boost::shared_ptr volume, bool progressiveQuality) : loadersContext_(loadersContext) , active_(false) , progressiveQuality_(progressiveQuality) , simultaneousDownloads_(4) , volume_(volume) - , sorter_(new OrthancStone::BasicFetchingItemsSorter::Factory) + , sorter_(new BasicFetchingItemsSorter::Factory) , volumeImageReadyInHighQuality_(false) , medadataSchedulingPriority_(0) , sliceSchedulingPriority_(0) @@ -526,25 +524,25 @@ boost::shared_ptr OrthancSeriesVolumeProgressiveLoader::Create( - OrthancStone::ILoadersContext& loadersContext, - boost::shared_ptr volume, + ILoadersContext& loadersContext, + boost::shared_ptr volume, bool progressiveQuality) { - std::unique_ptr lock(loadersContext.Lock()); + std::unique_ptr lock(loadersContext.Lock()); boost::shared_ptr obj( new OrthancSeriesVolumeProgressiveLoader( loadersContext, volume, progressiveQuality)); - obj->Register( + obj->Register( lock->GetOracleObservable(), &OrthancSeriesVolumeProgressiveLoader::LoadGeometry); - obj->Register( + obj->Register( lock->GetOracleObservable(), &OrthancSeriesVolumeProgressiveLoader::LoadBestQualitySliceContent); - obj->Register( + obj->Register( lock->GetOracleObservable(), &OrthancSeriesVolumeProgressiveLoader::LoadJpegSliceContent); @@ -586,10 +584,10 @@ { active_ = true; - std::unique_ptr command(new OrthancStone::OrthancRestApiCommand); + std::unique_ptr command(new OrthancRestApiCommand); command->SetUri("/series/" + seriesId + "/instances-tags"); { - std::unique_ptr lock(loadersContext_.Lock()); + std::unique_ptr lock(loadersContext_.Lock()); boost::shared_ptr observer(GetSharedObserver()); lock->Schedule(observer, medadataSchedulingPriority_, command.release()); } @@ -597,8 +595,8 @@ } - OrthancStone::IVolumeSlicer::IExtractedSlice* - OrthancSeriesVolumeProgressiveLoader::ExtractSlice(const OrthancStone::CoordinateSystem3D& cuttingPlane) + IVolumeSlicer::IExtractedSlice* + OrthancSeriesVolumeProgressiveLoader::ExtractSlice(const CoordinateSystem3D& cuttingPlane) { if (volume_->HasGeometry()) { diff -r 5cdc5b98f14d -r 52b8b96cb55f OrthancStone/Sources/Loaders/OrthancSeriesVolumeProgressiveLoader.h --- a/OrthancStone/Sources/Loaders/OrthancSeriesVolumeProgressiveLoader.h Tue Nov 10 16:41:11 2020 +0100 +++ b/OrthancStone/Sources/Loaders/OrthancSeriesVolumeProgressiveLoader.h Tue Nov 10 16:55:22 2020 +0100 @@ -47,9 +47,9 @@ is stored in a Dicom series. */ class OrthancSeriesVolumeProgressiveLoader : - public OrthancStone::ObserverBase, - public OrthancStone::IObservable, - public OrthancStone::IVolumeSlicer, + public ObserverBase, + public IObservable, + public IVolumeSlicer, public IGeometryProvider { public: @@ -72,7 +72,7 @@ { private: void CheckSlice(size_t index, - const OrthancStone::DicomInstanceParameters& reference) const; + const DicomInstanceParameters& reference) const; void CheckVolume() const; @@ -80,8 +80,8 @@ void CheckSliceIndex(size_t index) const; - std::unique_ptr geometry_; - std::vector slices_; + std::unique_ptr geometry_; + std::vector slices_; std::vector slicesRevision_; public: @@ -90,16 +90,16 @@ Clear(); } - void ComputeGeometry(OrthancStone::SlicesSorter& slices); + void ComputeGeometry(SlicesSorter& slices); virtual bool HasGeometry() const { return geometry_.get() != NULL; } - virtual const OrthancStone::VolumeImageGeometry& GetImageGeometry() const; + virtual const VolumeImageGeometry& GetImageGeometry() const; - const OrthancStone::DicomInstanceParameters& GetSliceParameters(size_t index) const; + const DicomInstanceParameters& GetSliceParameters(size_t index) const; uint64_t GetSliceRevision(size_t index) const; @@ -108,29 +108,27 @@ void ScheduleNextSliceDownload(); - void LoadGeometry(const OrthancStone::OrthancRestApiCommand::SuccessMessage& message); + void LoadGeometry(const OrthancRestApiCommand::SuccessMessage& message); void SetSliceContent(unsigned int sliceIndex, const Orthanc::ImageAccessor& image, unsigned int quality); - void LoadBestQualitySliceContent(const OrthancStone::GetOrthancImageCommand::SuccessMessage& message); + void LoadBestQualitySliceContent(const GetOrthancImageCommand::SuccessMessage& message); - void LoadJpegSliceContent(const OrthancStone::GetOrthancWebViewerJpegCommand::SuccessMessage& message); + void LoadJpegSliceContent(const GetOrthancWebViewerJpegCommand::SuccessMessage& message); - OrthancStone::ILoadersContext& loadersContext_; - bool active_; - bool progressiveQuality_; - unsigned int simultaneousDownloads_; - SeriesGeometry seriesGeometry_; - boost::shared_ptr volume_; - std::unique_ptr sorter_; - std::unique_ptr strategy_; - - std::vector slicesQuality_; - bool volumeImageReadyInHighQuality_; - - boost::shared_ptr slicePostProcessor_; + ILoadersContext& loadersContext_; + bool active_; + bool progressiveQuality_; + unsigned int simultaneousDownloads_; + SeriesGeometry seriesGeometry_; + boost::shared_ptr volume_; + std::unique_ptr sorter_; + std::unique_ptr strategy_; + std::vector slicesQuality_; + bool volumeImageReadyInHighQuality_; + boost::shared_ptr slicePostProcessor_; /** See priority setters/getters below */ int medadataSchedulingPriority_; @@ -139,8 +137,8 @@ int sliceSchedulingPriority_; OrthancSeriesVolumeProgressiveLoader( - OrthancStone::ILoadersContext& loadersContext, - boost::shared_ptr volume, + ILoadersContext& loadersContext, + boost::shared_ptr volume, bool progressiveQuality); public: @@ -150,8 +148,8 @@ See doc for the progressiveQuality_ field */ static boost::shared_ptr Create( - OrthancStone::ILoadersContext& context, - boost::shared_ptr volume, + ILoadersContext& context, + boost::shared_ptr volume, bool progressiveQuality = false); virtual ~OrthancSeriesVolumeProgressiveLoader(); @@ -212,7 +210,7 @@ /** Same remark as HasGeometry */ - const OrthancStone::VolumeImageGeometry& GetImageGeometry() const ORTHANC_OVERRIDE + const VolumeImageGeometry& GetImageGeometry() const ORTHANC_OVERRIDE { return seriesGeometry_.GetImageGeometry(); } @@ -223,6 +221,6 @@ take into account this request (this is done in the ExtractedSlice ctor) */ virtual IExtractedSlice* - ExtractSlice(const OrthancStone::CoordinateSystem3D& cuttingPlane) ORTHANC_OVERRIDE; + ExtractSlice(const CoordinateSystem3D& cuttingPlane) ORTHANC_OVERRIDE; }; } diff -r 5cdc5b98f14d -r 52b8b96cb55f OrthancStone/Sources/Loaders/SeriesMetadataLoader.cpp --- a/OrthancStone/Sources/Loaders/SeriesMetadataLoader.cpp Tue Nov 10 16:41:11 2020 +0100 +++ b/OrthancStone/Sources/Loaders/SeriesMetadataLoader.cpp Tue Nov 10 16:55:22 2020 +0100 @@ -91,8 +91,8 @@ if (message.GetResources()->GetResource(i).LookupStringValue (seriesInstanceUid, Orthanc::DICOM_TAG_SERIES_INSTANCE_UID, false)) { - boost::shared_ptr target - (new OrthancStone::LoadedDicomResources(Orthanc::DICOM_TAG_SOP_INSTANCE_UID)); + boost::shared_ptr target + (new LoadedDicomResources(Orthanc::DICOM_TAG_SOP_INSTANCE_UID)); if (loader_->ScheduleLoadDicomFile(target, message.GetPriority(), message.GetDicomSource(), dicomDirPath_, message.GetResources()->GetResource(i), false /* no need for pixel data */, @@ -102,7 +102,7 @@ if (found == seriesSize_.end()) { series_[seriesInstanceUid].reset - (new OrthancStone::LoadedDicomResources(Orthanc::DICOM_TAG_SOP_INSTANCE_UID)); + (new LoadedDicomResources(Orthanc::DICOM_TAG_SOP_INSTANCE_UID)); seriesSize_[seriesInstanceUid] = 1; } else diff -r 5cdc5b98f14d -r 52b8b96cb55f OrthancStone/Sources/Scene2DViewport/AngleMeasureTool.cpp --- a/OrthancStone/Sources/Scene2DViewport/AngleMeasureTool.cpp Tue Nov 10 16:41:11 2020 +0100 +++ b/OrthancStone/Sources/Scene2DViewport/AngleMeasureTool.cpp Tue Nov 10 16:55:22 2020 +0100 @@ -105,7 +105,7 @@ } - boost::shared_ptr AngleMeasureTool::GetMemento() const + boost::shared_ptr AngleMeasureTool::GetMemento() const { boost::shared_ptr memento(new AngleMeasureToolMemento()); memento->center_ = center_; diff -r 5cdc5b98f14d -r 52b8b96cb55f OrthancStone/Sources/Scene2DViewport/MeasureCommands.cpp --- a/OrthancStone/Sources/Scene2DViewport/MeasureCommands.cpp Tue Nov 10 16:41:11 2020 +0100 +++ b/OrthancStone/Sources/Scene2DViewport/MeasureCommands.cpp Tue Nov 10 16:55:22 2020 +0100 @@ -40,7 +40,7 @@ void CreateMeasureCommand::Undo() { - std::unique_ptr lock(GetViewportLock()); + std::unique_ptr lock(GetViewportLock()); // simply disable the measure tool upon undo GetMeasureTool()->Disable(); lock->GetController().RemoveMeasureTool(GetMeasureTool()); @@ -48,7 +48,7 @@ void CreateMeasureCommand::Redo() { - std::unique_ptr lock(GetViewportLock()); + std::unique_ptr lock(GetViewportLock()); GetMeasureTool()->Enable(); lock->GetController().AddMeasureTool(GetMeasureTool()); } @@ -67,7 +67,7 @@ void DeleteMeasureCommand::Redo() { - std::unique_ptr lock(GetViewportLock()); + std::unique_ptr lock(GetViewportLock()); // simply disable the measure tool upon undo GetMeasureTool()->Disable(); lock->GetController().RemoveMeasureTool(GetMeasureTool()); @@ -75,7 +75,7 @@ void DeleteMeasureCommand::Undo() { - std::unique_ptr lock(GetViewportLock()); + std::unique_ptr lock(GetViewportLock()); GetMeasureTool()->Enable(); lock->GetController().AddMeasureTool(GetMeasureTool()); } @@ -93,7 +93,7 @@ mementoModified_(measureTool->GetMemento()), mementoOriginal_(measureTool->GetMemento()) { - std::unique_ptr lock(GetViewportLock()); + std::unique_ptr lock(GetViewportLock()); GetMeasureTool()->Disable(); lock->GetController().RemoveMeasureTool(GetMeasureTool()); } diff -r 5cdc5b98f14d -r 52b8b96cb55f OrthancStone/Sources/Scene2DViewport/ViewportController.cpp --- a/OrthancStone/Sources/Scene2DViewport/ViewportController.cpp Tue Nov 10 16:41:11 2020 +0100 +++ b/OrthancStone/Sources/Scene2DViewport/ViewportController.cpp Tue Nov 10 16:55:22 2020 +0100 @@ -131,13 +131,13 @@ } } - OrthancStone::AffineTransform2D + AffineTransform2D ViewportController::GetCanvasToSceneTransform() const { return scene_->GetCanvasToSceneTransform(); } - OrthancStone::AffineTransform2D + AffineTransform2D ViewportController::GetSceneToCanvasTransform() const { return scene_->GetSceneToCanvasTransform(); @@ -208,11 +208,10 @@ } - void ViewportController::HandleMousePress( - OrthancStone::IViewportInteractor& interactor, - const PointerEvent& event, - unsigned int viewportWidth, - unsigned int viewportHeight) + void ViewportController::HandleMousePress(IViewportInteractor& interactor, + const PointerEvent& event, + unsigned int viewportWidth, + unsigned int viewportHeight) { if (activeTracker_) { diff -r 5cdc5b98f14d -r 52b8b96cb55f OrthancStone/Sources/StoneException.h --- a/OrthancStone/Sources/StoneException.h Tue Nov 10 16:41:11 2020 +0100 +++ b/OrthancStone/Sources/StoneException.h Tue Nov 10 16:55:22 2020 +0100 @@ -50,7 +50,7 @@ class StoneException { protected: - OrthancStone::ErrorCode errorCode_; + ErrorCode errorCode_; public: explicit StoneException(ErrorCode errorCode) : diff -r 5cdc5b98f14d -r 52b8b96cb55f OrthancStone/Sources/StoneInitialization.cpp --- a/OrthancStone/Sources/StoneInitialization.cpp Tue Nov 10 16:41:11 2020 +0100 +++ b/OrthancStone/Sources/StoneInitialization.cpp Tue Nov 10 16:55:22 2020 +0100 @@ -103,11 +103,11 @@ // been initialized, as Qt changes locale settings { - OrthancStone::Vector v; - if (!OrthancStone::LinearAlgebra::ParseVector(v, "1.3671875\\-1.3671875") || + Vector v; + if (!LinearAlgebra::ParseVector(v, "1.3671875\\-1.3671875") || v.size() != 2 || - !OrthancStone::LinearAlgebra::IsNear(1.3671875f, v[0]) || - !OrthancStone::LinearAlgebra::IsNear(-1.3671875f, v[1])) + !LinearAlgebra::IsNear(1.3671875f, v[0]) || + !LinearAlgebra::IsNear(-1.3671875f, v[1])) { throw Orthanc::OrthancException(Orthanc::ErrorCode_InternalError, "Error in the locale settings, giving up"); @@ -126,12 +126,12 @@ source.FromDicomWeb(dicomweb); std::string s; - OrthancStone::Vector v; + Vector v; if (!source.LookupStringValue(s, Orthanc::DICOM_TAG_PIXEL_SPACING, false) || - !OrthancStone::LinearAlgebra::ParseVector(v, s) || + !LinearAlgebra::ParseVector(v, s) || v.size() != 2 || - !OrthancStone::LinearAlgebra::IsNear(1.2f, v[0]) || - !OrthancStone::LinearAlgebra::IsNear(-1.5f, v[1])) + !LinearAlgebra::IsNear(1.2f, v[0]) || + !LinearAlgebra::IsNear(-1.5f, v[1])) { throw Orthanc::OrthancException(Orthanc::ErrorCode_InternalError, "Error in the locale settings, giving up"); diff -r 5cdc5b98f14d -r 52b8b96cb55f OrthancStone/Sources/Toolbox/CoordinateSystem3D.cpp --- a/OrthancStone/Sources/Toolbox/CoordinateSystem3D.cpp Tue Nov 10 16:41:11 2020 +0100 +++ b/OrthancStone/Sources/Toolbox/CoordinateSystem3D.cpp Tue Nov 10 16:55:22 2020 +0100 @@ -235,8 +235,7 @@ { bool opposite = false; // Ignored - if (OrthancStone::GeometryToolbox::IsParallelOrOpposite( - opposite, a.GetNormal(), b.GetNormal())) + if (GeometryToolbox::IsParallelOrOpposite(opposite, a.GetNormal(), b.GetNormal())) { distance = std::abs(a.ProjectAlongNormal(a.GetOrigin()) - a.ProjectAlongNormal(b.GetOrigin())); diff -r 5cdc5b98f14d -r 52b8b96cb55f OrthancStone/Sources/Toolbox/DicomStructure2.cpp --- a/OrthancStone/Sources/Toolbox/DicomStructure2.cpp Tue Nov 10 16:41:11 2020 +0100 +++ b/OrthancStone/Sources/Toolbox/DicomStructure2.cpp Tue Nov 10 16:55:22 2020 +0100 @@ -152,7 +152,7 @@ ComputeSliceThickness(); // this will change state_ from NormalComputed to Valid } - OrthancStone::Vector DicomStructure2::GetNormal() const + Vector DicomStructure2::GetNormal() const { if (state_ != Valid && state_ != Invalid) { diff -r 5cdc5b98f14d -r 52b8b96cb55f OrthancStone/Sources/Toolbox/FiniteProjectiveCamera.cpp --- a/OrthancStone/Sources/Toolbox/FiniteProjectiveCamera.cpp Tue Nov 10 16:41:11 2020 +0100 +++ b/OrthancStone/Sources/Toolbox/FiniteProjectiveCamera.cpp Tue Nov 10 16:55:22 2020 +0100 @@ -318,7 +318,7 @@ LOG(WARNING) << "Output pixel format: " << Orthanc::EnumerationToString(target.GetFormat()); const unsigned int slicesCount = geometry.GetProjectionDepth(projection); - const OrthancStone::Vector pixelSpacing = geometry.GetVoxelDimensions(projection); + const Vector pixelSpacing = geometry.GetVoxelDimensions(projection); const unsigned int targetWidth = target.GetWidth(); const unsigned int targetHeight = target.GetHeight(); @@ -333,8 +333,8 @@ { LOG(INFO) << "Applying raytracer on slice: " << z << "/" << slicesCount; - OrthancStone::CoordinateSystem3D slice = geometry.GetProjectionSlice(projection, z); - OrthancStone::ImageBuffer3D::SliceReader sliceReader(source, projection, static_cast(z)); + CoordinateSystem3D slice = geometry.GetProjectionSlice(projection, z); + ImageBuffer3D::SliceReader sliceReader(source, projection, static_cast(z)); SourceReader pixelReader(sliceReader.GetAccessor()); @@ -346,11 +346,11 @@ for (unsigned int x = 0; x < targetWidth; x++) { // Backproject the ray originating from the center of the target pixel - OrthancStone::Vector direction = camera.GetRayDirection(static_cast(x + 0.5), - static_cast(y + 0.5)); + Vector direction = camera.GetRayDirection(static_cast(x + 0.5), + static_cast(y + 0.5)); // Compute the 3D intersection of the ray with the slice plane - OrthancStone::Vector p; + Vector p; if (slice.IntersectLine(p, camera.GetCenter(), direction)) { // Compute the 2D coordinates of the intersections, in slice coordinates diff -r 5cdc5b98f14d -r 52b8b96cb55f OrthancStone/Sources/Toolbox/SlicesSorter.cpp --- a/OrthancStone/Sources/Toolbox/SlicesSorter.cpp Tue Nov 10 16:41:11 2020 +0100 +++ b/OrthancStone/Sources/Toolbox/SlicesSorter.cpp Tue Nov 10 16:55:22 2020 +0100 @@ -301,7 +301,7 @@ return true; } - const OrthancStone::CoordinateSystem3D& reference = GetSliceGeometry(0); + const CoordinateSystem3D& reference = GetSliceGeometry(0); double referencePosition = reference.ProjectAlongNormal(reference.GetOrigin()); @@ -317,10 +317,10 @@ for (size_t i = 1; i < GetSlicesCount(); i++) { - OrthancStone::Vector q = reference.GetOrigin() + spacing * static_cast(i) * reference.GetNormal(); + Vector q = reference.GetOrigin() + spacing * static_cast(i) * reference.GetNormal(); double d = boost::numeric::ublas::norm_2(q - GetSliceGeometry(i).GetOrigin()); - if (!OrthancStone::LinearAlgebra::IsNear(d, 0, 0.001 /* tolerance expressed in mm */)) + if (!LinearAlgebra::IsNear(d, 0, 0.001 /* tolerance expressed in mm */)) { return false; } @@ -338,14 +338,14 @@ } else { - const OrthancStone::CoordinateSystem3D& reference = GetSliceGeometry(0); + const CoordinateSystem3D& reference = GetSliceGeometry(0); double previousPosition = reference.ProjectAlongNormal(GetSliceGeometry(0).GetOrigin()); for (size_t i = 1; i < GetSlicesCount(); i++) { double position = reference.ProjectAlongNormal(GetSliceGeometry(i).GetOrigin()); - if (OrthancStone::LinearAlgebra::IsNear(position, previousPosition, 0.001 /* tolerance expressed in mm */)) + if (LinearAlgebra::IsNear(position, previousPosition, 0.001 /* tolerance expressed in mm */)) { return false; } diff -r 5cdc5b98f14d -r 52b8b96cb55f OrthancStone/Sources/Volumes/IGeometryProvider.h --- a/OrthancStone/Sources/Volumes/IGeometryProvider.h Tue Nov 10 16:41:11 2020 +0100 +++ b/OrthancStone/Sources/Volumes/IGeometryProvider.h Tue Nov 10 16:55:22 2020 +0100 @@ -29,8 +29,12 @@ class IGeometryProvider { public: - virtual ~IGeometryProvider() {} + virtual ~IGeometryProvider() + { + } + virtual bool HasGeometry() const = 0; - virtual const OrthancStone::VolumeImageGeometry& GetImageGeometry() const = 0; + + virtual const VolumeImageGeometry& GetImageGeometry() const = 0; }; } diff -r 5cdc5b98f14d -r 52b8b96cb55f OrthancStone/Sources/Volumes/VolumeReslicer.cpp --- a/OrthancStone/Sources/Volumes/VolumeReslicer.cpp Tue Nov 10 16:41:11 2020 +0100 +++ b/OrthancStone/Sources/Volumes/VolumeReslicer.cpp Tue Nov 10 16:55:22 2020 +0100 @@ -758,8 +758,7 @@ { // Choose the default voxel size as the finest voxel dimension // of the source volumetric image - const OrthancStone::Vector dim = - geometry.GetVoxelDimensions(OrthancStone::VolumeProjection_Axial); + const Vector dim = geometry.GetVoxelDimensions(VolumeProjection_Axial); double voxelSize = dim[0]; if (dim[1] < voxelSize) diff -r 5cdc5b98f14d -r 52b8b96cb55f OrthancStone/Sources/Volumes/VolumeSceneLayerSource.cpp --- a/OrthancStone/Sources/Volumes/VolumeSceneLayerSource.cpp Tue Nov 10 16:41:11 2020 +0100 +++ b/OrthancStone/Sources/Volumes/VolumeSceneLayerSource.cpp Tue Nov 10 16:55:22 2020 +0100 @@ -70,10 +70,9 @@ } - VolumeSceneLayerSource::VolumeSceneLayerSource( - boost::weak_ptr viewport, - int layerDepth, - const boost::shared_ptr& slicer) : + VolumeSceneLayerSource::VolumeSceneLayerSource(boost::weak_ptr viewport, + int layerDepth, + const boost::shared_ptr& slicer) : viewport_(viewport), layerDepth_(layerDepth), slicer_(slicer), diff -r 5cdc5b98f14d -r 52b8b96cb55f OrthancStone/Sources/Volumes/VolumeSceneLayerSource.h --- a/OrthancStone/Sources/Volumes/VolumeSceneLayerSource.h Tue Nov 10 16:41:11 2020 +0100 +++ b/OrthancStone/Sources/Volumes/VolumeSceneLayerSource.h Tue Nov 10 16:55:22 2020 +0100 @@ -41,7 +41,7 @@ class VolumeSceneLayerSource : public boost::noncopyable { private: - boost::weak_ptr viewport_; + boost::weak_ptr viewport_; int layerDepth_; boost::shared_ptr slicer_; std::unique_ptr configurator_; @@ -59,7 +59,7 @@ IViewport::ILock* GetViewportLock() const; public: - VolumeSceneLayerSource(boost::weak_ptr viewport, + VolumeSceneLayerSource(boost::weak_ptr viewport, int layerDepth, const boost::shared_ptr& slicer);