diff OrthancStone/Sources/Volumes/ImageBuffer3D.cpp @ 1564:e731e62692a9

upgrading Orthanc framework
author Sebastien Jodogne <s.jodogne@gmail.com>
date Thu, 17 Sep 2020 15:18:21 +0200
parents 244ad1e4e76a
children 8563ea5d8ae4
line wrap: on
line diff
--- a/OrthancStone/Sources/Volumes/ImageBuffer3D.cpp	Fri Aug 21 21:57:54 2020 +0200
+++ b/OrthancStone/Sources/Volumes/ImageBuffer3D.cpp	Thu Sep 17 15:18:21 2020 +0200
@@ -31,7 +31,7 @@
 {
   void ImageBuffer3D::GetAxialSliceAccessor(Orthanc::ImageAccessor& target,
                                             unsigned int slice,
-                                            bool readOnly) const
+                                            bool readOnly)
   {
     if (slice >= depth_)
     {
@@ -53,7 +53,7 @@
 
   void ImageBuffer3D::GetCoronalSliceAccessor(Orthanc::ImageAccessor& target,
                                               unsigned int slice,
-                                              bool readOnly) const
+                                              bool readOnly)
   {
     if (slice >= height_)
     {
@@ -203,14 +203,20 @@
                                           VolumeProjection projection,
                                           unsigned int slice)
   {
+    /**
+     * NB: The "const_cast" below are OK, as the "readonly" argument
+     * to "GetAxialSliceAccessor()" and "GetCoronalSliceAccessor()"
+     * are set to "true", which implies read-only access.
+     **/
+    
     switch (projection)
     {
       case VolumeProjection_Axial:
-        that.GetAxialSliceAccessor(accessor_, slice, true);
+        const_cast<ImageBuffer3D&>(that).GetAxialSliceAccessor(accessor_, slice, true);
         break;
 
       case VolumeProjection_Coronal:
-        that.GetCoronalSliceAccessor(accessor_, slice, true);
+        const_cast<ImageBuffer3D&>(that).GetCoronalSliceAccessor(accessor_, slice, true);
         break;
 
       case VolumeProjection_Sagittal: