changeset 320:196d0e18afa0

sync
author Sebastien Jodogne <s.jodogne@gmail.com>
date Wed, 16 Oct 2024 14:58:02 +0200
parents 9ce06c06c984
children 0c34b6625c67
files Applications/CMakeLists.txt Resources/Orthanc/CMake/Compiler.cmake Resources/Orthanc/CMake/DownloadOrthancFramework.cmake Resources/Orthanc/Stone/DicomDatasetReader.cpp Resources/Orthanc/Stone/DicomDatasetReader.h Resources/Orthanc/Stone/FullOrthancDataset.cpp Resources/Orthanc/Stone/FullOrthancDataset.h Resources/Orthanc/Stone/IDicomDataset.h Resources/Orthanc/Stone/IOrthancConnection.cpp Resources/Orthanc/Stone/IOrthancConnection.h Resources/Orthanc/Stone/OrthancHttpConnection.cpp Resources/Orthanc/Stone/OrthancHttpConnection.h Resources/Orthanc/StoneToolbox.cpp Resources/Orthanc/StoneToolbox.h Resources/SyncOrthancFolder.py ViewerPlugin/CMakeLists.txt
diffstat 16 files changed, 101 insertions(+), 13 deletions(-) [+]
line wrap: on
line diff
--- a/Applications/CMakeLists.txt	Fri Sep 13 17:59:54 2024 +0200
+++ b/Applications/CMakeLists.txt	Wed Oct 16 14:58:02 2024 +0200
@@ -194,6 +194,7 @@
   ${ORTHANC_WSI_DIR}/Resources/Orthanc/Stone/FullOrthancDataset.cpp
   ${ORTHANC_WSI_DIR}/Resources/Orthanc/Stone/IOrthancConnection.cpp
   ${ORTHANC_WSI_DIR}/Resources/Orthanc/Stone/OrthancHttpConnection.cpp
+  ${ORTHANC_WSI_DIR}/Resources/Orthanc/StoneToolbox.cpp
 
   # Mandatory components
   ${LIBTIFF_SOURCES}
--- a/Resources/Orthanc/CMake/Compiler.cmake	Fri Sep 13 17:59:54 2024 +0200
+++ b/Resources/Orthanc/CMake/Compiler.cmake	Wed Oct 16 14:58:02 2024 +0200
@@ -232,6 +232,10 @@
   endif()
 
 elseif (${CMAKE_SYSTEM_NAME} STREQUAL "Darwin")
+
+  # fix this error that appears with recent compilers on MacOS: boost/mpl/aux_/integral_wrapper.hpp:73:31: error: integer value -1 is outside the valid range of values [0, 3] for this enumeration type [-Wenum-constexpr-conversion]
+  SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-enum-constexpr-conversion")
+
   add_definitions(
     -D_XOPEN_SOURCE=1
     )
--- a/Resources/Orthanc/CMake/DownloadOrthancFramework.cmake	Fri Sep 13 17:59:54 2024 +0200
+++ b/Resources/Orthanc/CMake/DownloadOrthancFramework.cmake	Wed Oct 16 14:58:02 2024 +0200
@@ -163,6 +163,8 @@
         set(ORTHANC_FRAMEWORK_MD5 "d2476b9e796e339ac320b5333489bdb3")
       elseif (ORTHANC_FRAMEWORK_VERSION STREQUAL "1.12.3")
         set(ORTHANC_FRAMEWORK_MD5 "975f5bf2142c22cb1777b4f6a0a614c5")
+      elseif (ORTHANC_FRAMEWORK_VERSION STREQUAL "1.12.4")
+        set(ORTHANC_FRAMEWORK_MD5 "1e61779ea4a7cd705720bdcfed8a6a73")
 
       # Below this point are development snapshots that were used to
       # release some plugin, before an official release of the Orthanc
--- a/Resources/Orthanc/Stone/DicomDatasetReader.cpp	Fri Sep 13 17:59:54 2024 +0200
+++ b/Resources/Orthanc/Stone/DicomDatasetReader.cpp	Wed Oct 16 14:58:02 2024 +0200
@@ -3,7 +3,6 @@
  * Copyright (C) 2012-2016 Sebastien Jodogne, Medical Physics
  * Department, University Hospital of Liege, Belgium
  * Copyright (C) 2017-2023 Osimis S.A., Belgium
