Mercurial > hg > orthanc-webviewer
changeset 241:ca7986c480a6 transcoding
integration mainline->transcoding
author | Sebastien Jodogne <s.jodogne@gmail.com> |
---|---|
date | Mon, 25 May 2020 14:08:17 +0200 |
parents | f18f6e7269b3 (diff) 40a433acf26a (current diff) |
children | 1d761296eb8d |
files | CMakeLists.txt |
diffstat | 9 files changed, 29 insertions(+), 378 deletions(-) [+] |
line wrap: on
line diff
--- a/CMakeLists.txt Mon May 25 12:52:17 2020 +0200 +++ b/CMakeLists.txt Mon May 25 14:08:17 2020 +0200 @@ -24,8 +24,7 @@ set(ORTHANC_PLUGIN_VERSION "mainline") if (ORTHANC_PLUGIN_VERSION STREQUAL "mainline") - # TODO - Switch to "mainline" after "transcoding" is made the new "default" - set(ORTHANC_FRAMEWORK_DEFAULT_VERSION "1.6.1") + set(ORTHANC_FRAMEWORK_DEFAULT_VERSION "mainline") set(ORTHANC_FRAMEWORK_DEFAULT_SOURCE "hg") else() set(ORTHANC_FRAMEWORK_DEFAULT_VERSION "1.6.1") @@ -43,7 +42,6 @@ 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") @@ -61,7 +59,6 @@ include_directories(${ORTHANC_ROOT}) -include(${CMAKE_SOURCE_DIR}/Resources/CMake/GdcmConfiguration.cmake) include(${CMAKE_SOURCE_DIR}/Resources/CMake/JavaScriptLibraries.cmake) @@ -123,11 +120,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 @@ -141,25 +133,14 @@ add_library(OrthancWebViewer SHARED + ${AUTOGENERATED_SOURCES} + ${CMAKE_SOURCE_DIR}/Plugin/DecodedImageAdapter.cpp + ${CMAKE_SOURCE_DIR}/Plugin/Plugin.cpp ${CORE_SOURCES} - ${AUTOGENERATED_SOURCES} - ${CMAKE_SOURCE_DIR}/Plugin/Plugin.cpp ${ORTHANC_ROOT}/Plugins/Samples/Common/OrthancPluginCppWrapper.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 ) -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}")
--- a/NEWS Mon May 25 12:52:17 2020 +0200 +++ b/NEWS Mon May 25 14:08:17 2020 +0200 @@ -1,10 +1,13 @@ Pending changes in the mainline =============================== -* 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 GDCM 3.0.4 for static builds +* Move the GDCM decoder out of the Orthanc Web viewer plugin as a separate plugin +* 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 * Upgraded Orthanc framework to 1.6.1
--- a/Plugin/DecodedImageAdapter.cpp Mon May 25 12:52:17 2020 +0200 +++ b/Plugin/DecodedImageAdapter.cpp Mon May 25 14:08:17 2020 +0200 @@ -125,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; @@ -138,7 +137,6 @@ return false; } - bool ok = false; Json::Value tags; @@ -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; } }
--- a/Plugin/Plugin.cpp Mon May 25 12:52:17 2020 +0200 +++ b/Plugin/Plugin.cpp Mon May 25 14:08:17 2020 +0200 @@ -29,7 +29,6 @@ #include <Core/SystemToolbox.h> #include <Core/Toolbox.h> #include <Plugins/Samples/Common/OrthancPluginCppWrapper.h> -#include <Plugins/Samples/GdcmDecoder/GdcmDecoderCache.h> #include <boost/thread.hpp> #include <boost/lexical_cast.hpp> @@ -57,8 +56,6 @@ static OrthancPluginContext* context_ = NULL; -static bool restrictTransferSyntaxes_ = false; -static std::set<std::string> enabledTransferSyntaxes_; class CacheContext @@ -89,7 +86,6 @@ Orthanc::SharedMessageQueue newInstances_; bool stop_; boost::thread newInstancesThread_; - OrthancPlugins::GdcmDecoderCache decoder_; static void NewInstancesThread(CacheContext* cache) { @@ -148,11 +144,6 @@ { newInstances_.Enqueue(new DynamicString(instanceId)); } - - OrthancPlugins::GdcmDecoderCache& GetDecoder() - { - return decoder_; - } }; @@ -349,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::unique_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) { @@ -500,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 || @@ -570,6 +397,7 @@ using namespace OrthancPlugins; OrthancPlugins::SetGlobalContext(context); + Orthanc::Logging::Initialize(context); context_ = context; assert(DisplayPerformanceWarning()); OrthancPluginLogWarning(context_, "Initializing the Web viewer"); @@ -598,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"); @@ -693,19 +518,6 @@ } - /* 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 */ OrthancPluginRegisterRestCallbackNoLock(context_, "/web-viewer/series/(.*)", ServeCache<CacheBundle_SeriesInformation>); OrthancPluginRegisterRestCallbackNoLock(context_, "/web-viewer/is-stable-series/(.*)", IsStableSeries);
--- a/README Mon May 25 12:52:17 2020 +0200 +++ b/README Mon May 25 14:08:17 2020 +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 <chafey@gmail.com>: +https://github.com/chafey/cornerstone -* Cornerstone, a client-side JavaScript library to display medical - images in Web browsers, by Chris Hafey <chafey@gmail.com>: - https://github.com/chafey/cornerstone - -* GDCM, an open-source implementation of the DICOM standard with - advanced features for image decoding, by Mathieu Malaterre - <mathieu.malaterre@gmail.com>: - http://sourceforge.net/projects/gdcm/ +In releases < 3.0, this plugin was also implementing primitives to +decode DICOM images using GDCM in Orthanc. Starting with release 3.0, +these primitives are available as part of the "orthanc-gdcm" plugin: +http://sourceforge.net/projects/gdcm/ Installation and usage
--- a/Resources/BuildInstructions.txt Mon May 25 12:52:17 2020 +0200 +++ b/Resources/BuildInstructions.txt Mon May 25 14:08:17 2020 +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
--- a/Resources/CMake/GdcmConfiguration.cmake Mon May 25 12:52:17 2020 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,141 +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-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 -# 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(AdditionalCFlags "-fPIC") - set(AdditionalCxxFlags ${AdditionalCFlags}) - elseif (${CMAKE_SYSTEM_NAME} STREQUAL "Windows" AND - CMAKE_COMPILER_IS_GNUCXX) - # Prevents error: "jump to label ‘err’ crosses initialization" of some variable - # within "Source/Common/gdcmCAPICryptographicMessageSyntax.cxx" if using MinGW - set(AdditionalCxxFlags "-fpermissive") - elseif (${CMAKE_SYSTEM_NAME} STREQUAL "OpenBSD") - # This definition is necessary to compile - # "Source/MediaStorageAndFileFormat/gdcmFileStreamer.cxx" - set(AdditionalCFlags "-Doff64_t=off_t") - set(AdditionalCxxFlags ${AdditionalCFlags}) - endif() - - set(Flags - "-DCMAKE_C_FLAGS=${CMAKE_C_FLAGS} ${AdditionalCFlags}" - "-DCMAKE_CXX_FLAGS=${CMAKE_CXX_FLAGS} ${AdditionalCxxFlags}" - -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-3.0.4.tar.gz" - URL_MD5 "f12dbded708356d5fa0b5ed37ccdb66e" - 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()
--- a/Resources/holy-build-box-internal.sh Mon May 25 12:52:17 2020 +0200 +++ b/Resources/holy-build-box-internal.sh Mon May 25 14:08:17 2020 +0200 @@ -30,7 +30,7 @@ cmake /tmp/source-writeable \ -DCMAKE_BUILD_TYPE=$1 -DSTATIC_BUILD=ON \ -DORTHANC_FRAMEWORK_SOURCE=web \ - -DORTHANC_FRAMEWORK_VERSION=1.5.8 \ + -DORTHANC_FRAMEWORK_VERSION=1.6.1 \ -DCMAKE_INSTALL_PREFIX=/target make -j`nproc`
--- a/WebApplication/viewer.js Mon May 25 12:52:17 2020 +0200 +++ b/WebApplication/viewer.js Mon May 25 14:08:17 2020 +0200 @@ -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 @@ -383,7 +384,7 @@ result = image; }, error: function() { - alert('Error: This image is not supported by the Web viewer.'); + alert(unsupportedMessage); return null; } }); @@ -430,7 +431,7 @@ } }, failure: function() { - alert('Error: This image is not supported by the Web viewer.'); + alert(unsupportedMessage); } });