Commit e232e1ae authored by Sebastien Jodogne's avatar Sebastien Jodogne
Browse files

New upstream version 2.4

parent 5577ec6b
Loading
Loading
Loading
Loading
+4 −4
Original line number Diff line number Diff line
repo: 02f7a0400a911dee22d2e761b21b6cab67ede076
node: daab267593577f078bc63d5b6ab62eb89286b6d2
branch: OrthancWebViewer-2.3
node: 21df474deeb16a56724c0bb3758e56f95e3eff9c
branch: OrthancWebViewer-2.4
latesttag: null
latesttagdistance: 161
changessincelatesttag: 165
latesttagdistance: 196
changessincelatesttag: 200
+1 −1
Original line number Diff line number Diff line
@@ -14,7 +14,7 @@ Authors
  4000 Liege
  Belgium

* Osimis <info@osimis.io>
* Osimis S.A. <info@osimis.io>
  Rue des Chasseurs Ardennais 3
  4031 Liege 
  Belgium
+38 −68
Original line number Diff line number Diff line
# Orthanc - A Lightweight, RESTful DICOM Store
# Copyright (C) 2012-2016 Sebastien Jodogne, Medical Physics
# Department, University Hospital of Liege, Belgium
# Copyright (C) 2017 Osimis, Belgium
# Copyright (C) 2017-2018 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,39 +21,43 @@ cmake_minimum_required(VERSION 2.8)

project(OrthancWebViewer)

set(ORTHANC_WEBVIEWER_VERSION "2.3")
set(ORTHANC_WEBVIEWER_VERSION "2.4")

if (ORTHANC_WEBVIEWER_VERSION STREQUAL "mainline")
  set(ORTHANC_FRAMEWORK_VERSION "mainline")
  set(ORTHANC_FRAMEWORK_DEFAULT_SOURCE "hg")
else()
  set(ORTHANC_FRAMEWORK_VERSION "1.3.2")
  set(ORTHANC_FRAMEWORK_DEFAULT_SOURCE "web")
endif()


# Parameters of the build
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(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_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_BOOST ON CACHE BOOL "Use the system version of Boost")
set(USE_SYSTEM_GDCM ON CACHE BOOL "Use the system version of Grassroot DICOM (GDCM)")
set(USE_SYSTEM_GOOGLE_TEST ON CACHE BOOL "Use the system version of Google Test")
set(USE_SYSTEM_JSONCPP ON CACHE BOOL "Use the system version of JsonCpp")
set(USE_SYSTEM_SQLITE ON CACHE BOOL "Use the system version of SQLite")
set(USE_SYSTEM_ORTHANC_SDK ON CACHE BOOL "Use the system version of the Orthanc plugin SDK")

# Distribution-specific settings
set(USE_GTEST_DEBIAN_SOURCE_PACKAGE OFF CACHE BOOL "Use the sources of Google Test shipped with libgtest-dev (Debian only)")
mark_as_advanced(USE_GTEST_DEBIAN_SOURCE_PACKAGE)

set(ORTHANC_ROOT ${CMAKE_SOURCE_DIR}/Orthanc)
set(ORTHANC_DISABLE_PATCH ON)  # No need for the "patch" command-line tool
include(CheckIncludeFiles)
include(CheckIncludeFileCXX)
include(CheckLibraryExists)
include(FindPythonInterp)
include(${CMAKE_SOURCE_DIR}/Orthanc/Resources/CMake/Compiler.cmake)
include(${CMAKE_SOURCE_DIR}/Orthanc/Resources/CMake/AutoGeneratedCode.cmake)
include(${CMAKE_SOURCE_DIR}/Orthanc/Resources/CMake/DownloadPackage.cmake)

include(${CMAKE_SOURCE_DIR}/Orthanc/Resources/CMake/BoostConfiguration.cmake)
include(${CMAKE_SOURCE_DIR}/Orthanc/Resources/CMake/GoogleTestConfiguration.cmake)
include(${CMAKE_SOURCE_DIR}/Orthanc/Resources/CMake/JsonCppConfiguration.cmake)
include(${CMAKE_SOURCE_DIR}/Orthanc/Resources/CMake/SQLiteConfiguration.cmake)

# Download and setup the Orthanc framework
include(${CMAKE_SOURCE_DIR}/Resources/Orthanc/DownloadOrthancFramework.cmake)

set(ORTHANC_FRAMEWORK_PLUGIN ON)
include(${ORTHANC_ROOT}/Resources/CMake/OrthancFrameworkParameters.cmake)