- * Copyright (C) 2024-2024 Orthanc Team SRL, Belgium
  * Copyright (C) 2021-2024 Sebastien Jodogne, ICTEAM UCLouvain, Belgium
  *
  * This program is free software: you can redistribute it and/or
--- a/Resources/Orthanc/Stone/DicomDatasetReader.h	Fri Sep 13 17:59:54 2024 +0200
+++ b/Resources/Orthanc/Stone/DicomDatasetReader.h	Wed Oct 16 14:58:02 2024 +0200
@@ -3,7 +3,6 @@
  * Copyright (C) 2012-2016 Sebastien Jodogne, Medical Physics
  * Department, University Hospital of Liege, Belgium
  * Copyright (C) 2017-2023 Osimis S.A., Belgium
- * Copyright (C) 2024-2024 Orthanc Team SRL, Belgium
  * Copyright (C) 2021-2024 Sebastien Jodogne, ICTEAM UCLouvain, Belgium
  *
  * This program is free software: you can redistribute it and/or
--- a/Resources/Orthanc/Stone/FullOrthancDataset.cpp	Fri Sep 13 17:59:54 2024 +0200
+++ b/Resources/Orthanc/Stone/FullOrthancDataset.cpp	Wed Oct 16 14:58:02 2024 +0200
@@ -3,7 +3,6 @@
  * Copyright (C) 2012-2016 Sebastien Jodogne, Medical Physics
  * Department, University Hospital of Liege, Belgium
  * Copyright (C) 2017-2023 Osimis S.A., Belgium
- * Copyright (C) 2024-2024 Orthanc Team SRL, Belgium
  * Copyright (C) 2021-2024 Sebastien Jodogne, ICTEAM UCLouvain, Belgium
  *
  * This program is free software: you can redistribute it and/or
--- a/Resources/Orthanc/Stone/FullOrthancDataset.h	Fri Sep 13 17:59:54 2024 +0200
+++ b/Resources/Orthanc/Stone/FullOrthancDataset.h	Wed Oct 16 14:58:02 2024 +0200
@@ -3,7 +3,6 @@
  * Copyright (C) 2012-2016 Sebastien Jodogne, Medical Physics
  * Department, University Hospital of Liege, Belgium
  * Copyright (C) 2017-2023 Osimis S.A., Belgium
- * Copyright (C) 2024-2024 Orthanc Team SRL, Belgium
  * Copyright (C) 2021-2024 Sebastien Jodogne, ICTEAM UCLouvain, Belgium
  *
  * This program is free software: you can redistribute it and/or
--- a/Resources/Orthanc/Stone/IDicomDataset.h	Fri Sep 13 17:59:54 2024 +0200
+++ b/Resources/Orthanc/Stone/IDicomDataset.h	Wed Oct 16 14:58:02 2024 +0200
@@ -3,7 +3,6 @@
  * Copyright (C) 2012-2016 Sebastien Jodogne, Medical Physics
  * Department, University Hospital of Liege, Belgium
  * Copyright (C) 2017-2023 Osimis S.A., Belgium
- * Copyright (C) 2024-2024 Orthanc Team SRL, Belgium
  * Copyright (C) 2021-2024 Sebastien Jodogne, ICTEAM UCLouvain, Belgium
  *
  * This program is free software: you can redistribute it and/or
--- a/Resources/Orthanc/Stone/IOrthancConnection.cpp	Fri Sep 13 17:59:54 2024 +0200
+++ b/Resources/Orthanc/Stone/IOrthancConnection.cpp	Wed Oct 16 14:58:02 2024 +0200
@@ -3,7 +3,6 @@
  * Copyright (C) 2012-2016 Sebastien Jodogne, Medical Physics
  * Department, University Hospital of Liege, Belgium
  * Copyright (C) 2017-2023 Osimis S.A., Belgium
- * Copyright (C) 2024-2024 Orthanc Team SRL, Belgium
  * Copyright (C) 2021-2024 Sebastien Jodogne, ICTEAM UCLouvain, Belgium
  *
  * This program is free software: you can redistribute it and/or
