# HG changeset patch # User Alain Mazy # Date 1638446625 -3600 # Node ID f478b78e58f3c16de992f793c15d1433ba1f60e1 # Parent b83d2fc2fce18cb7f8419488b0ce1f9d7d7ac9b2# Parent 9154d738f5bf68976ab26381cf7f191393140797 merge diff -r b83d2fc2fce1 -r f478b78e58f3 CMakeLists.txt --- a/CMakeLists.txt Thu Dec 02 13:03:04 2021 +0100 +++ b/CMakeLists.txt Thu Dec 02 13:03:45 2021 +0100 @@ -27,7 +27,7 @@ set(ORTHANC_FRAMEWORK_DEFAULT_VERSION "mainline") set(ORTHANC_FRAMEWORK_DEFAULT_SOURCE "hg") else() - set(ORTHANC_FRAMEWORK_DEFAULT_VERSION "1.9.3") + set(ORTHANC_FRAMEWORK_DEFAULT_VERSION "1.9.7") set(ORTHANC_FRAMEWORK_DEFAULT_SOURCE "web") endif() diff -r b83d2fc2fce1 -r f478b78e58f3 NEWS --- a/NEWS Thu Dec 02 13:03:04 2021 +0100 +++ b/NEWS Thu Dec 02 13:03:45 2021 +0100 @@ -1,8 +1,12 @@ Pending changes in the mainline =============================== +* Show an error message when trying to send studies > 4GB via STOW-RS + +Version 1.7 (2021-08-31) +======================== + * Detection of windowing and rescale in ".../rendered" for Philips multiframe images -* Show an error message when trying to send studies > 4GB via STOW-RS Version 1.6 (2021-05-07) diff -r b83d2fc2fce1 -r f478b78e58f3 Plugin/WadoRsRetrieveRendered.cpp --- a/Plugin/WadoRsRetrieveRendered.cpp Thu Dec 02 13:03:04 2021 +0100 +++ b/Plugin/WadoRsRetrieveRendered.cpp Thu Dec 02 13:03:45 2021 +0100 @@ -26,13 +26,70 @@ #include #include #include -#include #include +#if ORTHANC_FRAMEWORK_VERSION_IS_ABOVE(1, 9, 7) +# include +#else +# include +#endif + #include #include +static bool ParseFloat(float& target, + const std::string& source) +{ +#if ORTHANC_FRAMEWORK_VERSION_IS_ABOVE(1, 9, 7) + return Orthanc::SerializationToolbox::ParseFloat(target, source); + +#else + // Emulation for older versions of the Orthanc framework + std::string s = Orthanc::Toolbox::StripSpaces(source); + + if (s.empty()) + { + return false; + } + else + { + try + { + target = boost::lexical_cast(s); + return true; + } + catch (boost::bad_lexical_cast&) + { + return false; + } + } +#endif +} + + +static bool ParseFirstFloat(float& target, + const std::string& source) +{ +#if ORTHANC_FRAMEWORK_VERSION_IS_ABOVE(1, 9, 7) + return Orthanc::SerializationToolbox::ParseFirstFloat(target, source); + +#else + // Emulation for older versions of the Orthanc framework + std::vector tokens; + Orthanc::Toolbox::TokenizeString(tokens, source, '\\'); + if (tokens.empty()) + { + return false; + } + else + { + return ParseFloat(target, tokens[0]); + } +#endif +} + + namespace { enum WindowingMode @@ -722,8 +779,8 @@ { float s, i; - if (Orthanc::SerializationToolbox::ParseFloat(s, tags[RESCALE_SLOPE].asString()) && - Orthanc::SerializationToolbox::ParseFloat(i, tags[RESCALE_INTERCEPT].asString())) + if (ParseFloat(s, tags[RESCALE_SLOPE].asString()) && + ParseFloat(i, tags[RESCALE_INTERCEPT].asString())) { parameters.SetRescaleSlope(s); parameters.SetRescaleIntercept(i); @@ -749,8 +806,8 @@ { float wc, ww; - if (Orthanc::SerializationToolbox::ParseFirstFloat(wc, tags[WINDOW_CENTER].asString()) && - Orthanc::SerializationToolbox::ParseFirstFloat(ww, tags[WINDOW_WIDTH].asString())) + if (ParseFirstFloat(wc, tags[WINDOW_CENTER].asString()) && + ParseFirstFloat(ww, tags[WINDOW_WIDTH].asString())) { parameters.SetWindow(wc, ww); return true; diff -r b83d2fc2fce1 -r f478b78e58f3 Resources/Orthanc/CMake/DownloadOrthancFramework.cmake --- a/Resources/Orthanc/CMake/DownloadOrthancFramework.cmake Thu Dec 02 13:03:04 2021 +0100 +++ b/Resources/Orthanc/CMake/DownloadOrthancFramework.cmake Thu Dec 02 13:03:45 2021 +0100 @@ -130,6 +130,14 @@ set(ORTHANC_FRAMEWORK_MD5 "3ea66c09f64aca990016683b6375734e") elseif (ORTHANC_FRAMEWORK_VERSION STREQUAL "1.9.3") set(ORTHANC_FRAMEWORK_MD5 "9b86e6f00e03278293cd15643cc0233f") + elseif (ORTHANC_FRAMEWORK_VERSION STREQUAL "1.9.4") + set(ORTHANC_FRAMEWORK_MD5 "6d5ca4a73ac7d42445041ca79de1624d") + elseif (ORTHANC_FRAMEWORK_VERSION STREQUAL "1.9.5") + set(ORTHANC_FRAMEWORK_MD5 "10fc64de1254a095e5d3ed3931f0cfbb") + elseif (ORTHANC_FRAMEWORK_VERSION STREQUAL "1.9.6") + set(ORTHANC_FRAMEWORK_MD5 "4b5d05683d747c29b2860ad79d11e62e") + elseif (ORTHANC_FRAMEWORK_VERSION STREQUAL "1.9.7") + set(ORTHANC_FRAMEWORK_MD5 "c912bbb860d640d3ae3003b5c9698205") # Below this point are development snapshots that were used to # release some plugin, before an official release of the Orthanc