changeset 714:d2c0e347ddc2

deprecating DicomFrameConverter
author Sebastien Jodogne <s.jodogne@gmail.com>
date Mon, 20 May 2019 16:26:34 +0200
parents e63c8b9b7b02
children 562cdd083b9e 4f2416d519b4
files Applications/Samples/SimpleViewer/Messages.h Applications/Samples/SimpleViewer/SimpleViewerApplication.h Framework/Layers/DicomSeriesVolumeSlicer.h Framework/Layers/FrameRenderer.cpp Framework/Layers/FrameRenderer.h Framework/Layers/GrayscaleFrameRenderer.cpp Framework/Layers/GrayscaleFrameRenderer.h Framework/Layers/IVolumeSlicer.h Framework/Layers/SliceOutlineRenderer.h Framework/Radiography/RadiographyDicomLayer.cpp Framework/Radiography/RadiographyDicomLayer.h Framework/Radiography/RadiographyScene.cpp Framework/Radiography/RadiographyScene.h Framework/Radiography/RadiographySceneReader.cpp Framework/Radiography/RadiographySceneReader.h Framework/SmartLoader.cpp Framework/Toolbox/DicomFrameConverter.cpp Framework/Toolbox/DicomFrameConverter.h Framework/Toolbox/OrthancSlicesLoader.cpp Framework/Toolbox/OrthancSlicesLoader.h Framework/Toolbox/Slice.cpp Framework/Toolbox/Slice.h Framework/Volumes/ISlicedVolume.h Framework/Volumes/ImageBuffer3D.cpp Framework/Volumes/ImageBuffer3D.h Framework/Widgets/SliceViewerWidget.cpp Framework/Widgets/SliceViewerWidget.h Framework/dev.h
diffstat 28 files changed, 120 insertions(+), 129 deletions(-) [+]
line wrap: on
line diff
--- a/Applications/Samples/SimpleViewer/Messages.h	Mon May 20 15:44:01 2019 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,10 +0,0 @@
-#pragma once
-
-namespace SimpleViewer
-{
-  enum SimpleViewerMessageType
-  {
-    SimpleViewerMessageType_First = OrthancStone::MessageType_CustomMessage,
-    SimpleViewerMessageType_AppStatusUpdated
-  };
-}
--- a/Applications/Samples/SimpleViewer/SimpleViewerApplication.h	Mon May 20 15:44:01 2019 +0200
+++ b/Applications/Samples/SimpleViewer/SimpleViewerApplication.h	Mon May 20 16:26:34 2019 +0200
@@ -51,7 +51,6 @@
 #include "ThumbnailInteractor.h"
 #include "MainWidgetInteractor.h"
 #include "AppStatus.h"
-#include "Messages.h"
 
 using namespace OrthancStone;
 
@@ -67,13 +66,14 @@
   {
   public:
 
-    struct StatusUpdatedMessage : public BaseMessage<SimpleViewerMessageType_AppStatusUpdated>
+    struct StatusUpdatedMessage : public IMessage
     {
+      ORTHANC_STONE_MESSAGE(__FILE__, __LINE__);
+
       const AppStatus& status_;
 
       StatusUpdatedMessage(const AppStatus& status)
-        : BaseMessage(),
-          status_(status)
+        : status_(status)
       {
       }
     };
--- a/Framework/Layers/DicomSeriesVolumeSlicer.h	Mon May 20 15:44:01 2019 +0200
+++ b/Framework/Layers/DicomSeriesVolumeSlicer.h	Mon May 20 16:26:34 2019 +0200
@@ -45,13 +45,13 @@
     private:
       const Orthanc::ImageAccessor&  frame_;
       SliceImageQuality              imageQuality_;
-      const Slice&                   slice_;
+      const Deprecated::Slice&                   slice_;
 
     public:
       FrameReadyMessage(DicomSeriesVolumeSlicer& origin,
                         const Orthanc::ImageAccessor& frame,
                         SliceImageQuality imageQuality,
-                        const Slice& slice) :
+                        const Deprecated::Slice& slice) :
         OriginMessage(origin),
         frame_(frame),
         imageQuality_(imageQuality),
@@ -69,7 +69,7 @@
         return imageQuality_;
       }
 
-      const Slice& GetSlice() const
+      const Deprecated::Slice& GetSlice() const
       {
         return slice_;
       }
@@ -107,7 +107,7 @@
       return loader_.GetSlicesCount();
     }
 
-    const Slice& GetSlice(size_t slice) const 
+    const Deprecated::Slice& GetSlice(size_t slice) const 
     {
       return loader_.GetSlice(slice);
     }
--- a/Framework/Layers/FrameRenderer.cpp	Mon May 20 15:44:01 2019 +0200
+++ b/Framework/Layers/FrameRenderer.cpp	Mon May 20 16:26:34 2019 +0200
@@ -118,7 +118,7 @@
 
 
   ILayerRenderer* FrameRenderer::CreateRenderer(const Orthanc::ImageAccessor& frame,
-                                                const Slice& framePlane,
+                                                const Deprecated::Slice& framePlane,
                                                 bool isFullQuality)
   {
     if (frame.GetFormat() == Orthanc::PixelFormat_RGB24)
--- a/Framework/Layers/FrameRenderer.h	Mon May 20 15:44:01 2019 +0200
+++ b/Framework/Layers/FrameRenderer.h	Mon May 20 16:26:34 2019 +0200
@@ -63,7 +63,7 @@
 
     // TODO: Avoid cloning the "frame"
     static ILayerRenderer* CreateRenderer(const Orthanc::ImageAccessor& frame,
-                                          const Slice& framePlane,
+                                          const Deprecated::Slice& framePlane,
                                           bool isFullQuality);
   };
 }