--- a/Resources/Orthanc/Stone/IOrthancConnection.h	Fri Sep 13 17:59:54 2024 +0200
+++ b/Resources/Orthanc/Stone/IOrthancConnection.h	Wed Oct 16 14:58:02 2024 +0200
@@ -3,7 +3,6 @@
  * Copyright (C) 2012-2016 Sebastien Jodogne, Medical Physics
  * Department, University Hospital of Liege, Belgium
  * Copyright (C) 2017-2023 Osimis S.A., Belgium
- * Copyright (C) 2024-2024 Orthanc Team SRL, Belgium
  * Copyright (C) 2021-2024 Sebastien Jodogne, ICTEAM UCLouvain, Belgium
  *
  * This program is free software: you can redistribute it and/or
--- a/Resources/Orthanc/Stone/OrthancHttpConnection.cpp	Fri Sep 13 17:59:54 2024 +0200
+++ b/Resources/Orthanc/Stone/OrthancHttpConnection.cpp	Wed Oct 16 14:58:02 2024 +0200
@@ -3,7 +3,6 @@
  * Copyright (C) 2012-2016 Sebastien Jodogne, Medical Physics
  * Department, University Hospital of Liege, Belgium
  * Copyright (C) 2017-2023 Osimis S.A., Belgium
- * Copyright (C) 2024-2024 Orthanc Team SRL, Belgium
  * Copyright (C) 2021-2024 Sebastien Jodogne, ICTEAM UCLouvain, Belgium
  *
  * This program is free software: you can redistribute it and/or
@@ -24,6 +23,8 @@
 
 #include "OrthancHttpConnection.h"
 
+#include "../StoneToolbox.h"
+
 namespace OrthancStone
 {
   void OrthancHttpConnection::Setup()
@@ -55,7 +56,7 @@
     boost::mutex::scoped_lock lock(mutex_);
 
     client_.SetMethod(Orthanc::HttpMethod_Get);
-    client_.SetUrl(url_ + uri);
+    client_.SetUrl(StoneToolbox::JoinUrl(url_, uri));
     client_.ApplyAndThrowException(result);
   }
 
@@ -67,7 +68,7 @@
     boost::mutex::scoped_lock lock(mutex_);
 
     client_.SetMethod(Orthanc::HttpMethod_Post);
-    client_.SetUrl(url_ + uri);
+    client_.SetUrl(StoneToolbox::JoinUrl(url_, uri));
 
 #if defined(ORTHANC_FRAMEWORK_VERSION_IS_ABOVE) && ORTHANC_FRAMEWORK_VERSION_IS_ABOVE(1, 9, 3)
     client_.SetExternalBody(body);
@@ -87,7 +88,7 @@
     boost::mutex::scoped_lock lock(mutex_);
 
     client_.SetMethod(Orthanc::HttpMethod_Put);
-    client_.SetUrl(url_ + uri);
+    client_.SetUrl(StoneToolbox::JoinUrl(url_, uri));
 
 #if defined(ORTHANC_FRAMEWORK_VERSION_IS_ABOVE) && ORTHANC_FRAMEWORK_VERSION_IS_ABOVE(1, 9, 3)
     client_.SetExternalBody(body);
@@ -107,7 +108,7 @@
     std::string result;
 
     client_.SetMethod(Orthanc::HttpMethod_Delete);
-    client_.SetUrl(url_ + uri);
+    client_.SetUrl(StoneToolbox::JoinUrl(url_, uri));
     client_.ApplyAndThrowException(result);
   }
 }
--- a/Resources/Orthanc/Stone/OrthancHttpConnection.h	Fri Sep 13 17:59:54 2024 +0200
+++ b/Resources/Orthanc/Stone/OrthancHttpConnection.h	Wed Oct 16 14:58:02 2024 +0200
@@ -3,7 +3,6 @@
  * Copyright (C) 2012-2016 Sebastien Jodogne, Medical Physics
  * Department, University Hospital of Liege, Belgium
  * Copyright (C) 2017-2023 Osimis S.A., Belgium
