Hello community,
here is the log from the commit of package orthanc-webviewer for
openSUSE:Factory checked in at 2020-06-02 14:34:35
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/orthanc-webviewer (Old)
and /work/SRC/openSUSE:Factory/.orthanc-webviewer.new.3606 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "orthanc-webviewer"
Tue Jun 2 14:34:35 2020 rev:3 rq:809646 version:2.6
Changes:
--------
--- /work/SRC/openSUSE:Factory/orthanc-webviewer/orthanc-webviewer.changes
2020-04-22 20:51:06.163170271 +0200
+++
/work/SRC/openSUSE:Factory/.orthanc-webviewer.new.3606/orthanc-webviewer.changes
2020-06-02 14:34:43.626778820 +0200
@@ -1,0 +2,16 @@
+Wed May 27 15:10:14 UTC 2020 - Axel Braun <[email protected]>
+
+- version 2.6
+* cachemngr.diff removed
+* DecodedImageAdapter.cpp removed
+* Move the GDCM decoder out of the Orthanc Web viewer plugin as a
+ separate plugin: https://book.orthanc-server.com/plugins/gdcm.html
+* Performance: Replaced "OrthancPluginRegisterRestCallback" by
+ "OrthancPluginRegisterRestCallbackNoLock"
+* Authorization tokens passed as url search params in Orthanc Explorer
+ are now transmitted to the viewer and included as headers in every
+ HTTP request to the Rest API easing the usage of the Authorization
+ plugin
+* Upgrade to Orthanc framework to 1.7.0
+
+-------------------------------------------------------------------
Old:
----
DecodedImageAdapter.cpp
OrthancWebViewer-2.5.tar.gz
cachemngr.diff
New:
----
OrthancWebViewer-2.6.tar.gz
_service
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Other differences:
------------------
++++++ orthanc-webviewer.spec ++++++
--- /var/tmp/diff_new_pack.4k2BD1/_old 2020-06-02 14:34:44.722782288 +0200
+++ /var/tmp/diff_new_pack.4k2BD1/_new 2020-06-02 14:34:44.726782301 +0200
@@ -2,7 +2,7 @@
# spec file for package orthanc-webviewer
#
# Copyright (c) 2020 SUSE LLC
-# Copyright (c) 2019 Dr. Axel Braun
+# Copyright (c) 2019-2020 Dr. Axel Braun
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
@@ -21,7 +21,7 @@
Summary: Web Viewer plugin for Orthanc
License: AGPL-3.0-or-later
Group: Productivity/Graphics/Viewers
-Version: 2.5
+Version: 2.6
Release: 0
URL: https://orthanc-server.com
Source0:
https://www.orthanc-server.com/downloads/get.php?path=/plugin-webviewer/OrthancWebViewer-%{version}.tar.gz
@@ -30,14 +30,10 @@
Source3: jsPanel-2.3.3-fixed.zip
Source4: pako-0.2.5.zip
Source5: js-url-1.8.6.zip
-Source6: DecodedImageAdapter.cpp
Source11: orthanc-webviewer-readme.SUSE
Source12: webviewer.json
-Patch0: cachemngr.diff
BuildRequires: cmake
BuildRequires: gcc-c++
-BuildRequires: gdcm-devel
-BuildRequires: gdcm-libgdcm3_0
BuildRequires: googletest-devel
BuildRequires: jsoncpp-devel
BuildRequires: libboost_date_time-devel >= 1.66
@@ -48,6 +44,7 @@
BuildRequires: libboost_thread-devel >= 1.66
BuildRequires: libuuid-devel
BuildRequires: orthanc-devel
+BuildRequires: orthanc-gdcm
BuildRequires: orthanc-source
BuildRequires: sqlite3-devel
BuildRequires: unzip
@@ -62,10 +59,6 @@
%prep
%setup -q -n OrthancWebViewer-%{version}
-cp %{S:6} Plugin/.
-
-%patch0 -p1
-
#OrthanPlugin may ask for additional files to be loaded
#Putting them into this folder prevents download of sources from the web
mkdir ThirdPartyDownloads
++++++ OrthancWebViewer-2.5.tar.gz -> OrthancWebViewer-2.6.tar.gz ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/OrthancWebViewer-2.5/.hg_archival.txt
new/OrthancWebViewer-2.6/.hg_archival.txt
--- old/OrthancWebViewer-2.5/.hg_archival.txt 2019-02-27 17:20:45.000000000
+0100
+++ new/OrthancWebViewer-2.6/.hg_archival.txt 2020-05-26 09:12:07.000000000
+0200
@@ -1,6 +1,6 @@
repo: 02f7a0400a911dee22d2e761b21b6cab67ede076
-node: 0a8ed9da08696903df46390e537ffb8e017a1531
-branch: OrthancWebViewer-2.5
+node: 8b01b05e2feec9fc26cec50466c357dfe3b3c428
+branch: OrthancWebViewer-2.6
latesttag: null
-latesttagdistance: 211
-changessincelatesttag: 215
+latesttagdistance: 238
+changessincelatesttag: 246
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/OrthancWebViewer-2.5/CMakeLists.txt
new/OrthancWebViewer-2.6/CMakeLists.txt
--- old/OrthancWebViewer-2.5/CMakeLists.txt 2019-02-27 17:20:45.000000000
+0100
+++ new/OrthancWebViewer-2.6/CMakeLists.txt 2020-05-26 09:12:07.000000000
+0200
@@ -1,7 +1,7 @@
# Orthanc - A Lightweight, RESTful DICOM Store
# Copyright (C) 2012-2016 Sebastien Jodogne, Medical Physics
# Department, University Hospital of Liege, Belgium
-# Copyright (C) 2017-2019 Osimis S.A., Belgium
+# Copyright (C) 2017-2020 Osimis S.A., Belgium
#
# This program is free software: you can redistribute it and/or
# modify it under the terms of the GNU Affero General Public License
@@ -21,13 +21,13 @@
project(OrthancWebViewer)
-set(ORTHANC_PLUGIN_VERSION "2.5")
+set(ORTHANC_PLUGIN_VERSION "2.6")
if (ORTHANC_PLUGIN_VERSION STREQUAL "mainline")
- set(ORTHANC_FRAMEWORK_VERSION "mainline")
+ set(ORTHANC_FRAMEWORK_DEFAULT_VERSION "mainline")
set(ORTHANC_FRAMEWORK_DEFAULT_SOURCE "hg")
else()
- set(ORTHANC_FRAMEWORK_VERSION "1.5.5")
+ set(ORTHANC_FRAMEWORK_DEFAULT_VERSION "1.7.0")
set(ORTHANC_FRAMEWORK_DEFAULT_SOURCE "web")
endif()
@@ -36,12 +36,12 @@
set(STATIC_BUILD OFF CACHE BOOL "Static build of the third-party libraries
(necessary for Windows)")
set(STANDALONE_BUILD ON CACHE BOOL "Standalone build (all the resources are
embedded, necessary for releases)")
set(ALLOW_DOWNLOADS OFF CACHE BOOL "Allow CMake to download packages")
-set(ORTHANC_FRAMEWORK_SOURCE "${ORTHANC_FRAMEWORK_DEFAULT_SOURCE}" CACHE
STRING "Source of the Orthanc source code (can be \"hg\", \"archive\", \"web\"
or \"path\")")
+set(ORTHANC_FRAMEWORK_SOURCE "${ORTHANC_FRAMEWORK_DEFAULT_SOURCE}" CACHE
STRING "Source of the Orthanc framework (can be \"hg\", \"archive\", \"web\" or
\"path\")")
+set(ORTHANC_FRAMEWORK_VERSION "${ORTHANC_FRAMEWORK_DEFAULT_VERSION}" CACHE
STRING "Version of the Orthanc framework")
set(ORTHANC_FRAMEWORK_ARCHIVE "" CACHE STRING "Path to the Orthanc archive, if
ORTHANC_FRAMEWORK_SOURCE is \"archive\"")
set(ORTHANC_FRAMEWORK_ROOT "" CACHE STRING "Path to the Orthanc source
directory, if ORTHANC_FRAMEWORK_SOURCE is \"path\"")
# Advanced parameters to fine-tune linking against system libraries
-set(USE_SYSTEM_GDCM ON CACHE BOOL "Use the system version of Grassroot DICOM
(GDCM)")
set(USE_SYSTEM_ORTHANC_SDK ON CACHE BOOL "Use the system version of the
Orthanc plugin SDK")
@@ -54,12 +54,13 @@
set(ENABLE_LOCALE OFF) # Disable support for locales (notably in Boost)
set(ENABLE_GOOGLE_TEST ON)
set(ENABLE_SQLITE ON)
+set(ENABLE_MODULE_JOBS OFF CACHE INTERNAL "")
+set(ENABLE_MODULE_DICOM OFF CACHE INTERNAL "")
include(${ORTHANC_ROOT}/Resources/CMake/OrthancFrameworkConfiguration.cmake)
include_directories(${ORTHANC_ROOT})
-include(${CMAKE_SOURCE_DIR}/Resources/CMake/GdcmConfiguration.cmake)
include(${CMAKE_SOURCE_DIR}/Resources/CMake/JavaScriptLibraries.cmake)
@@ -90,6 +91,7 @@
add_definitions(
-DORTHANC_ENABLE_LOGGING_PLUGIN=1
+ -DHAS_ORTHANC_EXCEPTION=1
)
EmbedResources(
@@ -120,11 +122,6 @@
list(APPEND AUTOGENERATED_SOURCES ${AUTOGENERATED_DIR}/Version.rc)
endif()
-if (APPLE)
- SET(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -framework
CoreFoundation")
- SET(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -framework
CoreFoundation")
-endif()
-
set(CORE_SOURCES
${CMAKE_SOURCE_DIR}/Plugin/Cache/CacheManager.cpp
@@ -138,24 +135,14 @@
add_library(OrthancWebViewer
SHARED
- ${CORE_SOURCES}
${AUTOGENERATED_SOURCES}
- ${CMAKE_SOURCE_DIR}/Plugin/Plugin.cpp
-
- # The following files depend on GDCM
${CMAKE_SOURCE_DIR}/Plugin/DecodedImageAdapter.cpp
- ${ORTHANC_ROOT}/Plugins/Samples/GdcmDecoder/GdcmImageDecoder.cpp
- ${ORTHANC_ROOT}/Plugins/Samples/GdcmDecoder/GdcmDecoderCache.cpp
- ${ORTHANC_ROOT}/Plugins/Samples/GdcmDecoder/OrthancImageWrapper.cpp
+ ${CMAKE_SOURCE_DIR}/Plugin/Plugin.cpp
+ ${CORE_SOURCES}
+ ${ORTHANC_ROOT}/Plugins/Samples/Common/OrthancPluginCppWrapper.cpp
)
-if (STATIC_BUILD OR NOT USE_SYSTEM_GDCM)
- add_dependencies(OrthancWebViewer GDCM)
-endif()
-
-target_link_libraries(OrthancWebViewer ${GDCM_LIBRARIES})
-
message("Setting the version of the library to ${ORTHANC_PLUGIN_VERSION}")
add_definitions(-DORTHANC_PLUGIN_VERSION="${ORTHANC_PLUGIN_VERSION}")
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/OrthancWebViewer-2.5/NEWS
new/OrthancWebViewer-2.6/NEWS
--- old/OrthancWebViewer-2.5/NEWS 2019-02-27 17:20:45.000000000 +0100
+++ new/OrthancWebViewer-2.6/NEWS 2020-05-26 09:12:07.000000000 +0200
@@ -2,11 +2,25 @@
===============================
+Version 2.6 (2020-05-26)
+========================
+
+* Move the GDCM decoder out of the Orthanc Web viewer plugin as a
+ separate plugin: https://book.orthanc-server.com/plugins/gdcm.html
+* Performance: Replaced "OrthancPluginRegisterRestCallback" by
+ "OrthancPluginRegisterRestCallbackNoLock"
+* Authorization tokens passed as url search params in Orthanc Explorer
+ are now transmitted to the viewer and included as headers in every
+ HTTP request to the Rest API easing the usage of the Authorization
+ plugin
+* Upgrade to Orthanc framework to 1.7.0
+
+
Version 2.5 (2019-02-27)
========================
* Upgrade to GDCM 2.8.8 for static builds
-* Upgraded Orthanc framework
+* Upgrade to Orthanc framework to 1.5.5
Version 2.4 (2018-04-23)
@@ -18,7 +32,7 @@
* Support of rendering RGB48 lookup tables (palette), if Orthanc SDK >= 1.3.1
* Support of OpenBSD
* Support of Linux Standard Base
-* Resort to Orthanc framework
+* Resort to Orthanc framework 1.3.2
* Upgrade to GDCM 2.8.4 for static builds
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/OrthancWebViewer-2.5/Plugin/Cache/CacheIndex.h
new/OrthancWebViewer-2.6/Plugin/Cache/CacheIndex.h
--- old/OrthancWebViewer-2.5/Plugin/Cache/CacheIndex.h 2019-02-27
17:20:45.000000000 +0100
+++ new/OrthancWebViewer-2.6/Plugin/Cache/CacheIndex.h 2020-05-26
09:12:07.000000000 +0200
@@ -2,7 +2,7 @@
* Orthanc - A Lightweight, RESTful DICOM Store
* Copyright (C) 2012-2016 Sebastien Jodogne, Medical Physics
* Department, University Hospital of Liege, Belgium
- * Copyright (C) 2017-2019 Osimis S.A., Belgium
+ * Copyright (C) 2017-2020 Osimis S.A., Belgium
*
* This program is free software: you can redistribute it and/or
* modify it under the terms of the GNU Affero General Public License
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/OrthancWebViewer-2.5/Plugin/Cache/CacheManager.cpp
new/OrthancWebViewer-2.6/Plugin/Cache/CacheManager.cpp
--- old/OrthancWebViewer-2.5/Plugin/Cache/CacheManager.cpp 2019-02-27
17:20:45.000000000 +0100
+++ new/OrthancWebViewer-2.6/Plugin/Cache/CacheManager.cpp 2020-05-26
09:12:07.000000000 +0200
@@ -2,7 +2,7 @@
* Orthanc - A Lightweight, RESTful DICOM Store
* Copyright (C) 2012-2016 Sebastien Jodogne, Medical Physics
* Department, University Hospital of Liege, Belgium
- * Copyright (C) 2017-2019 Osimis S.A., Belgium
+ * Copyright (C) 2017-2020 Osimis S.A., Belgium
*
* This program is free software: you can redistribute it and/or
* modify it under the terms of the GNU Affero General Public License
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/OrthancWebViewer-2.5/Plugin/Cache/CacheManager.h
new/OrthancWebViewer-2.6/Plugin/Cache/CacheManager.h
--- old/OrthancWebViewer-2.5/Plugin/Cache/CacheManager.h 2019-02-27
17:20:45.000000000 +0100
+++ new/OrthancWebViewer-2.6/Plugin/Cache/CacheManager.h 2020-05-26
09:12:07.000000000 +0200
@@ -2,7 +2,7 @@
* Orthanc - A Lightweight, RESTful DICOM Store
* Copyright (C) 2012-2016 Sebastien Jodogne, Medical Physics
* Department, University Hospital of Liege, Belgium
- * Copyright (C) 2017-2019 Osimis S.A., Belgium
+ * Copyright (C) 2017-2020 Osimis S.A., Belgium
*
* This program is free software: you can redistribute it and/or
* modify it under the terms of the GNU Affero General Public License
@@ -26,6 +26,8 @@
#include <orthanc/OrthancCPlugin.h>
+#include <boost/shared_ptr.hpp>
+
namespace OrthancPlugins
{
enum CacheProperty
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/OrthancWebViewer-2.5/Plugin/Cache/CacheScheduler.cpp
new/OrthancWebViewer-2.6/Plugin/Cache/CacheScheduler.cpp
--- old/OrthancWebViewer-2.5/Plugin/Cache/CacheScheduler.cpp 2019-02-27
17:20:45.000000000 +0100
+++ new/OrthancWebViewer-2.6/Plugin/Cache/CacheScheduler.cpp 2020-05-26
09:12:07.000000000 +0200
@@ -2,7 +2,7 @@
* Orthanc - A Lightweight, RESTful DICOM Store
* Copyright (C) 2012-2016 Sebastien Jodogne, Medical Physics
* Department, University Hospital of Liege, Belgium
- * Copyright (C) 2017-2019 Osimis S.A., Belgium
+ * Copyright (C) 2017-2020 Osimis S.A., Belgium
*
* This program is free software: you can redistribute it and/or
* modify it under the terms of the GNU Affero General Public License
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/OrthancWebViewer-2.5/Plugin/Cache/CacheScheduler.h
new/OrthancWebViewer-2.6/Plugin/Cache/CacheScheduler.h
--- old/OrthancWebViewer-2.5/Plugin/Cache/CacheScheduler.h 2019-02-27
17:20:45.000000000 +0100
+++ new/OrthancWebViewer-2.6/Plugin/Cache/CacheScheduler.h 2020-05-26
09:12:07.000000000 +0200
@@ -2,7 +2,7 @@
* Orthanc - A Lightweight, RESTful DICOM Store
* Copyright (C) 2012-2016 Sebastien Jodogne, Medical Physics
* Department, University Hospital of Liege, Belgium
- * Copyright (C) 2017-2019 Osimis S.A., Belgium
+ * Copyright (C) 2017-2020 Osimis S.A., Belgium
*
* This program is free software: you can redistribute it and/or
* modify it under the terms of the GNU Affero General Public License
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/OrthancWebViewer-2.5/Plugin/Cache/ICacheFactory.h
new/OrthancWebViewer-2.6/Plugin/Cache/ICacheFactory.h
--- old/OrthancWebViewer-2.5/Plugin/Cache/ICacheFactory.h 2019-02-27
17:20:45.000000000 +0100
+++ new/OrthancWebViewer-2.6/Plugin/Cache/ICacheFactory.h 2020-05-26
09:12:07.000000000 +0200
@@ -2,7 +2,7 @@
* Orthanc - A Lightweight, RESTful DICOM Store
* Copyright (C) 2012-2016 Sebastien Jodogne, Medical Physics
* Department, University Hospital of Liege, Belgium
- * Copyright (C) 2017-2019 Osimis S.A., Belgium
+ * Copyright (C) 2017-2020 Osimis S.A., Belgium
*
* This program is free software: you can redistribute it and/or
* modify it under the terms of the GNU Affero General Public License
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/OrthancWebViewer-2.5/Plugin/Cache/IPrefetchPolicy.h
new/OrthancWebViewer-2.6/Plugin/Cache/IPrefetchPolicy.h
--- old/OrthancWebViewer-2.5/Plugin/Cache/IPrefetchPolicy.h 2019-02-27
17:20:45.000000000 +0100
+++ new/OrthancWebViewer-2.6/Plugin/Cache/IPrefetchPolicy.h 2020-05-26
09:12:07.000000000 +0200
@@ -2,7 +2,7 @@
* Orthanc - A Lightweight, RESTful DICOM Store
* Copyright (C) 2012-2016 Sebastien Jodogne, Medical Physics
* Department, University Hospital of Liege, Belgium
- * Copyright (C) 2017-2019 Osimis S.A., Belgium
+ * Copyright (C) 2017-2020 Osimis S.A., Belgium
*
* This program is free software: you can redistribute it and/or
* modify it under the terms of the GNU Affero General Public License
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/OrthancWebViewer-2.5/Plugin/DecodedImageAdapter.cpp
new/OrthancWebViewer-2.6/Plugin/DecodedImageAdapter.cpp
--- old/OrthancWebViewer-2.5/Plugin/DecodedImageAdapter.cpp 2019-02-27
17:20:45.000000000 +0100
+++ new/OrthancWebViewer-2.6/Plugin/DecodedImageAdapter.cpp 2020-05-26
09:12:07.000000000 +0200
@@ -2,7 +2,7 @@
* Orthanc - A Lightweight, RESTful DICOM Store
* Copyright (C) 2012-2016 Sebastien Jodogne, Medical Physics
* Department, University Hospital of Liege, Belgium
- * Copyright (C) 2017-2019 Osimis S.A., Belgium
+ * Copyright (C) 2017-2020 Osimis S.A., Belgium
*
* This program is free software: you can redistribute it and/or
* modify it under the terms of the GNU Affero General Public License
@@ -27,8 +27,6 @@
#include <Core/Images/ImageProcessing.h>
#include <Core/OrthancException.h>
#include <Core/Toolbox.h>
-#include <Plugins/Samples/GdcmDecoder/OrthancImageWrapper.h>
-#include <Resources/ThirdParty/base64/base64.h>
#include <boost/lexical_cast.hpp>
#include <boost/algorithm/string/predicate.hpp>
@@ -127,8 +125,7 @@
bool DecodedImageAdapter::Create(std::string& content,
const std::string& uri)
{
- std::string message = "Decoding DICOM instance: " + uri;
- OrthancPluginLogInfo(context_, message.c_str());
+ LOG(INFO) << "Decoding DICOM instance: " << uri;
CompressionType type;
uint8_t level;
@@ -140,7 +137,6 @@
return false;
}
-
bool ok = false;
Json::Value tags;
@@ -151,7 +147,9 @@
throw Orthanc::OrthancException(Orthanc::ErrorCode_UnknownResource);
}
- std::auto_ptr<OrthancImageWrapper> image(new OrthancImageWrapper(context_,
OrthancPluginDecodeDicomImage(context_, dicom.c_str(), dicom.size(),
frameIndex)));
+ std::unique_ptr<OrthancImage> image(
+ new OrthancImage(OrthancPluginDecodeDicomImage(
+ context_, dicom.c_str(), dicom.size(), frameIndex)));
Json::Value json;
if (GetCornerstoneMetadata(json, tags, *image))
@@ -180,9 +178,7 @@
}
else
{
- char msg[1024];
- sprintf(msg, "Unable to decode the following instance: %s", uri.c_str());
- OrthancPluginLogWarning(context_, msg);
+ LOG(WARNING) << "Unable to decode the following instance: " << uri;
return false;
}
}
@@ -190,14 +186,14 @@
bool DecodedImageAdapter::GetCornerstoneMetadata(Json::Value& result,
const Json::Value& tags,
- OrthancImageWrapper& image)
+ OrthancImage& image)
{
using namespace Orthanc;
float windowCenter, windowWidth;
Orthanc::ImageAccessor accessor;
- accessor.AssignReadOnly(OrthancPlugins::Convert(image.GetFormat()),
image.GetWidth(),
+ accessor.AssignReadOnly(OrthancPlugins::Convert(image.GetPixelFormat()),
image.GetWidth(),
image.GetHeight(), image.GetPitch(),
image.GetBuffer());
switch (accessor.GetFormat())
@@ -310,13 +306,13 @@
bool DecodedImageAdapter::EncodeUsingDeflate(Json::Value& result,
- OrthancImageWrapper& image)
+ OrthancImage& image)
{
Orthanc::ImageAccessor accessor;
- accessor.AssignReadOnly(OrthancPlugins::Convert(image.GetFormat()),
image.GetWidth(),
+ accessor.AssignReadOnly(OrthancPlugins::Convert(image.GetPixelFormat()),
image.GetWidth(),
image.GetHeight(), image.GetPitch(),
image.GetBuffer());
- std::auto_ptr<Orthanc::ImageBuffer> buffer;
+ std::unique_ptr<Orthanc::ImageBuffer> buffer;
Orthanc::ImageAccessor converted;
@@ -362,9 +358,11 @@
result["sizeInBytes"] = converted.GetSize();
std::string z;
- CompressUsingDeflate(z, image.GetContext(), converted.GetConstBuffer(),
converted.GetSize());
-
- result["Orthanc"]["PixelData"] = base64_encode(z);
+ CompressUsingDeflate(z, GetGlobalContext(), converted.GetConstBuffer(),
converted.GetSize());
+
+ std::string s;
+ Orthanc::Toolbox::EncodeBase64(s, z);
+ result["Orthanc"]["PixelData"] = s;
return true;
}
@@ -419,14 +417,14 @@
bool DecodedImageAdapter::EncodeUsingJpeg(Json::Value& result,
- OrthancImageWrapper& image,
+ OrthancImage& image,
uint8_t quality /* between 0 and
100 */)
{
Orthanc::ImageAccessor accessor;
- accessor.AssignReadOnly(OrthancPlugins::Convert(image.GetFormat()),
image.GetWidth(),
+ accessor.AssignReadOnly(OrthancPlugins::Convert(image.GetPixelFormat()),
image.GetWidth(),
image.GetHeight(), image.GetPitch(),
image.GetBuffer());
- std::auto_ptr<Orthanc::ImageBuffer> buffer;
+ std::unique_ptr<Orthanc::ImageBuffer> buffer;
Orthanc::ImageAccessor converted;
@@ -482,9 +480,12 @@
result["sizeInBytes"] = converted.GetSize();
std::string jpeg;
- WriteJpegToMemory(jpeg, image.GetContext(), converted, quality);
+ WriteJpegToMemory(jpeg, GetGlobalContext(), converted, quality);
- result["Orthanc"]["PixelData"] = base64_encode(jpeg);
+ std::string s;
+ Orthanc::Toolbox::EncodeBase64(s, jpeg);
+ result["Orthanc"]["PixelData"] = s;
+
return true;
}
}
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/OrthancWebViewer-2.5/Plugin/DecodedImageAdapter.h
new/OrthancWebViewer-2.6/Plugin/DecodedImageAdapter.h
--- old/OrthancWebViewer-2.5/Plugin/DecodedImageAdapter.h 2019-02-27
17:20:45.000000000 +0100
+++ new/OrthancWebViewer-2.6/Plugin/DecodedImageAdapter.h 2020-05-26
09:12:07.000000000 +0200
@@ -2,7 +2,7 @@
* Orthanc - A Lightweight, RESTful DICOM Store
* Copyright (C) 2012-2016 Sebastien Jodogne, Medical Physics
* Department, University Hospital of Liege, Belgium
- * Copyright (C) 2017-2019 Osimis S.A., Belgium
+ * Copyright (C) 2017-2020 Osimis S.A., Belgium
*
* This program is free software: you can redistribute it and/or
* modify it under the terms of the GNU Affero General Public License
@@ -27,7 +27,7 @@
#include <stdint.h>
#include <json/value.h>
-#include <Plugins/Samples/GdcmDecoder/OrthancImageWrapper.h>
+#include <Plugins/Samples/Common/OrthancPluginCppWrapper.h>
namespace OrthancPlugins
@@ -49,13 +49,13 @@
static bool GetCornerstoneMetadata(Json::Value& result,
const Json::Value& tags,
- OrthancImageWrapper& image);
+ OrthancImage& image);
static bool EncodeUsingDeflate(Json::Value& result,
- OrthancImageWrapper& image);
+ OrthancImage& image);
static bool EncodeUsingJpeg(Json::Value& result,
- OrthancImageWrapper& image,
+ OrthancImage& image,
uint8_t quality /* between 0 and 100 */);
OrthancPluginContext* context_;
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/OrthancWebViewer-2.5/Plugin/Plugin.cpp
new/OrthancWebViewer-2.6/Plugin/Plugin.cpp
--- old/OrthancWebViewer-2.5/Plugin/Plugin.cpp 2019-02-27 17:20:45.000000000
+0100
+++ new/OrthancWebViewer-2.6/Plugin/Plugin.cpp 2020-05-26 09:12:07.000000000
+0200
@@ -2,7 +2,7 @@
* Orthanc - A Lightweight, RESTful DICOM Store
* Copyright (C) 2012-2016 Sebastien Jodogne, Medical Physics
* Department, University Hospital of Liege, Belgium
- * Copyright (C) 2017-2019 Osimis S.A., Belgium
+ * Copyright (C) 2017-2020 Osimis S.A., Belgium
*
* This program is free software: you can redistribute it and/or
* modify it under the terms of the GNU Affero General Public License
@@ -28,7 +28,7 @@
#include <Core/OrthancException.h>
#include <Core/SystemToolbox.h>
#include <Core/Toolbox.h>
-#include <Plugins/Samples/GdcmDecoder/GdcmDecoderCache.h>
+#include <Plugins/Samples/Common/OrthancPluginCppWrapper.h>
#include <boost/thread.hpp>
#include <boost/lexical_cast.hpp>
@@ -36,9 +36,26 @@
#include <boost/filesystem.hpp>
+/**
+ * We force the redefinition of the "ORTHANC_PLUGINS_API" macro, that
+ * was left empty with gcc until Orthanc SDK 1.5.7 (no "default"
+ * visibility). This causes the version script, if run from "Holy
+ * Build Box", to make private the 4 global functions of the plugin.
+ **/
+
+#undef ORTHANC_PLUGINS_API
+
+#ifdef WIN32
+# define ORTHANC_PLUGINS_API __declspec(dllexport)
+#elif __GNUC__ >= 4
+# define ORTHANC_PLUGINS_API __attribute__ ((visibility ("default")))
+#else
+# define ORTHANC_PLUGINS_API
+#endif
+
+
+
static OrthancPluginContext* context_ = NULL;
-static bool restrictTransferSyntaxes_ = false;
-static std::set<std::string> enabledTransferSyntaxes_;
class CacheContext
@@ -63,19 +80,18 @@
Orthanc::FilesystemStorage storage_;
Orthanc::SQLite::Connection db_;
- std::auto_ptr<OrthancPlugins::CacheManager> cache_;
- std::auto_ptr<OrthancPlugins::CacheScheduler> scheduler_;
+ std::unique_ptr<OrthancPlugins::CacheManager> cache_;
+ std::unique_ptr<OrthancPlugins::CacheScheduler> scheduler_;
Orthanc::SharedMessageQueue newInstances_;
bool stop_;
boost::thread newInstancesThread_;
- OrthancPlugins::GdcmDecoderCache decoder_;
static void NewInstancesThread(CacheContext* cache)
{
while (!cache->stop_)
{
- std::auto_ptr<Orthanc::IDynamicObject>
obj(cache->newInstances_.Dequeue(100));
+ std::unique_ptr<Orthanc::IDynamicObject>
obj(cache->newInstances_.Dequeue(100));
if (obj.get() != NULL)
{
const std::string& instanceId =
dynamic_cast<DynamicString&>(*obj).GetValue();
@@ -128,11 +144,6 @@
{
newInstances_.Enqueue(new DynamicString(instanceId));
}
-
- OrthancPlugins::GdcmDecoderCache& GetDecoder()
- {
- return decoder_;
- }
};
@@ -329,128 +340,7 @@
-static bool ExtractTransferSyntax(std::string& transferSyntax,
- const void* dicom,
- const uint32_t size)
-{
- Orthanc::DicomMap header;
- if (!Orthanc::DicomMap::ParseDicomMetaInformation(header,
reinterpret_cast<const char*>(dicom), size))
- {
- return false;
- }
-
- const Orthanc::DicomValue* tag = header.TestAndGetValue(0x0002, 0x0010);
- if (tag == NULL ||
- tag->IsNull() ||
- tag->IsBinary())
- {
- return false;
- }
- else
- {
- // Stripping spaces should not be required, as this is a UI value
- // representation whose stripping is supported by the Orthanc
- // core, but let's be careful...
- transferSyntax = Orthanc::Toolbox::StripSpaces(tag->GetContent());
- return true;
- }
-}
-
-
-static bool IsTransferSyntaxEnabled(const void* dicom,
- const uint32_t size)
-{
- std::string formattedSize;
-
- {
- char tmp[16];
- sprintf(tmp, "%0.1fMB", static_cast<float>(size) / (1024.0f * 1024.0f));
- formattedSize.assign(tmp);
- }
-
- if (!restrictTransferSyntaxes_)
- {
- std::string s = "Decoding one DICOM instance of " + formattedSize + "
using GDCM";
- OrthancPluginLogInfo(context_, s.c_str());
- return true;
- }
-
- std::string transferSyntax;
- if (!ExtractTransferSyntax(transferSyntax, dicom, size))
- {
- std::string s = ("Cannot extract the transfer syntax of this instance of "
+
- formattedSize + ", will use GDCM to decode it");
- OrthancPluginLogInfo(context_, s.c_str());
- return true;
- }
-
- if (enabledTransferSyntaxes_.find(transferSyntax) !=
enabledTransferSyntaxes_.end())
- {
- // Decoding for this transfer syntax is enabled
- std::string s = ("Using GDCM to decode this instance of " +
- formattedSize + " with transfer syntax " +
transferSyntax);
- OrthancPluginLogInfo(context_, s.c_str());
- return true;
- }
- else
- {
- std::string s = ("Won't use GDCM to decode this instance of " +
- formattedSize + ", as its transfer syntax " +
transferSyntax + " is disabled");
- OrthancPluginLogInfo(context_, s.c_str());
- return false;
- }
-}
-
-
-static OrthancPluginErrorCode DecodeImageCallback(OrthancPluginImage** target,
- const void* dicom,
- const uint32_t size,
- uint32_t frameIndex)
-{
- try
- {
- if (!IsTransferSyntaxEnabled(dicom, size))
- {
- *target = NULL;
- return OrthancPluginErrorCode_Success;
- }
-
- std::auto_ptr<OrthancPlugins::OrthancImageWrapper> image;
-
-#if 0
- // Do not use the cache
- OrthancPlugins::GdcmImageDecoder decoder(dicom, size);
- image.reset(new OrthancPlugins::OrthancImageWrapper(context_, decoder,
frameIndex));
-#else
- using namespace OrthancPlugins;
- image.reset(cache_->GetDecoder().Decode(context_, dicom, size,
frameIndex));
-#endif
-
- *target = image->Release();
-
- return OrthancPluginErrorCode_Success;
- }
- catch (Orthanc::OrthancException& e)
- {
- *target = NULL;
-
- std::string s = "Cannot decode image using GDCM: " + std::string(e.What());
- OrthancPluginLogWarning(context_, s.c_str());
- return OrthancPluginErrorCode_Plugin;
- }
- catch (std::runtime_error& e)
- {
- *target = NULL;
-
- std::string s = "Cannot decode image using GDCM: " + std::string(e.what());
- OrthancPluginLogWarning(context_, s.c_str());
- return OrthancPluginErrorCode_Plugin;
- }
-}
-
-
-void ParseConfiguration(bool& enableGdcm,
- int& decodingThreads,
+void ParseConfiguration(int& decodingThreads,
boost::filesystem::path& cachePath,
int& cacheSize)
{
@@ -480,49 +370,6 @@
cachePath =
OrthancPlugins::GetStringValue(configuration[CONFIG_WEB_VIEWER], key,
cachePath.string());
cacheSize =
OrthancPlugins::GetIntegerValue(configuration[CONFIG_WEB_VIEWER], "CacheSize",
cacheSize);
decodingThreads =
OrthancPlugins::GetIntegerValue(configuration[CONFIG_WEB_VIEWER], "Threads",
decodingThreads);
-
- static const char* CONFIG_ENABLE_GDCM = "EnableGdcm";
- if (configuration[CONFIG_WEB_VIEWER].isMember(CONFIG_ENABLE_GDCM))
- {
- if (configuration[CONFIG_WEB_VIEWER][CONFIG_ENABLE_GDCM].type() !=
Json::booleanValue)
- {
- throw Orthanc::OrthancException(Orthanc::ErrorCode_BadFileFormat);
- }
- else
- {
- enableGdcm =
configuration[CONFIG_WEB_VIEWER][CONFIG_ENABLE_GDCM].asBool();
- }
- }
-
- if (enableGdcm)
- {
- static const char* CONFIG_RESTRICT_TRANSFER_SYNTAXES =
"RestrictTransferSyntaxes";
-
- if
(configuration[CONFIG_WEB_VIEWER].isMember(CONFIG_RESTRICT_TRANSFER_SYNTAXES))
- {
- const Json::Value& config =
configuration[CONFIG_WEB_VIEWER][CONFIG_RESTRICT_TRANSFER_SYNTAXES];
-
- if (config.type() != Json::arrayValue)
- {
- throw Orthanc::OrthancException(Orthanc::ErrorCode_BadFileFormat);
- }
-
- restrictTransferSyntaxes_ = true;
- for (Json::Value::ArrayIndex i = 0; i < config.size(); i++)
- {
- if (config[i].type() != Json::stringValue)
- {
- throw Orthanc::OrthancException(Orthanc::ErrorCode_BadFileFormat);
- }
- else
- {
- std::string s = "Web viewer will use GDCM to decode transfer
syntax " + config[i].asString();
- enabledTransferSyntaxes_.insert(config[i].asString());
- OrthancPluginLogWarning(context_, s.c_str());
- }
- }
- }
- }
}
if (decodingThreads <= 0 ||
@@ -549,6 +396,8 @@
{
using namespace OrthancPlugins;
+ OrthancPlugins::SetGlobalContext(context);
+ Orthanc::Logging::Initialize(context);
context_ = context;
assert(DisplayPerformanceWarning());
OrthancPluginLogWarning(context_, "Initializing the Web viewer");
@@ -577,16 +426,13 @@
decodingThreads = 1;
}
- /* By default, use GDCM */
- bool enableGdcm = true;
-
try
{
/* By default, a cache of 100 MB is used */
int cacheSize = 100;
boost::filesystem::path cachePath;
- ParseConfiguration(enableGdcm, decodingThreads, cachePath, cacheSize);
+ ParseConfiguration(decodingThreads, cachePath, cacheSize);
std::string message = ("Web viewer using " +
boost::lexical_cast<std::string>(decodingThreads) +
" threads for the decoding of the DICOM images");
@@ -672,29 +518,16 @@
}
- /* Configure the DICOM decoder */
- if (enableGdcm)
- {
- // Replace the default decoder of DICOM images that is built in Orthanc
- OrthancPluginLogWarning(context_, "Using GDCM instead of the DICOM
decoder that is built in Orthanc");
- OrthancPluginRegisterDecodeImageCallback(context_, DecodeImageCallback);
- }
- else
- {
- OrthancPluginLogWarning(context_, "Using the DICOM decoder that is built
in Orthanc (not using GDCM)");
- }
-
-
/* Install the callbacks */
- OrthancPluginRegisterRestCallback(context_, "/web-viewer/series/(.*)",
ServeCache<CacheBundle_SeriesInformation>);
- OrthancPluginRegisterRestCallback(context_,
"/web-viewer/is-stable-series/(.*)", IsStableSeries);
- OrthancPluginRegisterRestCallback(context_, "/web-viewer/instances/(.*)",
ServeCache<CacheBundle_DecodedImage>);
- OrthancPluginRegisterRestCallback(context, "/web-viewer/libs/(.*)",
ServeEmbeddedFolder<Orthanc::EmbeddedResources::JAVASCRIPT_LIBS>);
+ OrthancPluginRegisterRestCallbackNoLock(context_,
"/web-viewer/series/(.*)", ServeCache<CacheBundle_SeriesInformation>);
+ OrthancPluginRegisterRestCallbackNoLock(context_,
"/web-viewer/is-stable-series/(.*)", IsStableSeries);
+ OrthancPluginRegisterRestCallbackNoLock(context_,
"/web-viewer/instances/(.*)", ServeCache<CacheBundle_DecodedImage>);
+ OrthancPluginRegisterRestCallbackNoLock(context, "/web-viewer/libs/(.*)",
ServeEmbeddedFolder<Orthanc::EmbeddedResources::JAVASCRIPT_LIBS>);
#if ORTHANC_STANDALONE == 1
- OrthancPluginRegisterRestCallback(context, "/web-viewer/app/(.*)",
ServeEmbeddedFolder<Orthanc::EmbeddedResources::WEB_VIEWER>);
+ OrthancPluginRegisterRestCallbackNoLock(context, "/web-viewer/app/(.*)",
ServeEmbeddedFolder<Orthanc::EmbeddedResources::WEB_VIEWER>);
#else
- OrthancPluginRegisterRestCallback(context, "/web-viewer/app/(.*)",
ServeWebViewer);
+ OrthancPluginRegisterRestCallbackNoLock(context, "/web-viewer/app/(.*)",
ServeWebViewer);
#endif
OrthancPluginRegisterOnChangeCallback(context, OnChangeCallback);
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore'
old/OrthancWebViewer-2.5/Plugin/SeriesInformationAdapter.cpp
new/OrthancWebViewer-2.6/Plugin/SeriesInformationAdapter.cpp
--- old/OrthancWebViewer-2.5/Plugin/SeriesInformationAdapter.cpp
2019-02-27 17:20:45.000000000 +0100
+++ new/OrthancWebViewer-2.6/Plugin/SeriesInformationAdapter.cpp
2020-05-26 09:12:07.000000000 +0200
@@ -2,7 +2,7 @@
* Orthanc - A Lightweight, RESTful DICOM Store
* Copyright (C) 2012-2016 Sebastien Jodogne, Medical Physics
* Department, University Hospital of Liege, Belgium
- * Copyright (C) 2017-2019 Osimis S.A., Belgium
+ * Copyright (C) 2017-2020 Osimis S.A., Belgium
*
* This program is free software: you can redistribute it and/or
* modify it under the terms of the GNU Affero General Public License
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore'
old/OrthancWebViewer-2.5/Plugin/SeriesInformationAdapter.h
new/OrthancWebViewer-2.6/Plugin/SeriesInformationAdapter.h
--- old/OrthancWebViewer-2.5/Plugin/SeriesInformationAdapter.h 2019-02-27
17:20:45.000000000 +0100
+++ new/OrthancWebViewer-2.6/Plugin/SeriesInformationAdapter.h 2020-05-26
09:12:07.000000000 +0200
@@ -2,7 +2,7 @@
* Orthanc - A Lightweight, RESTful DICOM Store
* Copyright (C) 2012-2016 Sebastien Jodogne, Medical Physics
* Department, University Hospital of Liege, Belgium
- * Copyright (C) 2017-2019 Osimis S.A., Belgium
+ * Copyright (C) 2017-2020 Osimis S.A., Belgium
*
* This program is free software: you can redistribute it and/or
* modify it under the terms of the GNU Affero General Public License
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/OrthancWebViewer-2.5/Plugin/ViewerPrefetchPolicy.cpp
new/OrthancWebViewer-2.6/Plugin/ViewerPrefetchPolicy.cpp
--- old/OrthancWebViewer-2.5/Plugin/ViewerPrefetchPolicy.cpp 2019-02-27
17:20:45.000000000 +0100
+++ new/OrthancWebViewer-2.6/Plugin/ViewerPrefetchPolicy.cpp 2020-05-26
09:12:07.000000000 +0200
@@ -2,7 +2,7 @@
* Orthanc - A Lightweight, RESTful DICOM Store
* Copyright (C) 2012-2016 Sebastien Jodogne, Medical Physics
* Department, University Hospital of Liege, Belgium
- * Copyright (C) 2017-2019 Osimis S.A., Belgium
+ * Copyright (C) 2017-2020 Osimis S.A., Belgium
*
* This program is free software: you can redistribute it and/or
* modify it under the terms of the GNU Affero General Public License
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/OrthancWebViewer-2.5/Plugin/ViewerPrefetchPolicy.h
new/OrthancWebViewer-2.6/Plugin/ViewerPrefetchPolicy.h
--- old/OrthancWebViewer-2.5/Plugin/ViewerPrefetchPolicy.h 2019-02-27
17:20:45.000000000 +0100
+++ new/OrthancWebViewer-2.6/Plugin/ViewerPrefetchPolicy.h 2020-05-26
09:12:07.000000000 +0200
@@ -2,7 +2,7 @@
* Orthanc - A Lightweight, RESTful DICOM Store
* Copyright (C) 2012-2016 Sebastien Jodogne, Medical Physics
* Department, University Hospital of Liege, Belgium
- * Copyright (C) 2017-2019 Osimis S.A., Belgium
+ * Copyright (C) 2017-2020 Osimis S.A., Belgium
*
* This program is free software: you can redistribute it and/or
* modify it under the terms of the GNU Affero General Public License
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/OrthancWebViewer-2.5/Plugin/ViewerToolbox.cpp
new/OrthancWebViewer-2.6/Plugin/ViewerToolbox.cpp
--- old/OrthancWebViewer-2.5/Plugin/ViewerToolbox.cpp 2019-02-27
17:20:45.000000000 +0100
+++ new/OrthancWebViewer-2.6/Plugin/ViewerToolbox.cpp 2020-05-26
09:12:07.000000000 +0200
@@ -2,7 +2,7 @@
* Orthanc - A Lightweight, RESTful DICOM Store
* Copyright (C) 2012-2016 Sebastien Jodogne, Medical Physics
* Department, University Hospital of Liege, Belgium
- * Copyright (C) 2017-2019 Osimis S.A., Belgium
+ * Copyright (C) 2017-2020 Osimis S.A., Belgium
*
* This program is free software: you can redistribute it and/or
* modify it under the terms of the GNU Affero General Public License
@@ -25,7 +25,7 @@
#include <Core/Toolbox.h>
// Gain access to ORTHANC_PLUGINS_VERSION_IS_ABOVE if Orthanc SDK <= 1.3.0
-#include <Plugins/Samples/GdcmDecoder/GdcmImageDecoder.h>
+#include <Plugins/Samples/Common/OrthancPluginCppWrapper.h>
#include <json/reader.h>
#include <stdexcept>
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/OrthancWebViewer-2.5/Plugin/ViewerToolbox.h
new/OrthancWebViewer-2.6/Plugin/ViewerToolbox.h
--- old/OrthancWebViewer-2.5/Plugin/ViewerToolbox.h 2019-02-27
17:20:45.000000000 +0100
+++ new/OrthancWebViewer-2.6/Plugin/ViewerToolbox.h 2020-05-26
09:12:07.000000000 +0200
@@ -2,7 +2,7 @@
* Orthanc - A Lightweight, RESTful DICOM Store
* Copyright (C) 2012-2016 Sebastien Jodogne, Medical Physics
* Department, University Hospital of Liege, Belgium
- * Copyright (C) 2017-2019 Osimis S.A., Belgium
+ * Copyright (C) 2017-2020 Osimis S.A., Belgium
*
* This program is free software: you can redistribute it and/or
* modify it under the terms of the GNU Affero General Public License
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/OrthancWebViewer-2.5/README
new/OrthancWebViewer-2.6/README
--- old/OrthancWebViewer-2.5/README 2019-02-27 17:20:45.000000000 +0100
+++ new/OrthancWebViewer-2.6/README 2020-05-26 09:12:07.000000000 +0200
@@ -12,16 +12,15 @@
Dependencies
------------
-The Web viewer is based upon the following projects:
+The Web viewer is based upon the Cornerstone project, a client-side
+JavaScript library to display medical images in Web browsers, by Chris
+Hafey <[email protected]>:
+https://github.com/chafey/cornerstone
-* Cornerstone, a client-side JavaScript library to display medical
- images in Web browsers, by Chris Hafey <[email protected]>:
- https://github.com/chafey/cornerstone
-
-* GDCM, an open-source implementation of the DICOM standard with
- advanced features for image decoding, by Mathieu Malaterre
- <[email protected]>:
- http://sourceforge.net/projects/gdcm/
+In releases < 2.6, this plugin was also implementing primitives to
+decode DICOM images using GDCM in Orthanc. Starting with release 2.6,
+these primitives are available as part of the "orthanc-gdcm" plugin:
+http://sourceforge.net/projects/gdcm/
Installation and usage
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/OrthancWebViewer-2.5/Resources/BuildInstructions.txt
new/OrthancWebViewer-2.6/Resources/BuildInstructions.txt
--- old/OrthancWebViewer-2.5/Resources/BuildInstructions.txt 2019-02-27
17:20:45.000000000 +0100
+++ new/OrthancWebViewer-2.6/Resources/BuildInstructions.txt 2020-05-26
09:12:07.000000000 +0200
@@ -10,7 +10,7 @@
Debian Sid (dynamic linking)
============================
-# sudo apt-get install build-essential unzip cmake libgdcm2-dev libjpeg-dev \
+# sudo apt-get install build-essential unzip cmake libjpeg-dev \
uuid-dev libgtest-dev libpng-dev libsqlite3-dev \
zlib1g-dev libboost-all-dev libjsoncpp-dev
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore'
old/OrthancWebViewer-2.5/Resources/CMake/GdcmConfiguration.cmake
new/OrthancWebViewer-2.6/Resources/CMake/GdcmConfiguration.cmake
--- old/OrthancWebViewer-2.5/Resources/CMake/GdcmConfiguration.cmake
2019-02-27 17:20:45.000000000 +0100
+++ new/OrthancWebViewer-2.6/Resources/CMake/GdcmConfiguration.cmake
1970-01-01 01:00:00.000000000 +0100
@@ -1,134 +0,0 @@
-# Orthanc - A Lightweight, RESTful DICOM Store
-# Copyright (C) 2012-2016 Sebastien Jodogne, Medical Physics
-# Department, University Hospital of Liege, Belgium
-# Copyright (C) 2017-2019 Osimis S.A., Belgium
-#
-# This program is free software: you can redistribute it and/or
-# modify it under the terms of the GNU Affero 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
-# Affero General Public License for more details.
-#
-# You should have received a copy of the GNU Affero General Public License
-# along with this program. If not, see <http://www.gnu.org/licenses/>.
-
-
-if (STATIC_BUILD OR NOT USE_SYSTEM_GDCM)
- if (${CMAKE_SYSTEM_NAME} STREQUAL "Linux" OR
- ${CMAKE_SYSTEM_NAME} STREQUAL "FreeBSD" OR
- ${CMAKE_SYSTEM_NAME} STREQUAL "kFreeBSD")
- # If using gcc, build GDCM with the "-fPIC" argument to allow its
- # embedding into the shared library containing the Orthanc plugin
- set(AdditionalFlags "-fPIC")
- elseif (${CMAKE_SYSTEM_NAME} STREQUAL "OpenBSD")
- # This definition is necessary to compile
- # "Source/MediaStorageAndFileFormat/gdcmFileStreamer.cxx"
- set(AdditionalFlags "-Doff64_t=off_t")
- endif()
-
- set(Flags
- "-DCMAKE_C_FLAGS=${CMAKE_C_FLAGS} ${AdditionalFlags}"
- "-DCMAKE_CXX_FLAGS=${CMAKE_CXX_FLAGS} ${AdditionalFlags}"
- -DCMAKE_C_FLAGS_DEBUG=${CMAKE_C_FLAGS_DEBUG}
- -DCMAKE_CXX_FLAGS_DEBUG=${CMAKE_CXX_FLAGS_DEBUG}
- -DCMAKE_C_FLAGS_RELEASE=${CMAKE_C_FLAGS_RELEASE}
- -DCMAKE_CXX_FLAGS_RELEASE=${CMAKE_CXX_FLAGS_RELEASE}
- -DCMAKE_C_FLAGS_MINSIZEREL=${CMAKE_C_FLAGS_MINSIZEREL}
- -DCMAKE_CXX_FLAGS_MINSIZEREL=${CMAKE_CXX_FLAGS_MINSIZEREL}
- -DCMAKE_C_FLAGS_RELWITHDEBINFO=${CMAKE_C_FLAGS_RELWITHDEBINFO}
- -DCMAKE_CXX_FLAGS_RELWITHDEBINFO=${CMAKE_CXX_FLAGS_RELWITHDEBINFO}
- )
-
- if (CMAKE_TOOLCHAIN_FILE)
- # Take absolute path to the toolchain
- get_filename_component(TMP ${CMAKE_TOOLCHAIN_FILE} REALPATH BASE
${CMAKE_SOURCE_DIR})
- list(APPEND Flags -DCMAKE_TOOLCHAIN_FILE=${TMP})
- endif()
-
- # Don't build manpages (since gdcm 2.8.4)
- list(APPEND Flags -DGDCM_BUILD_DOCBOOK_MANPAGES=OFF)
-
- if ("${CMAKE_SYSTEM_VERSION}" STREQUAL "LinuxStandardBase")
- # Trick to disable the compilation of socket++ by gdcm, which is
- # incompatible with LSB, but fortunately only required for DICOM
- # Networking
- list(APPEND Flags -DGDCM_USE_SYSTEM_SOCKETXX=ON)
-
- # Detect the number of CPU cores to run "make" with as much
- # parallelism as possible
- include(ProcessorCount)
- ProcessorCount(N)
- if (NOT N EQUAL 0)
- set(MAKE_PARALLEL -j${N})
- endif()
-
- # For Linux Standard Base, avoid building incompatible target gdcmMEXD (*)
- set(BUILD_COMMAND BUILD_COMMAND
- ${CMAKE_MAKE_PROGRAM} ${MAKE_PARALLEL}
- gdcmMSFF gdcmcharls gdcmDICT gdcmDSED gdcmIOD gdcmjpeg8
- gdcmjpeg12 gdcmjpeg16 gdcmopenjp2 gdcmzlib gdcmCommon gdcmexpat)
- endif()
-
- include(ExternalProject)
- externalproject_add(GDCM
- URL "http://orthanc.osimis.io/ThirdPartyDownloads/gdcm-2.8.8.tar.gz"
- URL_MD5 "740c22b787a8e47e4d748c167e450d8f"
- TIMEOUT 60
- CMAKE_ARGS -DCMAKE_BUILD_TYPE:STRING=${CMAKE_BUILD_TYPE} ${Flags}
- ${BUILD_COMMAND} # Customize "make", only for Linux Standard Base (*)
- INSTALL_COMMAND "" # Skip the install step
- )
-
- if(MSVC)
- set(Suffix ".lib")
- set(Prefix "")
- else()
- set(Suffix ".a")
- list(GET CMAKE_FIND_LIBRARY_PREFIXES 0 Prefix)
- endif()
-
- set(GDCM_LIBRARIES
- # WARNING: The order of the libraries below *is* important!
- ${Prefix}gdcmMSFF${Suffix}
- ${Prefix}gdcmcharls${Suffix}
- ${Prefix}gdcmDICT${Suffix}
- ${Prefix}gdcmDSED${Suffix}
- ${Prefix}gdcmIOD${Suffix}
- ${Prefix}gdcmjpeg8${Suffix}
- ${Prefix}gdcmjpeg12${Suffix}
- ${Prefix}gdcmjpeg16${Suffix}
- ${Prefix}gdcmopenjp2${Suffix}
- ${Prefix}gdcmzlib${Suffix}
- ${Prefix}gdcmCommon${Suffix}
- ${Prefix}gdcmexpat${Suffix}
-
- #${Prefix}socketxx${Suffix}
- #${Prefix}gdcmMEXD${Suffix} # DICOM Networking, unneeded by Orthanc
plugins
- #${Prefix}gdcmgetopt${Suffix}
- #${Prefix}gdcmuuid${Suffix}
- )
-
- ExternalProject_Get_Property(GDCM binary_dir)
- include_directories(${binary_dir}/Source/Common)
- link_directories(${binary_dir}/bin)
-
- ExternalProject_Get_Property(GDCM source_dir)
- include_directories(
- ${source_dir}/Source/Common
- ${source_dir}/Source/MediaStorageAndFileFormat
- ${source_dir}/Source/DataStructureAndEncodingDefinition
- )
-
-else()
- find_package(GDCM REQUIRED)
- if (GDCM_FOUND)
- include(${GDCM_USE_FILE})
- set(GDCM_LIBRARIES gdcmCommon gdcmMSFF)
- else(GDCM_FOUND)
- message(FATAL_ERROR "Cannot find GDCM, did you set GDCM_DIR?")
- endif(GDCM_FOUND)
-endif()
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore'
old/OrthancWebViewer-2.5/Resources/CMake/JavaScriptLibraries.cmake
new/OrthancWebViewer-2.6/Resources/CMake/JavaScriptLibraries.cmake
--- old/OrthancWebViewer-2.5/Resources/CMake/JavaScriptLibraries.cmake
2019-02-27 17:20:45.000000000 +0100
+++ new/OrthancWebViewer-2.6/Resources/CMake/JavaScriptLibraries.cmake
2020-05-26 09:12:07.000000000 +0200
@@ -1,7 +1,7 @@
# Orthanc - A Lightweight, RESTful DICOM Store
# Copyright (C) 2012-2016 Sebastien Jodogne, Medical Physics
# Department, University Hospital of Liege, Belgium
-# Copyright (C) 2017-2019 Osimis S.A., Belgium
+# Copyright (C) 2017-2020 Osimis S.A., Belgium
#
# This program is free software: you can redistribute it and/or
# modify it under the terms of the GNU Affero General Public License
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore'
old/OrthancWebViewer-2.5/Resources/Orthanc/DownloadOrthancFramework.cmake
new/OrthancWebViewer-2.6/Resources/Orthanc/DownloadOrthancFramework.cmake
--- old/OrthancWebViewer-2.5/Resources/Orthanc/DownloadOrthancFramework.cmake
2019-02-27 17:20:45.000000000 +0100
+++ new/OrthancWebViewer-2.6/Resources/Orthanc/DownloadOrthancFramework.cmake
2020-05-26 09:12:07.000000000 +0200
@@ -1,7 +1,7 @@
# Orthanc - A Lightweight, RESTful DICOM Store
# Copyright (C) 2012-2016 Sebastien Jodogne, Medical Physics
# Department, University Hospital of Liege, Belgium
-# Copyright (C) 2017-2019 Osimis S.A., Belgium
+# Copyright (C) 2017-2020 Osimis S.A., Belgium
#
# This program is free software: you can redistribute it and/or
# modify it under the terms of the GNU General Public License as
@@ -66,6 +66,9 @@
if (NOT DEFINED ORTHANC_FRAMEWORK_BRANCH)
if (ORTHANC_FRAMEWORK_VERSION STREQUAL "mainline")
set(ORTHANC_FRAMEWORK_BRANCH "default")
+ set(ORTHANC_FRAMEWORK_MAJOR 999)
+ set(ORTHANC_FRAMEWORK_MINOR 999)
+ set(ORTHANC_FRAMEWORK_REVISION 999)
else()
set(ORTHANC_FRAMEWORK_BRANCH "Orthanc-${ORTHANC_FRAMEWORK_VERSION}")
@@ -103,9 +106,37 @@
set(ORTHANC_FRAMEWORK_MD5 "404baef5d4c43e7c5d9410edda8ef5a5")
elseif (ORTHANC_FRAMEWORK_VERSION STREQUAL "1.5.5")
set(ORTHANC_FRAMEWORK_MD5 "cfc437e0687ae4bd725fd93dc1f08bc4")
+ elseif (ORTHANC_FRAMEWORK_VERSION STREQUAL "1.5.6")
+ set(ORTHANC_FRAMEWORK_MD5 "3c29de1e289b5472342947168f0105c0")
+ elseif (ORTHANC_FRAMEWORK_VERSION STREQUAL "1.5.7")
+ set(ORTHANC_FRAMEWORK_MD5 "e1b76f01116d9b5d4ac8cc39980560e3")
+ elseif (ORTHANC_FRAMEWORK_VERSION STREQUAL "1.5.8")
+ set(ORTHANC_FRAMEWORK_MD5 "82323e8c49a667f658a3639ea4dbc336")
+ elseif (ORTHANC_FRAMEWORK_VERSION STREQUAL "1.6.0")
+ set(ORTHANC_FRAMEWORK_MD5 "eab428d6e53f61e847fa360bb17ebe25")
+ elseif (ORTHANC_FRAMEWORK_VERSION STREQUAL "1.6.1")
+ set(ORTHANC_FRAMEWORK_MD5 "3971f5de96ba71dc9d3f3690afeaa7c0")
+ elseif (ORTHANC_FRAMEWORK_VERSION STREQUAL "1.7.0")
+ set(ORTHANC_FRAMEWORK_MD5 "ce5f689e852b01d3672bd3d2f952a5ef")
+
+ # Below this point are development snapshots that were used to
+ # release some plugin, before an official release of the Orthanc
+ # framework was available. Here is the command to be used to
+ # generate a proper archive:
+ #
+ # $ hg archive /tmp/Orthanc-`hg id -i | sed 's/\+//'`.tar.gz
+ #
+ elseif (ORTHANC_FRAMEWORK_VERSION STREQUAL "ae0e3fd609df")
+ # DICOMweb 1.1 (framework pre-1.6.0)
+ set(ORTHANC_FRAMEWORK_MD5 "7e09e9b530a2f527854f0b782d7e0645")
endif()
endif()
endif()
+else()
+ message("Using the Orthanc framework from a path of the filesystem. Assuming
mainline version.")
+ set(ORTHANC_FRAMEWORK_MAJOR 999)
+ set(ORTHANC_FRAMEWORK_MINOR 999)
+ set(ORTHANC_FRAMEWORK_REVISION 999)
endif()
@@ -189,7 +220,7 @@
else()
message("Forking the Orthanc source repository using Mercurial")
execute_process(
- COMMAND ${ORTHANC_FRAMEWORK_HG} clone
"https://bitbucket.org/sjodogne/orthanc"
+ COMMAND ${ORTHANC_FRAMEWORK_HG} clone
"https://hg.orthanc-server.com/orthanc/"
WORKING_DIRECTORY ${CMAKE_BINARY_DIR}
RESULT_VARIABLE Failure
)
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore'
old/OrthancWebViewer-2.5/Resources/Orthanc/LinuxStandardBaseToolchain.cmake
new/OrthancWebViewer-2.6/Resources/Orthanc/LinuxStandardBaseToolchain.cmake
--- old/OrthancWebViewer-2.5/Resources/Orthanc/LinuxStandardBaseToolchain.cmake
2019-02-27 17:20:45.000000000 +0100
+++ new/OrthancWebViewer-2.6/Resources/Orthanc/LinuxStandardBaseToolchain.cmake
2020-05-26 09:12:07.000000000 +0200
@@ -1,11 +1,19 @@
-# LSB_CC=gcc-4.8 LSB_CXX=g++-4.8 cmake .. -DCMAKE_BUILD_TYPE=Debug
-DCMAKE_TOOLCHAIN_FILE=../Resources/LinuxStandardBaseToolchain.cmake
-DUSE_LEGACY_JSONCPP=ON -DUSE_LEGACY_LIBICU=ON -DBOOST_LOCALE_BACKEND=icu
+#
+# Full build, as used on the BuildBot CIS:
+#
+# $ LSB_CC=gcc-4.8 LSB_CXX=g++-4.8 cmake .. -DCMAKE_BUILD_TYPE=Debug
-DCMAKE_TOOLCHAIN_FILE=../Resources/LinuxStandardBaseToolchain.cmake
-DUSE_LEGACY_JSONCPP=ON -DUSE_LEGACY_LIBICU=ON -DBOOST_LOCALE_BACKEND=icu
-DENABLE_PKCS11=ON -G Ninja
+#
+# Or, more lightweight version (without libp11 and ICU):
+#
+# $ LSB_CC=gcc-4.8 LSB_CXX=g++-4.8 cmake .. -DCMAKE_BUILD_TYPE=Debug
-DCMAKE_TOOLCHAIN_FILE=../Resources/LinuxStandardBaseToolchain.cmake
-DUSE_LEGACY_JSONCPP=ON -G Ninja
+#
INCLUDE(CMakeForceCompiler)
-SET(LSB_PATH $ENV{LSB_PATH})
-SET(LSB_CC $ENV{LSB_CC})
-SET(LSB_CXX $ENV{LSB_CXX})
-SET(LSB_TARGET_VERSION "4.0")
+SET(LSB_PATH $ENV{LSB_PATH} CACHE STRING "")
+SET(LSB_CC $ENV{LSB_CC} CACHE STRING "")
+SET(LSB_CXX $ENV{LSB_CXX} CACHE STRING "")
+SET(LSB_TARGET_VERSION "4.0" CACHE STRING "")
IF ("${LSB_PATH}" STREQUAL "")
SET(LSB_PATH "/opt/lsb")
@@ -31,7 +39,12 @@
# which compilers to use for C and C++
SET(CMAKE_C_COMPILER ${LSB_PATH}/bin/lsbcc)
-CMAKE_FORCE_CXX_COMPILER(${LSB_PATH}/bin/lsbc++ GNU)
+
+if (${CMAKE_VERSION} VERSION_LESS "3.6.0")
+ CMAKE_FORCE_CXX_COMPILER(${LSB_PATH}/bin/lsbc++ GNU)
+else()
+ SET(CMAKE_CXX_COMPILER ${LSB_PATH}/bin/lsbc++)
+endif()
# here is the target environment located
SET(CMAKE_FIND_ROOT_PATH ${LSB_PATH})
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/OrthancWebViewer-2.5/Resources/OrthancExplorer.js
new/OrthancWebViewer-2.6/Resources/OrthancExplorer.js
--- old/OrthancWebViewer-2.5/Resources/OrthancExplorer.js 2019-02-27
17:20:45.000000000 +0100
+++ new/OrthancWebViewer-2.6/Resources/OrthancExplorer.js 2020-05-26
09:12:07.000000000 +0200
@@ -11,8 +11,16 @@
b.insertBefore($('#series-delete').parent().parent());
b.click(function() {
if ($.mobile.pageData) {
- var series = $.mobile.pageData.uuid;
- window.open('../web-viewer/app/viewer.html?series=' + series);
+ var urlSearchParams = {
+ "series" : $.mobile.pageData.uuid
+ };
+ if ("authorizationTokens" in window) {
+ for (var token in authorizationTokens) {
+ urlSearchParams[token] = authorizationTokens[token];
+ }
+ }
+
+ window.open('../web-viewer/app/viewer.html?' + $.param(urlSearchParams));
}
});
});
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/OrthancWebViewer-2.5/Resources/SyncOrthancFolder.py
new/OrthancWebViewer-2.6/Resources/SyncOrthancFolder.py
--- old/OrthancWebViewer-2.5/Resources/SyncOrthancFolder.py 2019-02-27
17:20:45.000000000 +0100
+++ new/OrthancWebViewer-2.6/Resources/SyncOrthancFolder.py 2020-05-26
09:12:07.000000000 +0200
@@ -12,7 +12,7 @@
TARGET = os.path.join(os.path.dirname(__file__), 'Orthanc')
PLUGIN_SDK_VERSION = '0.9.5'
-REPOSITORY = 'https://bitbucket.org/sjodogne/orthanc/raw'
+REPOSITORY = 'https://hg.orthanc-server.com/orthanc/raw-file'
FILES = [
'DownloadOrthancFramework.cmake',
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore'
old/OrthancWebViewer-2.5/Resources/holy-build-box-compile.sh
new/OrthancWebViewer-2.6/Resources/holy-build-box-compile.sh
--- old/OrthancWebViewer-2.5/Resources/holy-build-box-compile.sh
1970-01-01 01:00:00.000000000 +0100
+++ new/OrthancWebViewer-2.6/Resources/holy-build-box-compile.sh
2020-05-26 09:12:07.000000000 +0200
@@ -0,0 +1,36 @@
+#!/bin/bash
+
+##
+## This script compiles cross-distribution Linux binaries thanks to
+## Holy Build Box: https://github.com/phusion/holy-build-box
+##
+## The ideal solution would be to use Linux Standard Base
+## (LSB). Unfortunately, the LSB C++ compiler is a pre-4.8 gcc that
+## does not feature full C++11 capabilities, which prevents compiling
+## GDCM >= 3.0.
+##
+
+set -ex
+
+if [ "$1" != "Debug" -a "$1" != "Release" ]; then
+ echo "Please provide build type: Debug or Release"
+ exit -1
+fi
+
+if [ -t 1 ]; then
+ # TTY is available => use interactive mode
+ DOCKER_FLAGS='-i'
+fi
+
+ROOT_DIR=`dirname $(readlink -f $0)`/..
+
+mkdir -p ${ROOT_DIR}/holy-build-box
+
+docker run -t ${DOCKER_FLAGS} --rm \
+ --user $(id -u):$(id -g) \
+ -v ${ROOT_DIR}:/source:ro \
+ -v ${ROOT_DIR}/holy-build-box:/target:rw \
+ phusion/holy-build-box-64:2.0.1 \
+ bash /source/Resources/holy-build-box-internal.sh $1
+
+ls -lR ${ROOT_DIR}/holy-build-box/
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore'
old/OrthancWebViewer-2.5/Resources/holy-build-box-internal.sh
new/OrthancWebViewer-2.6/Resources/holy-build-box-internal.sh
--- old/OrthancWebViewer-2.5/Resources/holy-build-box-internal.sh
1970-01-01 01:00:00.000000000 +0100
+++ new/OrthancWebViewer-2.6/Resources/holy-build-box-internal.sh
2020-05-26 09:12:07.000000000 +0200
@@ -0,0 +1,42 @@
+#!/bin/bash
+set -e
+
+# Activate Holy Build Box environment.
+source /hbb_exe/activate
+
+set -x
+
+mkdir /tmp/build
+cd /tmp/build
+
+# Holy Build Box defines LDFLAGS as "-L/hbb_exe/lib
+# -static-libstdc++". The "-L/hbb_exe/lib" option results in linking
+# errors "undefined reference" to `std::__once_callable',
+# 'std::__once_call' and '__once_proxy'.
+export LDFLAGS=-static-libstdc++
+unset LDPATHFLAGS
+unset SHLIB_LDFLAGS
+unset LD_LIBRARY_PATH
+unset LIBRARY_PATH
+
+mkdir /tmp/source-writeable
+
+cp -r /source/CMakeLists.txt /tmp/source-writeable/
+cp -r /source/Plugin /tmp/source-writeable/
+cp -r /source/Resources /tmp/source-writeable/
+cp -r /source/UnitTestsSources /tmp/source-writeable/
+cp -r /source/WebApplication /tmp/source-writeable/
+
+cmake /tmp/source-writeable \
+ -DCMAKE_BUILD_TYPE=$1 -DSTATIC_BUILD=ON \
+ -DORTHANC_FRAMEWORK_SOURCE=web \
+ -DORTHANC_FRAMEWORK_VERSION=1.6.1 \
+ -DCMAKE_INSTALL_PREFIX=/target
+
+make -j`nproc`
+
+if [ "$1" == "Release" ]; then
+ strip ./libOrthancWebViewer.so
+fi
+
+make install
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore'
old/OrthancWebViewer-2.5/UnitTestsSources/UnitTestsMain.cpp
new/OrthancWebViewer-2.6/UnitTestsSources/UnitTestsMain.cpp
--- old/OrthancWebViewer-2.5/UnitTestsSources/UnitTestsMain.cpp 2019-02-27
17:20:45.000000000 +0100
+++ new/OrthancWebViewer-2.6/UnitTestsSources/UnitTestsMain.cpp 2020-05-26
09:12:07.000000000 +0200
@@ -2,7 +2,7 @@
* Orthanc - A Lightweight, RESTful DICOM Store
* Copyright (C) 2012-2016 Sebastien Jodogne, Medical Physics
* Department, University Hospital of Liege, Belgium
- * Copyright (C) 2017-2019 Osimis S.A., Belgium
+ * Copyright (C) 2017-2020 Osimis S.A., Belgium
*
* This program is free software: you can redistribute it and/or
* modify it under the terms of the GNU Affero General Public License
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/OrthancWebViewer-2.5/WebApplication/viewer.js
new/OrthancWebViewer-2.6/WebApplication/viewer.js
--- old/OrthancWebViewer-2.5/WebApplication/viewer.js 2019-02-27
17:20:45.000000000 +0100
+++ new/OrthancWebViewer-2.6/WebApplication/viewer.js 2020-05-26
09:12:07.000000000 +0200
@@ -2,7 +2,7 @@
* Orthanc - A Lightweight, RESTful DICOM Store
* Copyright (C) 2012-2016 Sebastien Jodogne, Medical Physics
* Department, University Hospital of Liege, Belgium
- * Copyright (C) 2017-2019 Osimis S.A., Belgium
+ * Copyright (C) 2017-2020 Osimis S.A., Belgium
*
* This program is free software: you can redistribute it and/or
* modify it under the terms of the GNU Affero General Public License
@@ -23,6 +23,7 @@
var compression = 'jpeg95';
var isFirst = true;
//var compression = 'deflate';
+var unsupportedMessage = 'Error: The Orthanc core does not support the
decoding of this image. Make sure that you have properly installed a suitable
decoder plugin (e.g. the official GDCM decoder plugin).';
// Prevent the access to IE
@@ -32,6 +33,31 @@
}
+function GetAuthorizationTokensFromUrl() {
+ var urlVariables = window.location.search.substring(1).split('&');
+ var dict = {};
+
+ for (var i = 0; i < urlVariables.length; i++) {
+ var split = urlVariables[i].split('=');
+
+ if (split.length == 2 && (split[0] == "token" || split[0] ==
"auth-token" || split[0] == "authorization")) {
+ dict[split[0]] = split[1];
+ }
+ }
+ return dict;
+};
+
+var authorizationTokens = GetAuthorizationTokensFromUrl();
+
+/* Copy the authoziation toekn from the url search parameters into HTTP
headers in every request to the Rest API.
+Thanks to this behaviour, you may specify a ?token=xxx in your url and this
will be passed
+as the "token" header in every request to the API allowing you to use the
authorization plugin */
+$.ajaxSetup(
+ {
+ headers : authorizationTokens
+ }
+);
+
function ResizeCornerstone()
{
$('#dicomImage').height($(window).height() - $('#slider').parent().height());
@@ -358,7 +384,7 @@
result = image;
},
error: function() {
- alert('Error: This image is not supported by the Web viewer.');
+ alert(unsupportedMessage);
return null;
}
});
@@ -405,7 +431,7 @@
}
},
failure: function() {
- alert('Error: This image is not supported by the Web viewer.');
+ alert(unsupportedMessage);
}
});
++++++ _service ++++++
<services>
<service name="download_files" mode="localonly" />
</services>