changeset 1564:e731e62692a9

upgrading Orthanc framework
author Sebastien Jodogne <s.jodogne@gmail.com>
date Thu, 17 Sep 2020 15:18:21 +0200
parents e0045462a25c
children b8b4cb58a874
files Applications/StoneWebViewer/WebAssembly/StoneWebViewer.cpp OrthancStone/Sources/Loaders/SeriesFramesLoader.cpp OrthancStone/Sources/Loaders/SeriesThumbnailsLoader.cpp OrthancStone/Sources/OpenGL/OpenGLTexture.cpp OrthancStone/Sources/OpenGL/WebAssemblyOpenGLContext.h OrthancStone/Sources/Scene2D/ColorSceneLayer.h OrthancStone/Sources/Scene2DViewport/OneGesturePointerTracker.h OrthancStone/Sources/Toolbox/ParsedDicomDataset.h OrthancStone/Sources/Viewport/DefaultViewportInteractor.h OrthancStone/Sources/Volumes/ImageBuffer3D.cpp OrthancStone/Sources/Volumes/ImageBuffer3D.h
diffstat 11 files changed, 24 insertions(+), 18 deletions(-) [+]
line wrap: on
line diff
--- a/Applications/StoneWebViewer/WebAssembly/StoneWebViewer.cpp	Fri Aug 21 21:57:54 2020 +0200
+++ b/Applications/StoneWebViewer/WebAssembly/StoneWebViewer.cpp	Thu Sep 17 15:18:21 2020 +0200
@@ -1150,8 +1150,7 @@
         throw Orthanc::OrthancException(Orthanc::ErrorCode_InternalError);
       }      
       
-      std::unique_ptr<Orthanc::ImageAccessor> frame(
-        Orthanc::DicomImageDecoder::Decode(message.GetDicom(), frameIndex_));
+      std::unique_ptr<Orthanc::ImageAccessor> frame(message.GetDicom().DecodeFrame(frameIndex_));
 
       if (frame.get() == NULL)
       {
--- a/OrthancStone/Sources/Loaders/SeriesFramesLoader.cpp	Fri Aug 21 21:57:54 2020 +0200
+++ b/OrthancStone/Sources/Loaders/SeriesFramesLoader.cpp	Thu Sep 17 15:18:21 2020 +0200
@@ -25,7 +25,7 @@
 #include "../Oracle/ParseDicomFromWadoCommand.h"
 
 #if ORTHANC_ENABLE_DCMTK == 1
-#  include <DicomParsing/Internals/DicomImageDecoder.h>
+#  include <DicomParsing/ParsedDicomFile.h>
 #endif
 
 #include <DicomFormat/DicomInstanceHasher.h>
@@ -170,9 +170,7 @@
     size_t frameIndex = frames_.GetFrameIndex(payload.GetSeriesIndex());
 
     std::unique_ptr<Orthanc::ImageAccessor> decoded;
-    decoded.reset(Orthanc::DicomImageDecoder::Decode(
-      dicom, 
-      static_cast<unsigned int>(frameIndex)));
+    decoded.reset(dicom.DecodeFrame(static_cast<unsigned int>(frameIndex)));
 
     if (decoded.get() == NULL)
     {
--- a/OrthancStone/Sources/Loaders/SeriesThumbnailsLoader.cpp	Fri Aug 21 21:57:54 2020 +0200
+++ b/OrthancStone/Sources/Loaders/SeriesThumbnailsLoader.cpp	Thu Sep 17 15:18:21 2020 +0200
@@ -37,7 +37,6 @@
 
 #if ORTHANC_ENABLE_DCMTK == 1
 #  include <DicomParsing/ParsedDicomFile.h>
-#  include <DicomParsing/Internals/DicomImageDecoder.h>
 #endif 
 
 
@@ -555,8 +554,7 @@
     }
     else
     {
-      std::unique_ptr<Orthanc::ImageAccessor> frame(
-        Orthanc::DicomImageDecoder::Decode(message.GetDicom(), 0));
+      std::unique_ptr<Orthanc::ImageAccessor> frame(message.GetDicom().DecodeFrame(0));
 
       std::unique_ptr<Orthanc::ImageAccessor> thumbnail;
 
--- a/OrthancStone/Sources/OpenGL/OpenGLTexture.cpp	Fri Aug 21 21:57:54 2020 +0200
+++ b/OrthancStone/Sources/OpenGL/OpenGLTexture.cpp	Thu Sep 17 15:18:21 2020 +0200
@@ -126,7 +126,7 @@
 
         // Load the texture from the image buffer
         glTexImage2D(GL_TEXTURE_2D, 0, internalFormat, image.GetWidth(), image.GetHeight(),
-          0, sourceFormat, GL_UNSIGNED_BYTE, image.GetBuffer());
+                     0, sourceFormat, GL_UNSIGNED_BYTE, image.GetConstBuffer());
         glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, interpolation);
         glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, interpolation);
         glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE);