--- a/Framework/Layers/GrayscaleFrameRenderer.cpp	Mon May 20 15:44:01 2019 +0200
+++ b/Framework/Layers/GrayscaleFrameRenderer.cpp	Mon May 20 16:26:34 2019 +0200
@@ -114,7 +114,7 @@
 
 
   GrayscaleFrameRenderer::GrayscaleFrameRenderer(const Orthanc::ImageAccessor& frame,
-                                                 const DicomFrameConverter& converter,
+                                                 const Deprecated::DicomFrameConverter& converter,
                                                  const CoordinateSystem3D& framePlane,
                                                  double pixelSpacingX,
                                                  double pixelSpacingY,
--- a/Framework/Layers/GrayscaleFrameRenderer.h	Mon May 20 15:44:01 2019 +0200
+++ b/Framework/Layers/GrayscaleFrameRenderer.h	Mon May 20 16:26:34 2019 +0200
@@ -39,7 +39,7 @@
 
   public:
     GrayscaleFrameRenderer(const Orthanc::ImageAccessor& frame,
-                           const DicomFrameConverter& converter,
+                           const Deprecated::DicomFrameConverter& converter,
                            const CoordinateSystem3D& framePlane,
                            double pixelSpacingX,
                            double pixelSpacingY,
--- a/Framework/Layers/IVolumeSlicer.h	Mon May 20 15:44:01 2019 +0200
+++ b/Framework/Layers/IVolumeSlicer.h	Mon May 20 16:26:34 2019 +0200
@@ -42,17 +42,17 @@
       ORTHANC_STONE_MESSAGE(__FILE__, __LINE__);
       
     private:
-      const Slice& slice_;
+      const Deprecated::Slice& slice_;
 
     public:
       SliceContentChangedMessage(IVolumeSlicer& origin,
-                                 const Slice& slice) :
+                                 const Deprecated::Slice& slice) :
         OriginMessage(origin),
         slice_(slice)
       {
       }
 
-      const Slice& GetSlice() const
+      const Deprecated::Slice& GetSlice() const
       {
         return slice_;
       }
--- a/Framework/Layers/SliceOutlineRenderer.h	Mon May 20 15:44:01 2019 +0200
+++ b/Framework/Layers/SliceOutlineRenderer.h	Mon May 20 16:26:34 2019 +0200
@@ -37,7 +37,7 @@
     RenderStyle         style_;
 
   public:
-    SliceOutlineRenderer(const Slice& slice) :
+    SliceOutlineRenderer(const Deprecated::Slice& slice) :
       geometry_(slice.GetGeometry()),
       pixelSpacingX_(slice.GetPixelSpacingX()),
       pixelSpacingY_(slice.GetPixelSpacingY()),
--- a/Framework/Radiography/RadiographyDicomLayer.cpp	Mon May 20 15:44:01 2019 +0200
+++ b/Framework/Radiography/RadiographyDicomLayer.cpp	Mon May 20 16:26:34 2019 +0200
@@ -54,7 +54,7 @@
 
   void RadiographyDicomLayer::SetDicomTags(const OrthancPlugins::FullOrthancDataset& dataset)
   {
-    converter_.reset(new DicomFrameConverter);
+    converter_.reset(new Deprecated::DicomFrameConverter);
     converter_->ReadParameters(dataset);
     ApplyConverter();
 
@@ -112,7 +112,7 @@
   }
 
 
-  void RadiographyDicomLayer::SetDicomFrameConverter(DicomFrameConverter* converter)
+  void RadiographyDicomLayer::SetDicomFrameConverter(Deprecated::DicomFrameConverter* converter)
   {
     converter_.reset(converter);
   }
--- a/Framework/Radiography/RadiographyDicomLayer.h	Mon May 20 15:44:01 2019 +0200
+++ b/Framework/Radiography/RadiographyDicomLayer.h	Mon May 20 16:26:34 2019 +0200
@@ -21,19 +21,20 @@
 
 #pragma once
 
+#include "../Toolbox/DicomFrameConverter.h"
 #include "RadiographyLayer.h"
+
 #include <Plugins/Samples/Common/FullOrthancDataset.h>
 
 namespace OrthancStone
 {
   class RadiographyScene;
-  class DicomFrameConverter;
 
   class RadiographyDicomLayer : public RadiographyLayer
   {
   private:
     std::auto_ptr<Orthanc::ImageAccessor>  source_;  // Content of PixelData
-    std::auto_ptr<DicomFrameConverter>     converter_;
+    std::auto_ptr<Deprecated::DicomFrameConverter>     converter_;
     std::auto_ptr<Orthanc::ImageAccessor>  converted_;  // Float32
     std::string                            instanceId_;
     unsigned int                           frame_;
@@ -65,10 +66,10 @@
 
     const Orthanc::ImageAccessor* GetSourceImage() const {return source_.get();}  // currently need this access to serialize scene in plain old data to send to a WASM worker
 
-    const DicomFrameConverter& GetDicomFrameConverter() const {return *converter_;} // currently need this access to serialize scene in plain old data to send to a WASM worker
+    const Deprecated::DicomFrameConverter& GetDicomFrameConverter() const {return *converter_;} // currently need this access to serialize scene in plain old data to send to a WASM worker
     
      // Takes ownership
-    void SetDicomFrameConverter(DicomFrameConverter* converter);
+    void SetDicomFrameConverter(Deprecated::DicomFrameConverter* converter);
 
     virtual void Render(Orthanc::ImageAccessor& buffer,
                         const AffineTransform2D& viewTransform,
--- a/Framework/Radiography/RadiographyScene.cpp	Mon May 20 15:44:01 2019 +0200
+++ b/Framework/Radiography/RadiographyScene.cpp	Mon May 20 16:26:34 2019 +0200
@@ -344,7 +344,7 @@
   RadiographyLayer& RadiographyScene::LoadDicomImage(Orthanc::ImageAccessor* dicomImage, // takes ownership
                                                      const std::string& instance,
                                                      unsigned int frame,
-                                                     DicomFrameConverter* converter,  // takes ownership
+                                                     Deprecated::DicomFrameConverter* converter,  // takes ownership
                                                      PhotometricDisplayMode preferredPhotometricDisplayMode,
                                                      RadiographyLayer::Geometry* geometry)
   {
--- a/Framework/Radiography/RadiographyScene.h	Mon May 20 15:44:01 2019 +0200
+++ b/Framework/Radiography/RadiographyScene.h	Mon May 20 16:26:34 2019 +0200
@@ -22,6 +22,7 @@
 #pragma once
 
 #include "RadiographyLayer.h"
+#include "../Toolbox/DicomFrameConverter.h"
 #include "../Toolbox/OrthancApiClient.h"
 #include "Framework/StoneEnumerations.h"
 #include "Core/Images/Image.h"
@@ -30,7 +31,6 @@
 namespace OrthancStone
 {
   class RadiographyDicomLayer;
-  class DicomFrameConverter;
 
   class RadiographyScene :
       public IObserver,
@@ -193,7 +193,7 @@
     virtual RadiographyLayer& LoadDicomImage(Orthanc::ImageAccessor* dicomImage, // takes ownership
                                              const std::string& instance,
                                              unsigned int frame,
-                                             DicomFrameConverter* converter,  // takes ownership
+                                             Deprecated::DicomFrameConverter* converter,  // takes ownership
                                              PhotometricDisplayMode preferredPhotometricDisplayMode,
                                              RadiographyLayer::Geometry* geometry);
 
--- a/Framework/Radiography/RadiographySceneReader.cpp	Mon May 20 15:44:01 2019 +0200
+++ b/Framework/Radiography/RadiographySceneReader.cpp	Mon May 20 16:26:34 2019 +0200
@@ -32,7 +32,7 @@
 {
 
   void RadiographySceneBuilder::Read(const Json::Value& input, Orthanc::ImageAccessor* dicomImage /* takes ownership */,
-                                     DicomFrameConverter* dicomFrameConverter  /* takes ownership */,
+                                     Deprecated::DicomFrameConverter* dicomFrameConverter  /* takes ownership */,
                                      PhotometricDisplayMode preferredPhotometricDisplayMode
                                      )
   {
--- a/Framework/Radiography/RadiographySceneReader.h	Mon May 20 15:44:01 2019 +0200
+++ b/Framework/Radiography/RadiographySceneReader.h	Mon May 20 16:26:34 2019 +0200
@@ -42,7 +42,7 @@
     RadiographyScene&                               scene_;
     const Orthanc::FontRegistry*                    fontRegistry_;
     std::auto_ptr<Orthanc::ImageAccessor>           dicomImage_;
-    std::auto_ptr<DicomFrameConverter>              dicomFrameConverter_;
+    std::auto_ptr<Deprecated::DicomFrameConverter>              dicomFrameConverter_;
     PhotometricDisplayMode                          preferredPhotometricDisplayMode_;
 
   public:
@@ -55,7 +55,7 @@
     void Read(const Json::Value& input);
     void Read(const Json::Value& input,
               Orthanc::ImageAccessor* dicomImage, // takes ownership
-              DicomFrameConverter* dicomFrameConverter, // takes ownership
+              Deprecated::DicomFrameConverter* dicomFrameConverter, // takes ownership
               PhotometricDisplayMode preferredPhotometricDisplayMode
               );
 
--- a/Framework/SmartLoader.cpp	Mon May 20 15:44:01 2019 +0200
+++ b/Framework/SmartLoader.cpp	Mon May 20 16:26:34 2019 +0200
@@ -61,7 +61,7 @@
     };
     
     unsigned int                    sliceIndex_;
-    std::auto_ptr<Slice>            slice_;
+    std::auto_ptr<Deprecated::Slice>            slice_;
     boost::shared_ptr<Orthanc::ImageAccessor>   image_;
     SliceImageQuality               effectiveQuality_;
     CachedSliceStatus               status_;
@@ -190,7 +190,7 @@
 
     // create the slice in the cache with "empty" data
     boost::shared_ptr<CachedSlice> cachedSlice(new CachedSlice(IObserver::GetBroker()));
-    cachedSlice->slice_.reset(new Slice(instanceId, frame));
+    cachedSlice->slice_.reset(new Deprecated::Slice(instanceId, frame));
     cachedSlice->status_ = CachedSliceStatus_ScheduledToLoad;
     std::string sliceKeyId = instanceId + ":" + boost::lexical_cast<std::string>(frame);
 
@@ -228,7 +228,7 @@
       dynamic_cast<const DicomSeriesVolumeSlicer&>(message.GetOrigin());
 
     // save/replace the slice in cache
-    const Slice& slice = source.GetSlice(0); // TODO handle GetSliceCount()
+    const Deprecated::Slice& slice = source.GetSlice(0); // TODO handle GetSliceCount()
     std::string sliceKeyId = (slice.GetOrthancInstanceId() + ":" + 
                               boost::lexical_cast<std::string>(slice.GetFrame()));
 
@@ -249,7 +249,7 @@
   void SmartLoader::OnFrameReady(const DicomSeriesVolumeSlicer::FrameReadyMessage& message)
   {
     // save/replace the slice in cache
-    const Slice& slice = message.GetSlice();
+    const Deprecated::Slice& slice = message.GetSlice();
     std::string sliceKeyId = (slice.GetOrthancInstanceId() + ":" + 
                               boost::lexical_cast<std::string>(slice.GetFrame()));
 
@@ -273,7 +273,7 @@
     const DicomSeriesVolumeSlicer& source =
       dynamic_cast<const DicomSeriesVolumeSlicer&>(message.GetOrigin());
     
-    const Slice& slice = source.GetSlice(0); // TODO handle GetSliceCount() ?
+    const Deprecated::Slice& slice = source.GetSlice(0); // TODO handle GetSliceCount() ?
     std::string sliceKeyId = (slice.GetOrthancInstanceId() + ":" + 
                               boost::lexical_cast<std::string>(slice.GetFrame()));
 
--- a/Framework/Toolbox/DicomFrameConverter.cpp	Mon May 20 15:44:01 2019 +0200
+++ b/Framework/Toolbox/DicomFrameConverter.cpp	Mon May 20 16:26:34 2019 +0200
@@ -28,7 +28,7 @@
 #include <Core/OrthancException.h>
 #include <Core/Toolbox.h>
 
-namespace OrthancStone
+namespace Deprecated
 {
   static const Orthanc::DicomTag IMAGE_TAGS[] =
   {
@@ -61,9 +61,9 @@
   {
     SetDefaultParameters();
 
-    Vector c, w;
-    if (LinearAlgebra::ParseVector(c, dicom, Orthanc::DICOM_TAG_WINDOW_CENTER) &&
-        LinearAlgebra::ParseVector(w, dicom, Orthanc::DICOM_TAG_WINDOW_WIDTH) &&
+    OrthancStone::Vector c, w;
+    if (OrthancStone::LinearAlgebra::ParseVector(c, dicom, Orthanc::DICOM_TAG_WINDOW_CENTER) &&
+        OrthancStone::LinearAlgebra::ParseVector(w, dicom, Orthanc::DICOM_TAG_WINDOW_WIDTH) &&
         c.size() > 0 && 
         w.size() > 0)
     {
--- a/Framework/Toolbox/DicomFrameConverter.h	Mon May 20 15:44:01 2019 +0200
+++ b/Framework/Toolbox/DicomFrameConverter.h	Mon May 20 16:26:34 2019 +0200
@@ -27,7 +27,7 @@
 
 #include <memory>
 
-namespace OrthancStone
+namespace Deprecated
 {
   /**
    * This class is responsible for converting the pixel format of a
--- a/Framework/Toolbox/OrthancSlicesLoader.cpp	Mon May 20 15:44:01 2019 +0200
+++ b/Framework/Toolbox/OrthancSlicesLoader.cpp	Mon May 20 16:26:34 2019 +0200
@@ -76,7 +76,7 @@
     Mode               mode_;
     unsigned int       frame_;
     unsigned int       sliceIndex_;
-    const Slice*       slice_;
+    const Deprecated::Slice*       slice_;
     std::string        instanceId_;
     SliceImageQuality  quality_;
 
@@ -105,7 +105,7 @@
       return sliceIndex_;
     }
 
-    const Slice& GetSlice() const
+    const Deprecated::Slice& GetSlice() const
     {
       assert(mode_ == Mode_LoadImage ||
              mode_ == Mode_LoadRawImage);
@@ -143,7 +143,7 @@
     }
 
     static Operation* DownloadSliceImage(unsigned int  sliceIndex,
-                                         const Slice&  slice,
+                                         const Deprecated::Slice&  slice,
                                          SliceImageQuality quality)
     {
       std::auto_ptr<Operation> tmp(new Operation(Mode_LoadImage));
@@ -154,7 +154,7 @@
     }
 
     static Operation* DownloadSliceRawImage(unsigned int  sliceIndex,
-                                            const Slice&  slice)
+                                            const Deprecated::Slice&  slice)
     {
       std::auto_ptr<Operation> tmp(new Operation(Mode_LoadRawImage));
       tmp->sliceIndex_ = sliceIndex;
@@ -163,7 +163,7 @@
       return tmp.release();
     }
 
-    static Operation* DownloadDicomFile(const Slice&  slice)
+    static Operation* DownloadDicomFile(const Deprecated::Slice&  slice)
     {
       std::auto_ptr<Operation> tmp(new Operation(Mode_LoadDicomFile));
       tmp->slice_ = &slice;
@@ -241,7 +241,7 @@
       
       for (unsigned int frame = 0; frame < frames; frame++)
       {
-        std::auto_ptr<Slice> slice(new Slice);
+        std::auto_ptr<Deprecated::Slice> slice(new Deprecated::Slice);
         if (slice->ParseOrthancFrame(dicom, instances[i], frame))
         {
           CoordinateSystem3D geometry = slice->GetGeometry();
@@ -277,7 +277,7 @@
     
     for (unsigned int frame = 0; frame < frames; frame++)
     {
-      std::auto_ptr<Slice> slice(new Slice);
+      std::auto_ptr<Deprecated::Slice> slice(new Deprecated::Slice);
       if (slice->ParseOrthancFrame(dicom, instanceId, frame))
       {
         CoordinateSystem3D geometry = slice->GetGeometry();
@@ -308,7 +308,7 @@
     Orthanc::DicomMap dicom;
     MessagingToolbox::ConvertDataset(dicom, dataset);
     
-    std::auto_ptr<Slice> slice(new Slice);
+    std::auto_ptr<Deprecated::Slice> slice(new Deprecated::Slice);
     if (slice->ParseOrthancFrame(dicom, instanceId, frame))
     {
       LOG(INFO) << "Loaded instance geometry " << instanceId;
@@ -721,14 +721,14 @@
   }
   
   
-  const Slice& OrthancSlicesLoader::GetSlice(size_t index) const
+  const Deprecated::Slice& OrthancSlicesLoader::GetSlice(size_t index) const
   {
     if (state_ != State_GeometryReady)
     {
       throw Orthanc::OrthancException(Orthanc::ErrorCode_BadSequenceOfCalls);
     }
 
-    return dynamic_cast<const Slice&>(slices_.GetSlicePayload(index));
+    return dynamic_cast<const Deprecated::Slice&>(slices_.GetSlicePayload(index));
   }
   
   
@@ -746,7 +746,7 @@
   }
   
   
-  void OrthancSlicesLoader::ScheduleSliceImagePng(const Slice& slice,
+  void OrthancSlicesLoader::ScheduleSliceImagePng(const Deprecated::Slice& slice,
                                                   size_t index)
   {
     std::string uri = ("/instances/" + slice.GetOrthancInstanceId() + "/frames/" +
@@ -781,7 +781,7 @@
         static_cast<unsigned int>(index), slice, SliceImageQuality_FullPng));
 }
   
-  void OrthancSlicesLoader::ScheduleSliceImagePam(const Slice& slice,
+  void OrthancSlicesLoader::ScheduleSliceImagePam(const Deprecated::Slice& slice,
                                                   size_t index)
   {
     std::string uri = 
@@ -819,7 +819,7 @@
 
 
   
-  void OrthancSlicesLoader::ScheduleSliceImageJpeg(const Slice& slice,
+  void OrthancSlicesLoader::ScheduleSliceImageJpeg(const Deprecated::Slice& slice,
                                                    size_t index,
                                                    SliceImageQuality quality)
   {
@@ -870,7 +870,7 @@
       throw Orthanc::OrthancException(Orthanc::ErrorCode_BadSequenceOfCalls);
     }
     
-    const Slice& slice = GetSlice(index);
+    const Deprecated::Slice& slice = GetSlice(index);
     
     if (slice.HasOrthancDecoding())
     {
--- a/Framework/Toolbox/OrthancSlicesLoader.h	Mon May 20 15:44:01 2019 +0200
+++ b/Framework/Toolbox/OrthancSlicesLoader.h	Mon May 20 16:26:34 2019 +0200
@@ -46,14 +46,14 @@
       
     private:
       unsigned int                   sliceIndex_;
-      const Slice&                   slice_;
+      const Deprecated::Slice&                   slice_;
       const Orthanc::ImageAccessor&  image_;
       SliceImageQuality              effectiveQuality_;
 
     public:
       SliceImageReadyMessage(const OrthancSlicesLoader& origin,
                              unsigned int sliceIndex,
-                             const Slice& slice,
+                             const Deprecated::Slice& slice,
                              const Orthanc::ImageAccessor& image,
                              SliceImageQuality effectiveQuality) :
         OriginMessage(origin),
@@ -69,7 +69,7 @@
         return sliceIndex_;
       }
 
-      const Slice& GetSlice() const
+      const Deprecated::Slice& GetSlice() const
       {
         return slice_;
       }
@@ -91,14 +91,14 @@
       ORTHANC_STONE_MESSAGE(__FILE__, __LINE__);
       
     private:
-      const Slice&       slice_;
+      const Deprecated::Slice&       slice_;
       unsigned int       sliceIndex_;
       SliceImageQuality  effectiveQuality_;
 
     public:
       SliceImageErrorMessage(const OrthancSlicesLoader& origin,
                              unsigned int sliceIndex,
-                             const Slice& slice,
+                             const Deprecated::Slice& slice,
                              SliceImageQuality effectiveQuality) :
         OriginMessage(origin),
         slice_(slice),
@@ -111,7 +111,7 @@
         return sliceIndex_;
       }
 
-      const Slice& GetSlice() const
+      const Deprecated::Slice& GetSlice() const
       {
         return slice_;
       }
@@ -170,13 +170,13 @@
 
     void ParseSliceRawImage(const OrthancApiClient::BinaryResponseReadyMessage& message);
 
-    void ScheduleSliceImagePng(const Slice& slice,
+    void ScheduleSliceImagePng(const Deprecated::Slice& slice,
                                size_t index);
 
-    void ScheduleSliceImagePam(const Slice& slice,
+    void ScheduleSliceImagePam(const Deprecated::Slice& slice,
                                size_t index);
 
-    void ScheduleSliceImageJpeg(const Slice& slice,
+    void ScheduleSliceImageJpeg(const Deprecated::Slice& slice,
                                 size_t index,
                                 SliceImageQuality quality);
 
@@ -198,7 +198,7 @@
 
     size_t GetSlicesCount() const;
 
-    const Slice& GetSlice(size_t index) const;
+    const Deprecated::Slice& GetSlice(size_t index) const;
 
     bool LookupSlice(size_t& index,
                      const CoordinateSystem3D& plane) const;
--- a/Framework/Toolbox/Slice.cpp	Mon May 20 15:44:01 2019 +0200
+++ b/Framework/Toolbox/Slice.cpp	Mon May 20 16:26:34 2019 +0200
@@ -30,7 +30,7 @@
 
 #include <boost/lexical_cast.hpp>
 
-namespace OrthancStone
+namespace Deprecated
 {
   static bool ParseDouble(double& target,
                           const std::string& source)
@@ -118,16 +118,16 @@
       return false;
     }
 
-    if (!LinearAlgebra::IsCloseToZero(offset0))
+    if (!OrthancStone::LinearAlgebra::IsCloseToZero(offset0))
     {
       LOG(ERROR) << "Invalid syntax";
       return false;
     }
 
-    geometry_ = CoordinateSystem3D(geometry_.GetOrigin() + z * geometry_.GetNormal(),
-                                   //+ 650 * geometry_.GetAxisX(),
-                                   geometry_.GetAxisX(),
-                                   geometry_.GetAxisY());
+    geometry_ = OrthancStone::CoordinateSystem3D(geometry_.GetOrigin() + z * geometry_.GetNormal(),
+                                                 //+ 650 * geometry_.GetAxisX(),
+                                                 geometry_.GetAxisX(),
+                                                 geometry_.GetAxisY());
 
     thickness_ = offset1 - offset0;
     if (thickness_ < 0)
@@ -185,19 +185,19 @@
     
     converter_.ReadParameters(dataset);
 
-    GeometryToolbox::GetPixelSpacing(pixelSpacingX_, pixelSpacingY_, dataset);
+    OrthancStone::GeometryToolbox::GetPixelSpacing(pixelSpacingX_, pixelSpacingY_, dataset);
 
     std::string position, orientation;
     if (dataset.CopyToString(position, Orthanc::DICOM_TAG_IMAGE_POSITION_PATIENT, false) &&
         dataset.CopyToString(orientation, Orthanc::DICOM_TAG_IMAGE_ORIENTATION_PATIENT, false))
     {
-      geometry_ = CoordinateSystem3D(position, orientation);
+      geometry_ = OrthancStone::CoordinateSystem3D(position, orientation);
 
       bool ok = true;
 
-      switch (StringToSopClassUid(sopClassUid_))
+      switch (OrthancStone::StringToSopClassUid(sopClassUid_))
       {
-        case SopClassUid_RTDose:
+        case OrthancStone::SopClassUid_RTDose:
           type_ = Type_OrthancRawFrame;
           ok = ComputeRTDoseGeometry(dataset, frame);
           break;
@@ -243,7 +243,7 @@
   }
 
   
-  const CoordinateSystem3D& Slice::GetGeometry() const
+  const OrthancStone::CoordinateSystem3D& Slice::GetGeometry() const
   {
     if (type_ == Type_Invalid)
     {
@@ -320,7 +320,7 @@
   }
 
 
-  bool Slice::ContainsPlane(const CoordinateSystem3D& plane) const
+  bool Slice::ContainsPlane(const OrthancStone::CoordinateSystem3D& plane) const
   {
     if (type_ == Type_Invalid)
     {
@@ -328,16 +328,16 @@
     }
 
     bool opposite;
-    return (GeometryToolbox::IsParallelOrOpposite(opposite,
-                                                  GetGeometry().GetNormal(),
-                                                  plane.GetNormal()) &&
-            LinearAlgebra::IsNear(GetGeometry().ProjectAlongNormal(GetGeometry().GetOrigin()),
-                                  GetGeometry().ProjectAlongNormal(plane.GetOrigin()),
-                                  thickness_ / 2.0));
+    return (OrthancStone::GeometryToolbox::IsParallelOrOpposite(opposite,
+                                                                GetGeometry().GetNormal(),
+                                                                plane.GetNormal()) &&
+            OrthancStone::LinearAlgebra::IsNear(GetGeometry().ProjectAlongNormal(GetGeometry().GetOrigin()),
+                                                GetGeometry().ProjectAlongNormal(plane.GetOrigin()),
+                                                thickness_ / 2.0));
   }
 
   
-  void Slice::GetExtent(std::vector<Vector>& points) const
+  void Slice::GetExtent(std::vector<OrthancStone::Vector>& points) const
   {
     double sx = GetPixelSpacingX();
     double sy = GetPixelSpacingY();
--- a/Framework/Toolbox/Slice.h	Mon May 20 15:44:01 2019 +0200
+++ b/Framework/Toolbox/Slice.h	Mon May 20 16:26:34 2019 +0200
@@ -27,7 +27,7 @@
 #include <Core/DicomFormat/DicomImageInformation.h>
 #include <Core/IDynamicObject.h>
 
-namespace OrthancStone
+namespace Deprecated
 {
   // TODO - Remove this class
   class Slice :
@@ -51,7 +51,7 @@
     std::string          sopClassUid_;
     unsigned int         frame_;
     unsigned int         frameCount_;   // TODO : Redundant with "imageInformation_"
-    CoordinateSystem3D   geometry_;
+    OrthancStone::CoordinateSystem3D   geometry_;
     double               pixelSpacingX_;
     double               pixelSpacingY_;
     double               thickness_;
@@ -79,7 +79,7 @@
 
     // TODO Is this constructor the best way to go to tackle missing
     // layers within SliceViewerWidget?
-    Slice(const CoordinateSystem3D& plane,
+    Slice(const OrthancStone::CoordinateSystem3D& plane,
           double thickness) :
       type_(Type_Standalone),
       frame_(0),
@@ -93,7 +93,7 @@
     {      
     }
 
-    Slice(const CoordinateSystem3D& plane,
+    Slice(const OrthancStone::CoordinateSystem3D& plane,
           double pixelSpacingX,
           double pixelSpacingY,
           double thickness,
@@ -130,7 +130,7 @@
 
     unsigned int GetFrame() const;
 
-    const CoordinateSystem3D& GetGeometry() const;
+    const OrthancStone::CoordinateSystem3D& GetGeometry() const;
 
     double GetThickness() const;
 
@@ -144,9 +144,9 @@
 
     const DicomFrameConverter& GetConverter() const;
 
-    bool ContainsPlane(const CoordinateSystem3D& plane) const;
+    bool ContainsPlane(const OrthancStone::CoordinateSystem3D& plane) const;
 
-    void GetExtent(std::vector<Vector>& points) const;
+    void GetExtent(std::vector<OrthancStone::Vector>& points) const;
 
     const Orthanc::DicomImageInformation& GetImageInformation() const;
 
--- a/Framework/Volumes/ISlicedVolume.h	Mon May 20 15:44:01 2019 +0200
+++ b/Framework/Volumes/ISlicedVolume.h	Mon May 20 16:26:34 2019 +0200
@@ -41,12 +41,12 @@
       
     private:
       size_t        sliceIndex_;
-      const Slice&  slice_;
+      const Deprecated::Slice&  slice_;
       
     public:
       SliceContentChangedMessage(ISlicedVolume& origin,
                                  size_t sliceIndex,
-                                 const Slice& slice) :
+                                 const Deprecated::Slice& slice) :
         OriginMessage(origin),
         sliceIndex_(sliceIndex),
         slice_(slice)
@@ -58,7 +58,7 @@
         return sliceIndex_;
       }
 
-      const Slice& GetSlice() const
+      const Deprecated::Slice& GetSlice() const
       {
         return slice_;
       }
@@ -72,6 +72,6 @@
     
     virtual size_t GetSliceCount() const = 0;
 
-    virtual const Slice& GetSlice(size_t slice) const = 0;
+    virtual const Deprecated::Slice& GetSlice(size_t slice) const = 0;
   };
 }
--- a/Framework/Volumes/ImageBuffer3D.cpp	Mon May 20 15:44:01 2019 +0200
+++ b/Framework/Volumes/ImageBuffer3D.cpp	Mon May 20 16:26:34 2019 +0200
@@ -259,7 +259,7 @@
 
 
   bool ImageBuffer3D::FitWindowingToRange(RenderStyle& style,
-                                          const DicomFrameConverter& converter) const
+                                          const Deprecated::DicomFrameConverter& converter) const
   {
     if (hasRange_)
     {
--- a/Framework/Volumes/ImageBuffer3D.h	Mon May 20 15:44:01 2019 +0200
+++ b/Framework/Volumes/ImageBuffer3D.h	Mon May 20 16:26:34 2019 +0200
@@ -122,7 +122,7 @@
                   float& maxValue) const;
 
     bool FitWindowingToRange(RenderStyle& style,
-                             const DicomFrameConverter& converter) const;
+                             const Deprecated::DicomFrameConverter& converter) const;
 
     uint8_t GetVoxelGrayscale8Unchecked(unsigned int x,
                                         unsigned int y,
--- a/Framework/Widgets/SliceViewerWidget.cpp	Mon May 20 15:44:01 2019 +0200
+++ b/Framework/Widgets/SliceViewerWidget.cpp	Mon May 20 16:26:34 2019 +0200
@@ -510,7 +510,7 @@
               << "," << plane.GetOrigin()[1]
               << "," << plane.GetOrigin()[2] << ")";
     
-    Slice displayedSlice(plane_, THIN_SLICE_THICKNESS);
+    Deprecated::Slice displayedSlice(plane_, THIN_SLICE_THICKNESS);
 
     //if (!displayedSlice.ContainsPlane(slice))
     {
--- a/Framework/Widgets/SliceViewerWidget.h	Mon May 20 15:44:01 2019 +0200
+++ b/Framework/Widgets/SliceViewerWidget.h	Mon May 20 16:26:34 2019 +0200
@@ -46,17 +46,17 @@
       ORTHANC_STONE_MESSAGE(__FILE__, __LINE__);
       
     private:
-      const Slice& slice_;
+      const Deprecated::Slice& slice_;
 
     public:
       DisplayedSliceMessage(SliceViewerWidget& origin,
-                            const Slice& slice) :
+                            const Deprecated::Slice& slice) :
         OriginMessage(origin),
         slice_(slice)
       {
       }
 
-      const Slice& GetSlice() const
+      const Deprecated::Slice& GetSlice() const
       {
         return slice_;
       }
--- a/Framework/dev.h	Mon May 20 15:44:01 2019 +0200
+++ b/Framework/dev.h	Mon May 20 16:26:34 2019 +0200
@@ -64,8 +64,8 @@
     }
 
 
-    static bool IsCompatible(const Slice& a,
-                             const Slice& b)
+    static bool IsCompatible(const Deprecated::Slice& a,
+                             const Deprecated::Slice& b)
     {
       if (!GeometryToolbox::IsParallel(a.GetGeometry().GetNormal(),
                                        b.GetGeometry().GetNormal()))
@@ -98,8 +98,8 @@
     }
 
 
-    static double GetDistance(const Slice& a,
-                              const Slice& b)
+    static double GetDistance(const Deprecated::Slice& a,
+                              const Deprecated::Slice& b)
     {
       return fabs(a.GetGeometry().ProjectAlongNormal(a.GetGeometry().GetOrigin()) -
                   a.GetGeometry().ProjectAlongNormal(b.GetGeometry().GetOrigin()));
@@ -268,7 +268,7 @@
       return loader_.GetSlicesCount();
     }
 
-    virtual const Slice& GetSlice(size_t index) const
+    virtual const Deprecated::Slice& GetSlice(size_t index) const
     {
       return loader_.GetSlice(index);
     }
@@ -287,7 +287,7 @@
     }
 
     bool FitWindowingToRange(RenderStyle& style,
-                             const DicomFrameConverter& converter) const
+                             const Deprecated::DicomFrameConverter& converter) const
     {
       if (image_.get() == NULL)
       {
@@ -311,7 +311,7 @@
     double               pixelSpacingY_;
     double               sliceThickness_;
     CoordinateSystem3D   reference_;
-    DicomFrameConverter  converter_;
+    Deprecated::DicomFrameConverter  converter_;
 
     double ComputeAxialThickness(const OrthancVolumeImage& volume) const
     {
@@ -320,8 +320,8 @@
       size_t n = volume.GetSlicesCount();
       if (n > 1)
       {
-        const Slice& a = volume.GetSlice(0);
-        const Slice& b = volume.GetSlice(n - 1);
+        const Deprecated::Slice& a = volume.GetSlice(0);
+        const Deprecated::Slice& b = volume.GetSlice(n - 1);
         thickness = ((reference_.ProjectAlongNormal(b.GetGeometry().GetOrigin()) -
                       reference_.ProjectAlongNormal(a.GetGeometry().GetOrigin())) /
                      (static_cast<double>(n) - 1.0));
@@ -345,7 +345,7 @@
 
     void SetupAxial(const OrthancVolumeImage& volume)
     {
-      const Slice& axial = volume.GetSlice(0);
+      const Deprecated::Slice& axial = volume.GetSlice(0);
 
       width_ = axial.GetWidth();
       height_ = axial.GetHeight();
@@ -360,7 +360,7 @@
 
     void SetupCoronal(const OrthancVolumeImage& volume)
     {
-      const Slice& axial = volume.GetSlice(0);
+      const Deprecated::Slice& axial = volume.GetSlice(0);
       double axialThickness = ComputeAxialThickness(volume);
 
       width_ = axial.GetWidth();
@@ -382,7 +382,7 @@
 
     void SetupSagittal(const OrthancVolumeImage& volume)
     {
-      const Slice& axial = volume.GetSlice(0);
+      const Deprecated::Slice& axial = volume.GetSlice(0);
       double axialThickness = ComputeAxialThickness(volume);
 
       width_ = axial.GetHeight();
@@ -470,7 +470,7 @@
       }
     }
 
-    Slice* GetSlice(size_t slice) const
+    Deprecated::Slice* GetSlice(size_t slice) const
     {
       if (slice >= depth_)
       {
@@ -483,8 +483,8 @@
                                   reference_.GetAxisX(),
                                   reference_.GetAxisY());
 
-        return new Slice(origin, pixelSpacingX_, pixelSpacingY_, sliceThickness_,
-                         width_, height_, converter_);
+        return new Deprecated::Slice(origin, pixelSpacingX_, pixelSpacingY_, sliceThickness_,
+                                     width_, height_, converter_);
       }
     }
   };
@@ -500,12 +500,12 @@
     {
     private:
       const Orthanc::ImageAccessor&  frame_;
-      const Slice&                   slice_;
+      const Deprecated::Slice&                   slice_;
       bool                           isFullQuality_;
 
     public:
       RendererFactory(const Orthanc::ImageAccessor& frame,
-                      const Slice& slice,
+                      const Deprecated::Slice& slice,
                       bool isFullQuality) :
                       frame_(frame),
                       slice_(slice),
@@ -662,7 +662,7 @@
       {
         // As the slices of the volumic image are arranged in a box,
         // we only consider one single reference slice (the one with index 0).
-        std::auto_ptr<Slice> slice(GetProjectionGeometry(projection).GetSlice(0));
+        std::auto_ptr<Deprecated::Slice> slice(GetProjectionGeometry(projection).GetSlice(0));
         slice->GetExtent(points);
 
         return true;
@@ -693,7 +693,7 @@
             frame.reset(Orthanc::Image::Clone(reader.GetAccessor()));
           }
 
-          std::auto_ptr<Slice> slice(geometry.GetSlice(closest));
+          std::auto_ptr<Deprecated::Slice> slice(geometry.GetSlice(closest));
 
           RendererFactory factory(*frame, *slice, isFullQuality);
 
@@ -858,7 +858,7 @@
       {
         slice_ = slice;
 
-        std::auto_ptr<Slice> tmp(slices_->GetSlice(slice_));
+        std::auto_ptr<Deprecated::Slice> tmp(slices_->GetSlice(slice_));
         widget_.SetSlice(tmp->GetGeometry());
       }
     }
@@ -917,7 +917,7 @@
 
     virtual void ScheduleLayerCreation(const CoordinateSystem3D& viewportSlice)
     {
-      Slice reference(viewportSlice, 0.001);
+      Deprecated::Slice reference(viewportSlice, 0.001);
 
       Vector p, d;