set(ENABLE_LOCALE OFF)         # Disable support for locales (notably in Boost)
set(ENABLE_GOOGLE_TEST ON)
set(ENABLE_SQLITE ON)

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)
@@ -61,7 +65,7 @@ include(${CMAKE_SOURCE_DIR}/Resources/CMake/JavaScriptLibraries.cmake)

# Check that the Orthanc SDK headers are available
if (STATIC_BUILD OR NOT USE_SYSTEM_ORTHANC_SDK)
  include_directories(${ORTHANC_ROOT}/Sdk-0.9.5)
  include_directories(${CMAKE_SOURCE_DIR}/Resources/Orthanc/Sdk-0.9.5)
else ()
  CHECK_INCLUDE_FILE_CXX(orthanc/OrthancCPlugin.h HAVE_ORTHANC_H)
  if (NOT HAVE_ORTHANC_H)
@@ -90,12 +94,6 @@ EmbedResources(
  ${EMBEDDED_RESOURCES}
  )

add_definitions(
  -DORTHANC_ENABLE_PUGIXML=0
  -DORTHANC_SQLITE_STANDALONE=1
  )


if (${CMAKE_SYSTEM_NAME} STREQUAL "Linux" OR
    ${CMAKE_SYSTEM_NAME} STREQUAL "kFreeBSD" OR
    ${CMAKE_SYSTEM_NAME} STREQUAL "FreeBSD")