--- a/OrthancStone/Sources/OpenGL/WebAssemblyOpenGLContext.h	Fri Aug 21 21:57:54 2020 +0200
+++ b/OrthancStone/Sources/OpenGL/WebAssemblyOpenGLContext.h	Thu Sep 17 15:18:21 2020 +0200
@@ -39,7 +39,7 @@
 
 #include "IOpenGLContext.h"
 
-#include <Enumerations.h>
+#include <Compatibility.h>  // For ORTHANC_OVERRIDE
 
 #include <boost/shared_ptr.hpp>
 
--- a/OrthancStone/Sources/Scene2D/ColorSceneLayer.h	Fri Aug 21 21:57:54 2020 +0200
+++ b/OrthancStone/Sources/Scene2D/ColorSceneLayer.h	Thu Sep 17 15:18:21 2020 +0200
@@ -24,7 +24,7 @@
 #include "ISceneLayer.h"
 #include "Color.h"
 
-#include <Enumerations.h>  // For ORTHANC_OVERRIDE
+#include <Compatibility.h>  // For ORTHANC_OVERRIDE
 
 namespace OrthancStone
 {
--- a/OrthancStone/Sources/Scene2DViewport/OneGesturePointerTracker.h	Fri Aug 21 21:57:54 2020 +0200
+++ b/OrthancStone/Sources/Scene2DViewport/OneGesturePointerTracker.h	Thu Sep 17 15:18:21 2020 +0200
@@ -24,6 +24,8 @@
 
 #include "../Viewport/IViewport.h"
 
+#include <Compatibility.h>  // For ORTHANC_OVERRIDE
+
 #include <boost/shared_ptr.hpp>
 #include <boost/weak_ptr.hpp>
 
--- a/OrthancStone/Sources/Toolbox/ParsedDicomDataset.h	Fri Aug 21 21:57:54 2020 +0200
+++ b/OrthancStone/Sources/Toolbox/ParsedDicomDataset.h	Thu Sep 17 15:18:21 2020 +0200
@@ -23,6 +23,7 @@
 
 #include "OrthancDatasets/IDicomDataset.h"
 
+#include <Compatibility.h>  // For ORTHANC_OVERRIDE
 #include <DicomParsing/ParsedDicomFile.h>
 
 namespace OrthancStone
--- a/OrthancStone/Sources/Viewport/DefaultViewportInteractor.h	Fri Aug 21 21:57:54 2020 +0200
+++ b/OrthancStone/Sources/Viewport/DefaultViewportInteractor.h	Thu Sep 17 15:18:21 2020 +0200
@@ -22,6 +22,8 @@
 
 #include "IViewportInteractor.h"
 
+#include <Compatibility.h>  // For ORTHANC_OVERRIDE
+
 namespace OrthancStone
 {
   class DefaultViewportInteractor : public IViewportInteractor
--- 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:
--- a/OrthancStone/Sources/Volumes/ImageBuffer3D.h	Fri Aug 21 21:57:54 2020 +0200
+++ b/OrthancStone/Sources/Volumes/ImageBuffer3D.h	Thu Sep 17 15:18:21 2020 +0200
@@ -86,11 +86,11 @@
 
     void GetAxialSliceAccessor(Orthanc::ImageAccessor& target,
                                unsigned int slice,
-                               bool readOnly) const;
+                               bool readOnly);
     
     void GetCoronalSliceAccessor(Orthanc::ImageAccessor& target,
                                  unsigned int slice,
-                                 bool readOnly) const;
+                                 bool readOnly);
 
     Orthanc::Image*  ExtractSagittalSlice(unsigned int slice) const;