- * Copyright (C) 2024-2024 Orthanc Team SRL, Belgium
  * Copyright (C) 2021-2024 Sebastien Jodogne, ICTEAM UCLouvain, Belgium
  *
  * This program is free software: you can redistribute it and/or
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Resources/Orthanc/StoneToolbox.cpp	Wed Oct 16 14:58:02 2024 +0200
@@ -0,0 +1,50 @@
+/**
+ * Stone of Orthanc
+ * Copyright (C) 2012-2016 Sebastien Jodogne, Medical Physics
+ * Department, University Hospital of Liege, Belgium
+ * Copyright (C) 2017-2023 Osimis S.A., Belgium
+ * Copyright (C) 2021-2024 Sebastien Jodogne, ICTEAM UCLouvain, Belgium
+ *
+ * This program is free software: you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public License
+ * as published by the Free Software Foundation, either version 3 of
+ * the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this program. If not, see
+ * <http://www.gnu.org/licenses/>.
+ **/
+
+
+#include "StoneToolbox.h"
+
+namespace OrthancStone
+{
+  namespace StoneToolbox
+  {
+    std::string JoinUrl(const std::string& base,
+                        const std::string& path)
+    {
+      size_t end = base.size();
+      while (end > 0 &&
+             base[end - 1] == '/')
+      {
+        end--;
+      }
+
+      size_t start = 0;
+      while (start < path.size() &&
+             path[start] == '/')
+      {
+        start++;
+      }
+
+      return base.substr(0, end) + "/" + path.substr(start);
+    }
+  }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Resources/Orthanc/StoneToolbox.h	Wed Oct 16 14:58:02 2024 +0200
@@ -0,0 +1,35 @@
+/**
+ * Stone of Orthanc
+ * Copyright (C) 2012-2016 Sebastien Jodogne, Medical Physics
+ * Department, University Hospital of Liege, Belgium
+ * Copyright (C) 2017-2023 Osimis S.A., Belgium
+ * Copyright (C) 2021-2024 Sebastien Jodogne, ICTEAM UCLouvain, Belgium
+ *
+ * This program is free software: you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public License
+ * as published by the Free Software Foundation, either version 3 of
+ * the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this program. If not, see
+ * <http://www.gnu.org/licenses/>.
+ **/
+
+
+#pragma once
+
+#include <string>
+
+namespace OrthancStone
+{
+  namespace StoneToolbox
+  {
+    std::string JoinUrl(const std::string& base,
+                        const std::string& path);
+  }
+}
--- a/Resources/SyncOrthancFolder.py	Fri Sep 13 17:59:54 2024 +0200
+++ b/Resources/SyncOrthancFolder.py	Wed Oct 16 14:58:02 2024 +0200
@@ -33,6 +33,8 @@
     ('orthanc', 'OrthancServer/Plugins/Samples/Common/OrthancPluginsExports.cmake', 'Plugins'),
     ('orthanc', 'OrthancServer/Plugins/Samples/Common/VersionScriptPlugins.map', 'Plugins'),
 
+    ('orthanc-stone', 'OrthancStone/Sources/Toolbox/StoneToolbox.cpp', '.'),
+    ('orthanc-stone', 'OrthancStone/Sources/Toolbox/StoneToolbox.h', '.'),
     ('orthanc-stone', 'OrthancStone/Sources/Toolbox/OrthancDatasets/DicomDatasetReader.cpp', 'Stone'),
     ('orthanc-stone', 'OrthancStone/Sources/Toolbox/OrthancDatasets/DicomDatasetReader.h', 'Stone'),
     ('orthanc-stone', 'OrthancStone/Sources/Toolbox/OrthancDatasets/FullOrthancDataset.cpp', 'Stone'),
--- a/ViewerPlugin/CMakeLists.txt	Fri Sep 13 17:59:54 2024 +0200
+++ b/ViewerPlugin/CMakeLists.txt	Wed Oct 16 14:58:02 2024 +0200
@@ -205,6 +205,7 @@
   ${ORTHANC_WSI_DIR}/Resources/Orthanc/Stone/DicomDatasetReader.cpp
   ${ORTHANC_WSI_DIR}/Resources/Orthanc/Stone/FullOrthancDataset.cpp
   ${ORTHANC_WSI_DIR}/Resources/Orthanc/Stone/IOrthancConnection.cpp
+  ${ORTHANC_WSI_DIR}/Resources/Orthanc/StoneToolbox.cpp
   )