@@ -123,44 +121,15 @@ if (APPLE)
  SET(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -framework CoreFoundation")
endif()

add_definitions(
  -DORTHANC_ENABLE_MD5=0
  -DORTHANC_ENABLE_BASE64=0
  -DORTHANC_ENABLE_LOGGING=0
  -DORTHANC_SANDBOXED=0
  )

set(CORE_SOURCES
  ${BOOST_SOURCES}
  ${SQLITE_SOURCES}
  ${JSONCPP_SOURCES}

  # Sources inherited from Orthanc core
  ${CMAKE_SOURCE_DIR}/Orthanc/Core/ChunkedBuffer.cpp
  ${CMAKE_SOURCE_DIR}/Orthanc/Core/Enumerations.cpp
  ${CMAKE_SOURCE_DIR}/Orthanc/Core/FileStorage/FilesystemStorage.cpp
  ${CMAKE_SOURCE_DIR}/Orthanc/Core/Images/ImageAccessor.cpp
  ${CMAKE_SOURCE_DIR}/Orthanc/Core/Images/ImageBuffer.cpp
  ${CMAKE_SOURCE_DIR}/Orthanc/Core/Images/ImageProcessing.cpp
  ${CMAKE_SOURCE_DIR}/Orthanc/Core/MultiThreading/SharedMessageQueue.cpp
  ${CMAKE_SOURCE_DIR}/Orthanc/Core/SQLite/Connection.cpp
  ${CMAKE_SOURCE_DIR}/Orthanc/Core/SQLite/FunctionContext.cpp
  ${CMAKE_SOURCE_DIR}/Orthanc/Core/SQLite/Statement.cpp
  ${CMAKE_SOURCE_DIR}/Orthanc/Core/SQLite/StatementId.cpp
  ${CMAKE_SOURCE_DIR}/Orthanc/Core/SQLite/StatementReference.cpp
  ${CMAKE_SOURCE_DIR}/Orthanc/Core/SQLite/Transaction.cpp
  ${CMAKE_SOURCE_DIR}/Orthanc/Core/SystemToolbox.cpp
  ${CMAKE_SOURCE_DIR}/Orthanc/Core/Toolbox.cpp
  ${CMAKE_SOURCE_DIR}/Orthanc/Core/DicomFormat/DicomMap.cpp
  ${CMAKE_SOURCE_DIR}/Orthanc/Core/DicomFormat/DicomTag.cpp
  ${CMAKE_SOURCE_DIR}/Orthanc/Core/DicomFormat/DicomValue.cpp
  ${CMAKE_SOURCE_DIR}/Orthanc/Resources/ThirdParty/base64/base64.cpp

  ${CMAKE_SOURCE_DIR}/Plugin/Cache/CacheManager.cpp
  ${CMAKE_SOURCE_DIR}/Plugin/Cache/CacheScheduler.cpp
  ${CMAKE_SOURCE_DIR}/Plugin/ViewerToolbox.cpp
  ${CMAKE_SOURCE_DIR}/Plugin/ViewerPrefetchPolicy.cpp
  ${CMAKE_SOURCE_DIR}/Plugin/SeriesInformationAdapter.cpp
  
  ${ORTHANC_CORE_SOURCES}
  )

add_library(OrthancWebViewer
@@ -171,9 +140,9 @@ add_library(OrthancWebViewer

  # The following files depend on GDCM
  ${CMAKE_SOURCE_DIR}/Plugin/DecodedImageAdapter.cpp
  ${CMAKE_SOURCE_DIR}/Orthanc/Plugins/Samples/GdcmDecoder/GdcmImageDecoder.cpp
  ${CMAKE_SOURCE_DIR}/Orthanc/Plugins/Samples/GdcmDecoder/GdcmDecoderCache.cpp
  ${CMAKE_SOURCE_DIR}/Orthanc/Plugins/Samples/GdcmDecoder/OrthancImageWrapper.cpp
  ${ORTHANC_ROOT}/Plugins/Samples/GdcmDecoder/GdcmImageDecoder.cpp
  ${ORTHANC_ROOT}/Plugins/Samples/GdcmDecoder/GdcmDecoderCache.cpp
  ${ORTHANC_ROOT}/Plugins/Samples/GdcmDecoder/OrthancImageWrapper.cpp
  )


@@ -199,7 +168,8 @@ install(

add_executable(UnitTests
  ${CORE_SOURCES}
  ${GTEST_SOURCES}
  ${JSONCPP_SOURCES}
  ${GOOGLE_TEST_SOURCES}
  UnitTestsSources/UnitTestsMain.cpp
  )

target_link_libraries(UnitTests ${GOOGLE_TEST_LIBRARIES})
+13 −0
Original line number Diff line number Diff line
@@ -2,6 +2,19 @@ Pending changes in the mainline
===============================


Version 2.4 (2018-04-23)
========================

* Disable pinch zoom on mobile devices
* Fix download of DICOM instance from the toolbox
* Fix for Osimis issue WVB-319: Some images are not loading in US_MF
* 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
* Upgrade to GDCM 2.8.4 for static builds


Version 2.3 (2017-07-19)
========================

Orthanc/Core/ChunkedBuffer.cpp

deleted100644 → 0
+0 −103
Original line number Diff line number Diff line
/**
 * Orthanc - A Lightweight, RESTful DICOM Store
 * Copyright (C) 2012-2016 Sebastien Jodogne, Medical Physics
 * Department, University Hospital of Liege, Belgium
 * Copyright (C) 2017 Osimis, Belgium
 *
 * This program is free software: you can redistribute it and/or
 * modify it under the terms of the GNU General Public License as
 * published by the Free Software Foundation, either version 3 of the
 * License, or (at your option) any later version.
 *
 * In addition, as a special exception, the copyright holders of this
 * program give permission to link the code of its release with the
 * OpenSSL project's "OpenSSL" library (or with modified versions of it
 * that use the same license as the "OpenSSL" library), and distribute
 * the linked executables. You must obey the GNU General Public License
 * in all respects for all of the code used other than "OpenSSL". If you
 * modify file(s) with this exception, you may extend this exception to
 * your version of the file(s), but you are not obligated to do so. If
 * you do not wish to do so, delete this exception statement from your
 * version. If you delete this exception statement from all source files
 * in the program, then also delete it here.
 * 
 * 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
 * General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program. If not, see <http://www.gnu.org/licenses/>.
 **/


#include "PrecompiledHeaders.h"
#include "ChunkedBuffer.h"

#include <cassert>
#include <string.h>


namespace Orthanc
{
  void ChunkedBuffer::Clear()
  {
    numBytes_ = 0;

    for (Chunks::iterator it = chunks_.begin(); 
         it != chunks_.end(); ++it)
    {
      delete *it;
    }
  }


  void ChunkedBuffer::AddChunk(const void* chunkData,
                               size_t chunkSize)
  {
    if (chunkSize == 0)
    {
      return;
    }
    else
    {
      assert(chunkData != NULL);
      chunks_.push_back(new std::string(reinterpret_cast<const char*>(chunkData), chunkSize));
      numBytes_ += chunkSize;
    }
  }


  void ChunkedBuffer::AddChunk(const std::string& chunk)
  {
    if (chunk.size() > 0)
    {
      AddChunk(&chunk[0], chunk.size());
    }
  }


  void ChunkedBuffer::Flatten(std::string& result)
  {
    result.resize(numBytes_);

    size_t pos = 0;
    for (Chunks::iterator it = chunks_.begin(); 
         it != chunks_.end(); ++it)
    {
      assert(*it != NULL);

      size_t s = (*it)->size();
      if (s != 0)
      {
        memcpy(&result[pos], (*it)->c_str(), s);
        pos += s;
      }

      delete *it;
    }

    chunks_.clear();
    numBytes_ = 0;
  }
}
Loading