Commit 8a123245 authored by Sebastien Jodogne's avatar Sebastien Jodogne
Browse files

New upstream version 0.5+dfsg

parent 0e0f2ec6
Loading
Loading
Loading
Loading
+4 −4
Original line number Diff line number Diff line
repo: d5f45924411123cfd02d035fd50b8e37536eadef
node: f58f8d749b95d85a792e786a0256d0cc2278cc4d
branch: OrthancDicomWeb-0.4
node: b5f71018159133105d5cc1eb60d852a385bab998
branch: OrthancDicomWeb-0.5
latesttag: null
latesttagdistance: 179
changessincelatesttag: 189
latesttagdistance: 210
changessincelatesttag: 221
+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
+40 −47
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,47 +21,50 @@ cmake_minimum_required(VERSION 2.8)

project(OrthancDicomWeb)

set(ORTHANC_DICOM_WEB_VERSION "0.4")
set(ORTHANC_DICOM_WEB_VERSION "0.5")

if (ORTHANC_DICOM_WEB_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(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_ZLIB ON CACHE BOOL "Use the system version of zlib")
set(USE_SYSTEM_PUGIXML ON CACHE BOOL "Use the system version of Pugixml")
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(USE_PUGIXML ON)
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(${ORTHANC_ROOT}/Resources/CMake/Compiler.cmake)
include(${ORTHANC_ROOT}/Resources/CMake/DownloadPackage.cmake)

include(${ORTHANC_ROOT}/Resources/CMake/BoostConfiguration.cmake)
include(${ORTHANC_ROOT}/Resources/CMake/GoogleTestConfiguration.cmake)
include(${ORTHANC_ROOT}/Resources/CMake/JsonCppConfiguration.cmake)
include(${ORTHANC_ROOT}/Resources/CMake/ZlibConfiguration.cmake)
include(${ORTHANC_ROOT}/Resources/CMake/PugixmlConfiguration.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 ON)         # Enable support for locales (notably in Boost)
set(ENABLE_GOOGLE_TEST ON)
set(ENABLE_PUGIXML ON)
set(USE_BOOST_ICONV ON)

include(${ORTHANC_ROOT}/Resources/CMake/OrthancFrameworkConfiguration.cmake)
include_directories(${ORTHANC_ROOT})


include(${CMAKE_SOURCE_DIR}/Resources/CMake/GdcmConfiguration.cmake)


if (STATIC_BUILD OR NOT USE_SYSTEM_ORTHANC_SDK)
  include_directories(${ORTHANC_ROOT}/Sdk-1.1.0)
  include_directories(${CMAKE_SOURCE_DIR}/Resources/Orthanc/Sdk-1.1.0)
else ()
  CHECK_INCLUDE_FILE_CXX(orthanc/OrthancCPlugin.h HAVE_ORTHANC_H)
  if (NOT HAVE_ORTHANC_H)
@@ -100,32 +103,19 @@ if (APPLE)
endif()


include_directories(${ORTHANC_ROOT}/Core)  # To access "OrthancException.h"

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

include_directories(${ORTHANC_ROOT}/Core)  # To access "OrthancException.h"

set(CORE_SOURCES
  ${BOOST_SOURCES}
  ${JSONCPP_SOURCES}
  ${ZLIB_SOURCES}
  ${PUGIXML_SOURCES}

  ${ORTHANC_ROOT}/Core/ChunkedBuffer.cpp
  ${ORTHANC_ROOT}/Core/Enumerations.cpp
  ${ORTHANC_ROOT}/Core/Toolbox.cpp
  ${ORTHANC_ROOT}/Core/SystemToolbox.cpp
  ${ORTHANC_ROOT}/Core/WebServiceParameters.cpp
  ${ORTHANC_ROOT}/Plugins/Samples/Common/OrthancPluginCppWrapper.cpp

  Plugin/Configuration.cpp
  Plugin/Dicom.cpp
  Plugin/DicomResults.cpp

  ${ORTHANC_ROOT}/Plugins/Samples/Common/OrthancPluginCppWrapper.cpp
  ${ORTHANC_CORE_SOURCES}
  )

add_library(OrthancDicomWeb SHARED ${CORE_SOURCES}
@@ -159,12 +149,15 @@ install(

add_executable(UnitTests
  ${CORE_SOURCES}
  ${GTEST_SOURCES}
  ${GOOGLE_TEST_SOURCES}
  ${CMAKE_SOURCE_DIR}/Plugin/DicomWebServers.cpp
  UnitTestsSources/UnitTestsMain.cpp
  )

target_link_libraries(UnitTests ${GDCM_LIBRARIES})
target_link_libraries(UnitTests
  ${GDCM_LIBRARIES}
  ${GOOGLE_TEST_LIBRARIES}
  )

if (STATIC_BUILD OR NOT USE_SYSTEM_GDCM)
  add_dependencies(OrthancDicomWeb GDCM)
+14 −0
Original line number Diff line number Diff line
@@ -2,6 +2,20 @@ Pending changes in the mainline
===============================


Version 0.5 (2018-08-19)
========================

* New option: "QidoCaseSensitive" to make queries to QIDO-RS server case insensitive
* Defaults to JSON answers instead of XML
* Use of "application/dicom+json" MIME type instead of "application/json"
* Added "?expand" argument to "/servers" route
* Fix generation of numeric tags part of sequences for ".../metadata" routes
* Support for OpenBSD
* Support for Linux Standard Base
* Upgrade to GDCM 2.8.4 for static builds
* Resort to Orthanc framework


Version 0.4 (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