diff Framework/dev.h @ 726:4f2416d519b4

moving layers, widgets and loaders to Deprecated namespace
author Sebastien Jodogne <s.jodogne@gmail.com>
date Tue, 21 May 2019 11:43:25 +0200
parents d2c0e347ddc2
children
line wrap: on
line diff
--- a/Framework/dev.h	Mon May 20 16:26:34 2019 +0200
+++ b/Framework/dev.h	Tue May 21 11:43:25 2019 +0200
@@ -38,16 +38,16 @@
 #include <boost/math/special_functions/round.hpp>
 
 
-namespace OrthancStone
+namespace Deprecated
 {
   // TODO: Handle errors while loading
   class OrthancVolumeImage :
     public ISlicedVolume,
-    public IObserver
+    public OrthancStone::IObserver
   {
   private:
     OrthancSlicesLoader           loader_;
-    std::auto_ptr<ImageBuffer3D>  image_;
+    std::auto_ptr<OrthancStone::ImageBuffer3D>  image_;
     std::auto_ptr<DownloadStack>  downloadStack_;
     bool                          computeRange_;
     size_t                        pendingSlices_;
@@ -59,16 +59,16 @@
       unsigned int slice;
       if (downloadStack_->Pop(slice))
       {
-        loader_.ScheduleLoadSliceImage(slice, SliceImageQuality_Jpeg90);
+        loader_.ScheduleLoadSliceImage(slice, OrthancStone::SliceImageQuality_Jpeg90);
       }
     }
 
 
-    static bool IsCompatible(const Deprecated::Slice& a,
-                             const Deprecated::Slice& b)
+    static bool IsCompatible(const Slice& a,
+                             const Slice& b)
     {
-      if (!GeometryToolbox::IsParallel(a.GetGeometry().GetNormal(),
-                                       b.GetGeometry().GetNormal()))
+      if (!OrthancStone::GeometryToolbox::IsParallel(a.GetGeometry().GetNormal(),
+                                                     b.GetGeometry().GetNormal()))
       {
         LOG(ERROR) << "A slice in the volume image is not parallel to the others.";
         return false;
@@ -87,8 +87,8 @@
         return false;
       }
 
-      if (!LinearAlgebra::IsNear(a.GetPixelSpacingX(), b.GetPixelSpacingX()) ||
-          !LinearAlgebra::IsNear(a.GetPixelSpacingY(), b.GetPixelSpacingY()))
+      if (!OrthancStone::LinearAlgebra::IsNear(a.GetPixelSpacingX(), b.GetPixelSpacingX()) ||
+          !OrthancStone::LinearAlgebra::IsNear(a.GetPixelSpacingY(), b.GetPixelSpacingY()))
       {
         LOG(ERROR) << "The pixel spacing of the slices change across the volume image";
         return false;
@@ -98,8 +98,8 @@
     }
 
 
-    static double GetDistance(const Deprecated::Slice& a,
-                              const Deprecated::Slice& b)
+    static double GetDistance(const Slice& a,
+                              const Slice& b)
     {
       return fabs(a.GetGeometry().ProjectAlongNormal(a.GetGeometry().GetOrigin()) -
                   a.GetGeometry().ProjectAlongNormal(b.GetGeometry().GetOrigin()));
@@ -141,8 +141,8 @@
 
       for (size_t i = 1; i < loader_.GetSlicesCount(); i++)
       {
-        if (!LinearAlgebra::IsNear(spacingZ, GetDistance(loader_.GetSlice(i - 1), loader_.GetSlice(i)),
-                                   0.001 /* this is expressed in mm */))
+        if (!OrthancStone::LinearAlgebra::IsNear(spacingZ, GetDistance(loader_.GetSlice(i - 1), loader_.GetSlice(i)),
+                                                 0.001 /* this is expressed in mm */))
         {
           LOG(ERROR) << "The distance between successive slices is not constant in a volume image";
           BroadcastMessage(ISlicedVolume::GeometryErrorMessage(*this));
@@ -156,7 +156,7 @@
       LOG(INFO) << "Creating a volume image of size " << width << "x" << height
                 << "x" << loader_.GetSlicesCount() << " in " << Orthanc::EnumerationToString(format);
 
-      image_.reset(new ImageBuffer3D(format, width, height, static_cast<unsigned int>(loader_.GetSlicesCount()), computeRange_));
+      image_.reset(new OrthancStone::ImageBuffer3D(format, width, height, static_cast<unsigned int>(loader_.GetSlicesCount()), computeRange_));
       image_->GetGeometry().SetAxialGeometry(loader_.GetSlice(0).GetGeometry());
       image_->GetGeometry().SetVoxelDimensions(loader_.GetSlice(0).GetPixelSpacingX(),
                                                loader_.GetSlice(0).GetPixelSpacingY(), spacingZ);
@@ -190,12 +190,12 @@
       assert(&message.GetOrigin() == &loader_);
 
       {
-        ImageBuffer3D::SliceWriter writer(*image_, VolumeProjection_Axial, message.GetSliceIndex());
+        OrthancStone::ImageBuffer3D::SliceWriter writer(*image_, OrthancStone::VolumeProjection_Axial, message.GetSliceIndex());
         Orthanc::ImageProcessing::Copy(writer.GetAccessor(), message.GetImage());
       }
 
       BroadcastMessage(ISlicedVolume::SliceContentChangedMessage
-                  (*this, message.GetSliceIndex(), message.GetSlice()));
+                       (*this, message.GetSliceIndex(), message.GetSlice()));
 
       if (pendingSlices_ == 1)
       {
@@ -221,7 +221,7 @@
 
 
   public:
-    OrthancVolumeImage(MessageBroker& broker,
+    OrthancVolumeImage(OrthancStone::MessageBroker& broker,
                        OrthancApiClient& orthanc,
                        bool computeRange) :
       ISlicedVolume(broker),
@@ -231,19 +231,19 @@
       pendingSlices_(0)
     {
       loader_.RegisterObserverCallback(
-        new Callable<OrthancVolumeImage, OrthancSlicesLoader::SliceGeometryReadyMessage>
+        new OrthancStone::Callable<OrthancVolumeImage, OrthancSlicesLoader::SliceGeometryReadyMessage>
         (*this, &OrthancVolumeImage::OnSliceGeometryReady));
 
       loader_.RegisterObserverCallback(
-        new Callable<OrthancVolumeImage, OrthancSlicesLoader::SliceGeometryErrorMessage>
+        new OrthancStone::Callable<OrthancVolumeImage, OrthancSlicesLoader::SliceGeometryErrorMessage>
         (*this, &OrthancVolumeImage::OnSliceGeometryError));
 
       loader_.RegisterObserverCallback(
-        new Callable<OrthancVolumeImage, OrthancSlicesLoader::SliceImageReadyMessage>
+        new OrthancStone::Callable<OrthancVolumeImage, OrthancSlicesLoader::SliceImageReadyMessage>
         (*this, &OrthancVolumeImage::OnSliceImageReady));
 
       loader_.RegisterObserverCallback(
-        new Callable<OrthancVolumeImage, OrthancSlicesLoader::SliceImageErrorMessage>
+        new OrthancStone::Callable<OrthancVolumeImage, OrthancSlicesLoader::SliceImageErrorMessage>
         (*this, &OrthancVolumeImage::OnSliceImageError));
     }
 
@@ -268,12 +268,12 @@
       return loader_.GetSlicesCount();
     }
 
-    virtual const Deprecated::Slice& GetSlice(size_t index) const
+    virtual const Slice& GetSlice(size_t index) const
     {
       return loader_.GetSlice(index);
     }
 
-    ImageBuffer3D& GetImage() const
+    OrthancStone::ImageBuffer3D& GetImage() const
     {
       if (image_.get() == NULL)
       {
@@ -287,7 +287,7 @@
     }
 
     bool FitWindowingToRange(RenderStyle& style,
-                             const Deprecated::DicomFrameConverter& converter) const
+                             const DicomFrameConverter& converter) const
     {
       if (image_.get() == NULL)
       {
@@ -301,7 +301,7 @@
   };
 
 
-  class OLD_VolumeImageGeometry
+  class VolumeImageGeometry
   {
   private:
     unsigned int         width_;
@@ -310,8 +310,8 @@
     double               pixelSpacingX_;
     double               pixelSpacingY_;
     double               sliceThickness_;
-    CoordinateSystem3D   reference_;
-    Deprecated::DicomFrameConverter  converter_;
+    OrthancStone::CoordinateSystem3D   reference_;
+    DicomFrameConverter  converter_;
 
     double ComputeAxialThickness(const OrthancVolumeImage& volume) const
     {
@@ -320,8 +320,8 @@
       size_t n = volume.GetSlicesCount();
       if (n > 1)
       {
-        const Deprecated::Slice& a = volume.GetSlice(0);
-        const Deprecated::Slice& b = volume.GetSlice(n - 1);
+        const Slice& a = volume.GetSlice(0);
+        const 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 Deprecated::Slice& axial = volume.GetSlice(0);
+      const Slice& axial = volume.GetSlice(0);
 
       width_ = axial.GetWidth();
       height_ = axial.GetHeight();
@@ -360,7 +360,7 @@
 
     void SetupCoronal(const OrthancVolumeImage& volume)
     {
-      const Deprecated::Slice& axial = volume.GetSlice(0);
+      const Slice& axial = volume.GetSlice(0);
       double axialThickness = ComputeAxialThickness(volume);
 
       width_ = axial.GetWidth();
@@ -371,18 +371,18 @@
       pixelSpacingY_ = axialThickness;
       sliceThickness_ = axial.GetPixelSpacingY();
 
-      Vector origin = axial.GetGeometry().GetOrigin();
+      OrthancStone::Vector origin = axial.GetGeometry().GetOrigin();
       origin += (static_cast<double>(volume.GetSlicesCount() - 1) *
-                axialThickness * axial.GetGeometry().GetNormal());
+                 axialThickness * axial.GetGeometry().GetNormal());
 
-      reference_ = CoordinateSystem3D(origin,
-                                      axial.GetGeometry().GetAxisX(),
-                                      - axial.GetGeometry().GetNormal());
+      reference_ = OrthancStone::CoordinateSystem3D(origin,
+                                                    axial.GetGeometry().GetAxisX(),
+                                                    - axial.GetGeometry().GetNormal());
     }
 
     void SetupSagittal(const OrthancVolumeImage& volume)
     {
-      const Deprecated::Slice& axial = volume.GetSlice(0);
+      const Slice& axial = volume.GetSlice(0);
       double axialThickness = ComputeAxialThickness(volume);
 
       width_ = axial.GetHeight();
@@ -393,18 +393,18 @@
       pixelSpacingY_ = axialThickness;
       sliceThickness_ = axial.GetPixelSpacingX();
 
-      Vector origin = axial.GetGeometry().GetOrigin();
+      OrthancStone::Vector origin = axial.GetGeometry().GetOrigin();
       origin += (static_cast<double>(volume.GetSlicesCount() - 1) *
-                axialThickness * axial.GetGeometry().GetNormal());
+                 axialThickness * axial.GetGeometry().GetNormal());
 
-      reference_ = CoordinateSystem3D(origin,
-                                      axial.GetGeometry().GetAxisY(),
-                                      axial.GetGeometry().GetNormal());
+      reference_ = OrthancStone::CoordinateSystem3D(origin,
+                                                    axial.GetGeometry().GetAxisY(),
+                                                    axial.GetGeometry().GetNormal());
     }
 
   public:
-    OLD_VolumeImageGeometry(const OrthancVolumeImage& volume,
-                            VolumeProjection projection)
+    VolumeImageGeometry(const OrthancVolumeImage& volume,
+                        OrthancStone::VolumeProjection projection)
     {
       if (volume.GetSlicesCount() == 0)
       {
@@ -415,20 +415,20 @@
 
       switch (projection)
       {
-      case VolumeProjection_Axial:
-        SetupAxial(volume);
-        break;
+        case OrthancStone::VolumeProjection_Axial:
+          SetupAxial(volume);
+          break;
 
-      case VolumeProjection_Coronal:
-        SetupCoronal(volume);
-        break;
+        case OrthancStone::VolumeProjection_Coronal:
+          SetupCoronal(volume);
+          break;
 
-      case VolumeProjection_Sagittal:
-        SetupSagittal(volume);
-        break;
+        case OrthancStone::VolumeProjection_Sagittal:
+          SetupSagittal(volume);
+          break;
 
-      default:
-        throw Orthanc::OrthancException(Orthanc::ErrorCode_ParameterOutOfRange);
+        default:
+          throw Orthanc::OrthancException(Orthanc::ErrorCode_ParameterOutOfRange);
       }
     }
 
@@ -437,18 +437,18 @@
       return depth_;
     }
 
-    const Vector& GetNormal() const
+    const OrthancStone::Vector& GetNormal() const
     {
       return reference_.GetNormal();
     }
 
     bool LookupSlice(size_t& index,
-                     const CoordinateSystem3D& slice) const
+                     const OrthancStone::CoordinateSystem3D& slice) const
     {
       bool opposite;
-      if (!GeometryToolbox::IsParallelOrOpposite(opposite,
-                                                 reference_.GetNormal(),
-                                                 slice.GetNormal()))
+      if (!OrthancStone::GeometryToolbox::IsParallelOrOpposite(opposite,
+                                                               reference_.GetNormal(),
+                                                               slice.GetNormal()))
       {
         return false;
       }
@@ -459,7 +459,7 @@
       int s = static_cast<int>(boost::math::iround(z));
 
       if (s < 0 ||
-        s >= static_cast<int>(depth_))
+          s >= static_cast<int>(depth_))
       {
         return false;
       }
@@ -470,7 +470,7 @@
       }
     }
 
-    Deprecated::Slice* GetSlice(size_t slice) const
+    Slice* GetSlice(size_t slice) const
     {
       if (slice >= depth_)
       {
@@ -478,13 +478,13 @@
       }
       else
       {
-        CoordinateSystem3D origin(reference_.GetOrigin() +
-                                  static_cast<double>(slice) * sliceThickness_ * reference_.GetNormal(),
-                                  reference_.GetAxisX(),
-                                  reference_.GetAxisY());
+        OrthancStone::CoordinateSystem3D origin(reference_.GetOrigin() +
+                                                static_cast<double>(slice) * sliceThickness_ * reference_.GetNormal(),
+                                                reference_.GetAxisX(),
+                                                reference_.GetAxisY());
 
-        return new Deprecated::Slice(origin, pixelSpacingX_, pixelSpacingY_, sliceThickness_,
-                                     width_, height_, converter_);
+        return new Slice(origin, pixelSpacingX_, pixelSpacingY_, sliceThickness_,
+                         width_, height_, converter_);
       }
     }
   };
@@ -493,23 +493,23 @@
 
   class VolumeImageMPRSlicer :
     public IVolumeSlicer,
-    public IObserver
+    public OrthancStone::IObserver
   {
   private:
     class RendererFactory : public LayerReadyMessage::IRendererFactory
     {
     private:
       const Orthanc::ImageAccessor&  frame_;
-      const Deprecated::Slice&                   slice_;
+      const Slice&                   slice_;
       bool                           isFullQuality_;
 
     public:
       RendererFactory(const Orthanc::ImageAccessor& frame,
-                      const Deprecated::Slice& slice,
+                      const Slice& slice,
                       bool isFullQuality) :
-                      frame_(frame),
-                      slice_(slice),
-                      isFullQuality_(isFullQuality)
+        frame_(frame),
+        slice_(slice),
+        isFullQuality_(isFullQuality)
       {
       }
 
@@ -521,9 +521,9 @@
 
 
     OrthancVolumeImage&                 volume_;
-    std::auto_ptr<OLD_VolumeImageGeometry>  axialGeometry_;
-    std::auto_ptr<OLD_VolumeImageGeometry>  coronalGeometry_;
-    std::auto_ptr<OLD_VolumeImageGeometry>  sagittalGeometry_;
+    std::auto_ptr<VolumeImageGeometry>  axialGeometry_;
+    std::auto_ptr<VolumeImageGeometry>  coronalGeometry_;
+    std::auto_ptr<VolumeImageGeometry>  sagittalGeometry_;
 
 
     bool IsGeometryReady() const
@@ -536,9 +536,9 @@
       assert(&message.GetOrigin() == &volume_);
 
       // These 3 values are only used to speed up the IVolumeSlicer
-      axialGeometry_.reset(new OLD_VolumeImageGeometry(volume_, VolumeProjection_Axial));
-      coronalGeometry_.reset(new OLD_VolumeImageGeometry(volume_, VolumeProjection_Coronal));
-      sagittalGeometry_.reset(new OLD_VolumeImageGeometry(volume_, VolumeProjection_Sagittal));
+      axialGeometry_.reset(new VolumeImageGeometry(volume_, OrthancStone::VolumeProjection_Axial));
+      coronalGeometry_.reset(new VolumeImageGeometry(volume_, OrthancStone::VolumeProjection_Coronal));
+      sagittalGeometry_.reset(new VolumeImageGeometry(volume_, OrthancStone::VolumeProjection_Sagittal));
 
       BroadcastMessage(IVolumeSlicer::GeometryReadyMessage(*this));
     }
@@ -567,7 +567,7 @@
       BroadcastMessage(IVolumeSlicer::ContentChangedMessage(*this));
     }
 
-    const OLD_VolumeImageGeometry& GetProjectionGeometry(VolumeProjection projection)
+    const VolumeImageGeometry& GetProjectionGeometry(OrthancStone::VolumeProjection projection)
     {
       if (!IsGeometryReady())
       {
@@ -576,45 +576,45 @@
 
       switch (projection)
       {
-      case VolumeProjection_Axial:
-        return *axialGeometry_;
+        case OrthancStone::VolumeProjection_Axial:
+          return *axialGeometry_;
 
-      case VolumeProjection_Sagittal:
-        return *sagittalGeometry_;
+        case OrthancStone::VolumeProjection_Sagittal:
+          return *sagittalGeometry_;
 
-      case VolumeProjection_Coronal:
-        return *coronalGeometry_;
+        case OrthancStone::VolumeProjection_Coronal:
+          return *coronalGeometry_;
 
-      default:
-        throw Orthanc::OrthancException(Orthanc::ErrorCode_InternalError);
+        default:
+          throw Orthanc::OrthancException(Orthanc::ErrorCode_InternalError);
       }
     }
 
 
-    bool DetectProjection(VolumeProjection& projection,
-                          const CoordinateSystem3D& viewportSlice)
+    bool DetectProjection(OrthancStone::VolumeProjection& projection,
+                          const OrthancStone::CoordinateSystem3D& viewportSlice)
     {
       bool isOpposite;  // Ignored
 
-      if (GeometryToolbox::IsParallelOrOpposite(isOpposite,
-                                                viewportSlice.GetNormal(),
-                                                axialGeometry_->GetNormal()))
+      if (OrthancStone::GeometryToolbox::IsParallelOrOpposite(isOpposite,
+                                                              viewportSlice.GetNormal(),
+                                                              axialGeometry_->GetNormal()))
       {
-        projection = VolumeProjection_Axial;
+        projection = OrthancStone::VolumeProjection_Axial;
         return true;
       }
-      else if (GeometryToolbox::IsParallelOrOpposite(isOpposite,
-                                                     viewportSlice.GetNormal(),
-                                                     sagittalGeometry_->GetNormal()))
+      else if (OrthancStone::GeometryToolbox::IsParallelOrOpposite(isOpposite,
+                                                                   viewportSlice.GetNormal(),
+                                                                   sagittalGeometry_->GetNormal()))
       {
-        projection = VolumeProjection_Sagittal;
+        projection = OrthancStone::VolumeProjection_Sagittal;
         return true;
       }
-      else if (GeometryToolbox::IsParallelOrOpposite(isOpposite,
-                                                     viewportSlice.GetNormal(),
-                                                     coronalGeometry_->GetNormal()))
+      else if (OrthancStone::GeometryToolbox::IsParallelOrOpposite(isOpposite,
+                                                                   viewportSlice.GetNormal(),
+                                                                   coronalGeometry_->GetNormal()))
       {
-        projection = VolumeProjection_Coronal;
+        projection = OrthancStone::VolumeProjection_Coronal;
         return true;
       }
       else
@@ -625,33 +625,33 @@
 
 
   public:
-    VolumeImageMPRSlicer(MessageBroker& broker,
+    VolumeImageMPRSlicer(OrthancStone::MessageBroker& broker,
                          OrthancVolumeImage&  volume) :
-                         IVolumeSlicer(broker),
-                         IObserver(broker),
-                         volume_(volume)
+      IVolumeSlicer(broker),
+      IObserver(broker),
+      volume_(volume)
     {
       volume_.RegisterObserverCallback(
-        new Callable<VolumeImageMPRSlicer, ISlicedVolume::GeometryReadyMessage>
+        new OrthancStone::Callable<VolumeImageMPRSlicer, ISlicedVolume::GeometryReadyMessage>
         (*this, &VolumeImageMPRSlicer::OnGeometryReady));
 
       volume_.RegisterObserverCallback(
-        new Callable<VolumeImageMPRSlicer, ISlicedVolume::GeometryErrorMessage>
+        new OrthancStone::Callable<VolumeImageMPRSlicer, ISlicedVolume::GeometryErrorMessage>
         (*this, &VolumeImageMPRSlicer::OnGeometryError));
 
       volume_.RegisterObserverCallback(
-        new Callable<VolumeImageMPRSlicer, ISlicedVolume::ContentChangedMessage>
+        new OrthancStone::Callable<VolumeImageMPRSlicer, ISlicedVolume::ContentChangedMessage>
         (*this, &VolumeImageMPRSlicer::OnContentChanged));
 
       volume_.RegisterObserverCallback(
-        new Callable<VolumeImageMPRSlicer, ISlicedVolume::SliceContentChangedMessage>
+        new OrthancStone::Callable<VolumeImageMPRSlicer, ISlicedVolume::SliceContentChangedMessage>
         (*this, &VolumeImageMPRSlicer::OnSliceContentChanged));
     }
 
-    virtual bool GetExtent(std::vector<Vector>& points,
-                           const CoordinateSystem3D& viewportSlice) ORTHANC_OVERRIDE
+    virtual bool GetExtent(std::vector<OrthancStone::Vector>& points,
+                           const OrthancStone::CoordinateSystem3D& viewportSlice) ORTHANC_OVERRIDE
     {
-      VolumeProjection projection;
+      OrthancStone::VolumeProjection projection;
 
       if (!IsGeometryReady() ||
           !DetectProjection(projection, viewportSlice))
@@ -662,21 +662,21 @@
       {
         // 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<Deprecated::Slice> slice(GetProjectionGeometry(projection).GetSlice(0));
+        std::auto_ptr<Slice> slice(GetProjectionGeometry(projection).GetSlice(0));
         slice->GetExtent(points);
 
         return true;
       }
     }
 
-    virtual void ScheduleLayerCreation(const CoordinateSystem3D& viewportSlice) ORTHANC_OVERRIDE
+    virtual void ScheduleLayerCreation(const OrthancStone::CoordinateSystem3D& viewportSlice) ORTHANC_OVERRIDE
     {
-      VolumeProjection projection;
+      OrthancStone::VolumeProjection projection;
 
       if (IsGeometryReady() &&
           DetectProjection(projection, viewportSlice))
       {
-        const OLD_VolumeImageGeometry& geometry = GetProjectionGeometry(projection);
+        const VolumeImageGeometry& geometry = GetProjectionGeometry(projection);
 
         size_t closest;
 
@@ -687,13 +687,13 @@
           std::auto_ptr<Orthanc::Image> frame;
 
           {
-            ImageBuffer3D::SliceReader reader(volume_.GetImage(), projection, static_cast<unsigned int>(closest));
+            OrthancStone::ImageBuffer3D::SliceReader reader(volume_.GetImage(), projection, static_cast<unsigned int>(closest));
 
             // TODO Transfer ownership if non-axial, to avoid memcpy
             frame.reset(Orthanc::Image::Clone(reader.GetAccessor()));
           }
 
-          std::auto_ptr<Deprecated::Slice> slice(geometry.GetSlice(closest));
+          std::auto_ptr<Slice> slice(geometry.GetSlice(closest));
 
           RendererFactory factory(*frame, *slice, isFullQuality);
 
@@ -703,7 +703,7 @@
       }
 
       // Error
-      CoordinateSystem3D slice;
+      OrthancStone::CoordinateSystem3D slice;
       BroadcastMessage(IVolumeSlicer::LayerErrorMessage(*this, slice));
     }
   };
@@ -711,12 +711,12 @@
 
   class VolumeImageInteractor :
     public IWorldSceneInteractor,
-    public IObserver
+    public OrthancStone::IObserver
   {
   private:
     SliceViewerWidget&                  widget_;
-    VolumeProjection                    projection_;
-    std::auto_ptr<OLD_VolumeImageGeometry>  slices_;
+    OrthancStone::VolumeProjection      projection_;
+    std::auto_ptr<VolumeImageGeometry>  slices_;
     size_t                              slice_;
 
   protected:
@@ -727,7 +727,7 @@
         const OrthancVolumeImage& image =
           dynamic_cast<const OrthancVolumeImage&>(message.GetOrigin());
 
-        slices_.reset(new OLD_VolumeImageGeometry(image, projection_));
+        slices_.reset(new VolumeImageGeometry(image, projection_));
         SetSlice(slices_->GetSlicesCount() / 2);
 
         widget_.FitContent();
@@ -736,8 +736,8 @@
 
     virtual IWorldSceneMouseTracker* CreateMouseTracker(WorldSceneWidget& widget,
                                                         const ViewportGeometry& view,
-                                                        MouseButton button,
-                                                        KeyboardModifiers modifiers,
+                                                        OrthancStone::MouseButton button,
+                                                        OrthancStone::KeyboardModifiers modifiers,
                                                         int viewportX,
                                                         int viewportY,
                                                         double x,
@@ -748,7 +748,7 @@
       return  NULL;
     }
 
-    virtual void MouseOver(CairoContext& context,
+    virtual void MouseOver(OrthancStone::CairoContext& context,
                            WorldSceneWidget& widget,
                            const ViewportGeometry& view,
                            double x,
@@ -758,57 +758,57 @@
     }
 
     virtual void MouseWheel(WorldSceneWidget& widget,
-                            MouseWheelDirection direction,
-                            KeyboardModifiers modifiers,
+                            OrthancStone::MouseWheelDirection direction,
+                            OrthancStone::KeyboardModifiers modifiers,
                             IStatusBar* statusBar) ORTHANC_OVERRIDE
     {
-      int scale = (modifiers & KeyboardModifiers_Control ? 10 : 1);
+      int scale = (modifiers & OrthancStone::KeyboardModifiers_Control ? 10 : 1);
 
       switch (direction)
       {
-      case MouseWheelDirection_Up:
-        OffsetSlice(-scale);
-        break;
+        case OrthancStone::MouseWheelDirection_Up:
+          OffsetSlice(-scale);
+          break;
 
-      case MouseWheelDirection_Down:
-        OffsetSlice(scale);
-        break;
+        case OrthancStone::MouseWheelDirection_Down:
+          OffsetSlice(scale);
+          break;
 
-      default:
-        break;
+        default:
+          break;
       }
     }
 
     virtual void KeyPressed(WorldSceneWidget& widget,
-                            KeyboardKeys key,
+                            OrthancStone::KeyboardKeys key,
                             char keyChar,
-                            KeyboardModifiers modifiers,
+                            OrthancStone::KeyboardModifiers modifiers,
                             IStatusBar* statusBar) ORTHANC_OVERRIDE
     {
       switch (keyChar)
       {
-      case 's':
-        widget.FitContent();
-        break;
+        case 's':
+          widget.FitContent();
+          break;
 
-      default:
-        break;
+        default:
+          break;
       }
     }
 
   public:
-    VolumeImageInteractor(MessageBroker& broker,
+    VolumeImageInteractor(OrthancStone::MessageBroker& broker,
                           OrthancVolumeImage& volume,
                           SliceViewerWidget& widget,
-                          VolumeProjection projection) :
-                          IObserver(broker),
-                          widget_(widget),
-                          projection_(projection)
+                          OrthancStone::VolumeProjection projection) :
+      IObserver(broker),
+      widget_(widget),
+      projection_(projection)
     {
       widget.SetInteractor(*this);
 
       volume.RegisterObserverCallback(
-        new Callable<VolumeImageInteractor, ISlicedVolume::GeometryReadyMessage>
+        new OrthancStone::Callable<VolumeImageInteractor, ISlicedVolume::GeometryReadyMessage>
         (*this, &VolumeImageInteractor::OnGeometryReady));
     }
 
@@ -858,7 +858,7 @@
       {
         slice_ = slice;
 
-        std::auto_ptr<Deprecated::Slice> tmp(slices_->GetSlice(slice_));
+        std::auto_ptr<Slice> tmp(slices_->GetSlice(slice_));
         widget_.SetSlice(tmp->GetGeometry());
       }
     }
@@ -876,14 +876,14 @@
       double                     y1_;
       double                     x2_;
       double                     y2_;
-      const CoordinateSystem3D&  slice_;
+      const OrthancStone::CoordinateSystem3D&  slice_;
 
     public:
       RendererFactory(double x1,
                       double y1,
                       double x2,
                       double y2,
-                      const CoordinateSystem3D& slice) :
+                      const OrthancStone::CoordinateSystem3D& slice) :
         x1_(x1),
         y1_(y1),
         x2_(x2),
@@ -901,7 +901,7 @@
     SliceViewerWidget&  otherPlane_;
 
   public:
-    ReferenceLineSource(MessageBroker& broker,
+    ReferenceLineSource(OrthancStone::MessageBroker& broker,
                         SliceViewerWidget&  otherPlane) :
       IVolumeSlicer(broker),
       otherPlane_(otherPlane)
@@ -909,24 +909,24 @@
       BroadcastMessage(IVolumeSlicer::GeometryReadyMessage(*this));
     }
 
-    virtual bool GetExtent(std::vector<Vector>& points,
-                           const CoordinateSystem3D& viewportSlice)
+    virtual bool GetExtent(std::vector<OrthancStone::Vector>& points,
+                           const OrthancStone::CoordinateSystem3D& viewportSlice)
     {
       return false;
     }
 
-    virtual void ScheduleLayerCreation(const CoordinateSystem3D& viewportSlice)
+    virtual void ScheduleLayerCreation(const OrthancStone::CoordinateSystem3D& viewportSlice)
     {
-      Deprecated::Slice reference(viewportSlice, 0.001);
+      Slice reference(viewportSlice, 0.001);
 
-      Vector p, d;
+      OrthancStone::Vector p, d;
 
-      const CoordinateSystem3D& slice = otherPlane_.GetSlice();
+      const OrthancStone::CoordinateSystem3D& slice = otherPlane_.GetSlice();
 
       // Compute the line of intersection between the two slices
-      if (!GeometryToolbox::IntersectTwoPlanes(p, d,
-                                               slice.GetOrigin(), slice.GetNormal(),
-                                               viewportSlice.GetOrigin(), viewportSlice.GetNormal()))
+      if (!OrthancStone::GeometryToolbox::IntersectTwoPlanes(p, d,
+                                                             slice.GetOrigin(), slice.GetNormal(),
+                                                             viewportSlice.GetOrigin(), viewportSlice.GetNormal()))
       {
         // The two slice are parallel, don't try and display the intersection
         BroadcastMessage(IVolumeSlicer::LayerErrorMessage(*this, reference.GetGeometry()));
@@ -937,12 +937,12 @@
         viewportSlice.ProjectPoint(x1, y1, p);
         viewportSlice.ProjectPoint(x2, y2, p + 1000.0 * d);
 
-        const Extent2D extent = otherPlane_.GetSceneExtent();
+        const OrthancStone::Extent2D extent = otherPlane_.GetSceneExtent();
 
-        if (GeometryToolbox::ClipLineToRectangle(x1, y1, x2, y2,
-                                                 x1, y1, x2, y2,
-                                                 extent.GetX1(), extent.GetY1(),
-                                                 extent.GetX2(), extent.GetY2()))
+        if (OrthancStone::GeometryToolbox::ClipLineToRectangle(x1, y1, x2, y2,
+                                                               x1, y1, x2, y2,
+                                                               extent.GetX1(), extent.GetY1(),
+                                                               extent.GetX2(), extent.GetY2()))
         {
           RendererFactory factory(x1, y1, x2, y2, slice);
           BroadcastMessage(IVolumeSlicer::LayerReadyMessage(*this, factory, reference.GetGeometry()));