# HG changeset patch # User Sebastien Jodogne # Date 1729083482 -7200 # Node ID 196d0e18afa05f2045caf5b0aeda522a6a060ec1 # Parent 9ce06c06c984f197269a710c1085c3ab7ef243d4 sync diff -r 9ce06c06c984 -r 196d0e18afa0 Applications/CMakeLists.txt --- 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} diff -r 9ce06c06c984 -r 196d0e18afa0 Resources/Orthanc/CMake/Compiler.cmake --- 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 ) diff -r 9ce06c06c984 -r 196d0e18afa0 Resources/Orthanc/CMake/DownloadOrthancFramework.cmake --- 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 diff -r 9ce06c06c984 -r 196d0e18afa0 Resources/Orthanc/Stone/DicomDatasetReader.cpp --- 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 diff -r 9ce06c06c984 -r 196d0e18afa0 Resources/Orthanc/Stone/DicomDatasetReader.h --- 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 diff -r 9ce06c06c984 -r 196d0e18afa0 Resources/Orthanc/Stone/FullOrthancDataset.cpp --- 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 diff -r 9ce06c06c984 -r 196d0e18afa0 Resources/Orthanc/Stone/FullOrthancDataset.h --- 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 diff -r 9ce06c06c984 -r 196d0e18afa0 Resources/Orthanc/Stone/IDicomDataset.h --- 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 diff -r 9ce06c06c984 -r 196d0e18afa0 Resources/Orthanc/Stone/IOrthancConnection.cpp --- 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 diff -r 9ce06c06c984 -r 196d0e18afa0 Resources/Orthanc/Stone/IOrthancConnection.h --- 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 diff -r 9ce06c06c984 -r 196d0e18afa0 Resources/Orthanc/Stone/OrthancHttpConnection.cpp --- 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); } } diff -r 9ce06c06c984 -r 196d0e18afa0 Resources/Orthanc/Stone/OrthancHttpConnection.h --- 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 diff -r 9ce06c06c984 -r 196d0e18afa0 Resources/Orthanc/StoneToolbox.cpp --- /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 + * . + **/ + + +#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); + } + } +} diff -r 9ce06c06c984 -r 196d0e18afa0 Resources/Orthanc/StoneToolbox.h --- /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 + * . + **/ + + +#pragma once + +#include + +namespace OrthancStone +{ + namespace StoneToolbox + { + std::string JoinUrl(const std::string& base, + const std::string& path); + } +} diff -r 9ce06c06c984 -r 196d0e18afa0 Resources/SyncOrthancFolder.py --- 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'), diff -r 9ce06c06c984 -r 196d0e18afa0 ViewerPlugin/CMakeLists.txt --- 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 )