Skip to content

Commit

Permalink
Merge branch 'master' into debian
Browse files Browse the repository at this point in the history
  • Loading branch information
lamyj committed Jan 12, 2016
2 parents 56353e1 + e315100 commit e3881c2
Show file tree
Hide file tree
Showing 282 changed files with 20,970 additions and 5,530 deletions.
6 changes: 3 additions & 3 deletions .travis.yml
@@ -1,16 +1,15 @@
sudo: false
sudo: required
dist: trusty
language: cpp
compiler:
- gcc
- clang
addons:
apt:
packages:
- libdcmtk2-dev
- libwrap0-dev
- libjsoncpp-dev
- libicu-dev
- uuid-dev
- zlib1g-dev
- libboost-dev
- libboost-filesystem-dev
Expand All @@ -28,6 +27,7 @@ before_script:
- cmake -D CMAKE_CXX_FLAGS:STRING="${CMAKE_CXX_FLAGS}" -D CMAKE_BUILD_TYPE:STRING=Debug ../
script:
- make -j $(nproc)
- export PATH=$PWD/tests/tools:$PATH
- ../tests/run.sh
after_success:
- if [ "${CC}" = "gcc" ]; then ${HOME}/.local/bin/coveralls --exclude examples --exclude tests --exclude-pattern '.*CMake[^/]+\.c(?:pp)?' --exclude-pattern "/usr/.*" --root=${SRC_DIR} --build-root ${BIN_DIR} | grep -vP "^File '.*'$" | grep -vP ":creating '.*'$" | grep -vP "^Lines executed:.*" | sed '/^$/d'; fi
24 changes: 18 additions & 6 deletions CMakeLists.txt
@@ -1,11 +1,11 @@
cmake_minimum_required(VERSION 2.8)

project("dcmtkpp")
set(dcmtkpp_MAJOR_VERSION 0)
set(dcmtkpp_MINOR_VERSION 3)
set(dcmtkpp_PATCH_VERSION 1)
set(dcmtkpp_VERSION
${dcmtkpp_MAJOR_VERSION}.${dcmtkpp_MINOR_VERSION}.${dcmtkpp_PATCH_VERSION})
project("odil")
set(odil_MAJOR_VERSION 0)
set(odil_MINOR_VERSION 4)
set(odil_PATCH_VERSION 0)
set(odil_VERSION
${odil_MAJOR_VERSION}.${odil_MINOR_VERSION}.${odil_PATCH_VERSION})

option(BUILD_EXAMPLES "Build the examples directory." ON)

Expand All @@ -21,3 +21,15 @@ endif()
if(BUILD_TESTING)
add_subdirectory("tests")
endif()

add_custom_target(
CIIntegration ${CMAKE_COMMAND} -E echo "CI Integration"
SOURCES appveyor.yml .travis.yml)

add_custom_target(
Documentation ${CMAKE_COMMAND} -E echo "Documentation"
SOURCES Doxyfile LICENSE.txt README.md)

add_custom_target(
Registry ${CMAKE_COMMAND} -E echo "Registry"
SOURCES generate_registry registry.cpp.tmpl registry.h.tmpl)
4 changes: 2 additions & 2 deletions Doxyfile
Expand Up @@ -26,7 +26,7 @@ DOXYFILE_ENCODING = UTF-8
# identify the project. Note that if you do not use Doxywizard you need
# to put quotes around the project name if it contains spaces.

PROJECT_NAME = "dcmtkpp"
PROJECT_NAME = "odil"

# The PROJECT_NUMBER tag can be used to enter a project or revision number.
# This could be handy for archiving the generated documentation or
Expand Down Expand Up @@ -657,7 +657,7 @@ WARN_LOGFILE =
# directories like "/usr/src/myproject". Separate the files or directories
# with spaces.

INPUT = ./src/dcmtkpp
INPUT = ./src/odil

# This tag can be used to specify the character encoding of the source files
# that doxygen parses. Internally doxygen uses the UTF-8 encoding, which is
Expand Down
32 changes: 32 additions & 0 deletions FindDCMTK.cmake
@@ -0,0 +1,32 @@
# - Try to find DCMTK
# Once done this will define
# DCMTK_FOUND - System has DCMTK
# DCMTK_INCLUDE_DIRS - The DCMTK include directories
# DCMTK_LIBRARY_DIRS - The DCMTK link directories
# DCMTK_LIBRARIES - The libraries needed to use DCMTK
# DCMTK_DEFINITIONS - Compiler switches required for using DCMTK

set(DCMTK_DEFINITIONS "-D HAVE_CONFIG_H")

find_path(DCMTK_INCLUDE_DIR "dcmtk/dcmdata/dctk.h")
find_library(DCMTK_LIBRARY dcmdata)

set(DCMTK_INCLUDE_DIRS ${DCMTK_INCLUDE_DIR})

set(DCMTK_LIBRARIES ${DCMTK_LIBRARY} dcmnet dcmdata oflog ofstd)
foreach(library iconv pthread wrap z)
find_library(${library}_LIBRARY ${library})
if(${library}_LIBRARY)
set(DCMTK_LIBRARIES ${DCMTK_LIBRARIES} ${${library}_LIBRARY})
endif()
endforeach()

get_filename_component(DCMTK_LIBRARY_DIRS "${DCMTK_LIBRARY}" PATH)

include(FindPackageHandleStandardArgs)
# handle the QUIETLY and REQUIRED arguments and set DCMTK_FOUND to TRUE
# if all listed variables are TRUE
find_package_handle_standard_args(
DCMTK DEFAULT_MSG DCMTK_INCLUDE_DIR DCMTK_LIBRARY)

mark_as_advanced(DCMTK_INCLUDE_DIR DCMTK_LIBRARY)
26 changes: 21 additions & 5 deletions FindICU.cmake
@@ -1,7 +1,23 @@
find_path(ICU_INCLUDE_DIR "unicode/ucnv.h")
# icucore is for OS X
find_library(ICU_LIBRARIES NAMES icuuc icucore)
# - Try to find ICU
# Once done this will define
# ICU_FOUND - System has ICU
# ICU_INCLUDE_DIRS - The ICU include directories
# ICU_LIBRARIES - The libraries needed to use ICU
# ICU_DEFINITIONS - Compiler switches required for using ICU

find_package(PkgConfig)
pkg_check_modules(PC_ICU QUIET icu-uc)
set(ICU_DEFINITIONS ${PC_ICU_CFLAGS_OTHER})

find_path(ICU_INCLUDE_DIR "unicode/ucnv.h" HINTS ${PC_ICU_INCLUDE_DIRS})
find_library(ICU_LIBRARY NAMES icuuc HINTS ${PC_ICU_LIBRARY_DIRS} )

set(ICU_LIBRARIES ${ICU_LIBRARY} )
set(ICU_INCLUDE_DIRS ${ICU_INCLUDE_DIR} )

include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(ICU DEFAULT_MSG
ICU_INCLUDE_DIR ICU_LIBRARIES)
# handle the QUIETLY and REQUIRED arguments and set ICU_FOUND to TRUE
# if all listed variables are TRUE
find_package_handle_standard_args(ICU DEFAULT_MSG ICU_LIBRARY ICU_INCLUDE_DIR)

mark_as_advanced(ICU_INCLUDE_DIR ICU_LIBRARY)
24 changes: 24 additions & 0 deletions FindJsonCpp.cmake
@@ -0,0 +1,24 @@
# - Try to find JsonCpp
# Once done this will define
# JsonCpp_FOUND - System has JsonCpp
# JsonCpp_INCLUDE_DIRS - The JsonCpp include directories
# JsonCpp_LIBRARIES - The libraries needed to use JsonCpp
# JsonCpp_DEFINITIONS - Compiler switches required for using JsonCpp

find_package(PkgConfig)
pkg_check_modules(PC_JsonCpp QUIET jsoncpp)
set(JsonCpp_DEFINITIONS ${PC_JsonCpp_CFLAGS_OTHER})

find_path(JsonCpp_INCLUDE_DIR "json/json.h" HINTS ${PC_JsonCpp_INCLUDE_DIRS})
find_library(JsonCpp_LIBRARY NAMES jsoncpp HINTS ${PC_JsonCpp_LIBRARY_DIRS} )

set(JsonCpp_LIBRARIES ${JsonCpp_LIBRARY} )
set(JsonCpp_INCLUDE_DIRS ${JsonCpp_INCLUDE_DIR} )

include(FindPackageHandleStandardArgs)
# handle the QUIETLY and REQUIRED arguments and set JsonCpp_FOUND to TRUE
# if all listed variables are TRUE
find_package_handle_standard_args(
JsonCpp DEFAULT_MSG JsonCpp_LIBRARY JsonCpp_INCLUDE_DIR)

mark_as_advanced(JsonCpp_INCLUDE_DIR JsonCpp_LIBRARY)
26 changes: 15 additions & 11 deletions README.md
@@ -1,16 +1,20 @@
DCMTK++
Odil
=======

DCMTK++ is a C++ wrapper library for the [DCMTK](http://dicom.offis.de/dcmtk.php.en)
DICOM toolkit.
Odil is a C++11 library for the [DICOM](http://dicom.nema.org/) standard.

DCMTK++ is a C++ wrapper library for [DCMTK](http://dicom.offis.de/dcmtk.php.en),
a C++ toolkit handling the DICOM medical imaging standard. DCMTK++
leverages C++ constructs to provide a more user-friendly API, notably
for the networking part. Included in DCMTK++ are exception-based error
handling, generic access to datasets elements, standard JSON
representation of datasets, and generic implementation of messages,
Odil leverages C++ constructs to provide a user-friendly API of the different
parts of the DICOM standard. Included in Odil are exception-based error
handling, generic access to datasets elements, standard JSON and XML
representation of datasets, and generic implementation of messages,
clients and servers for the various DICOM protocols.

[![Build Status](https://travis-ci.org/lamyj/dcmtkpp.svg?branch=master)](https://travis-ci.org/lamyj/dcmtkpp)
[![Coverage Status](https://coveralls.io/repos/lamyj/dcmtkpp/badge.svg)](https://coveralls.io/r/lamyj/dcmtkpp)
Odil also provides conversion to and from
[DCMTK](http://dicom.offis.de/dcmtk.php.en) data structures.

Odil builds and run on:
* Linux (Debian 7, Debian 8, Ubuntu 12.04, Ubuntu 14.04, both 32 and 64 bits)
* OS X

[![Build Status](https://travis-ci.org/lamyj/odil.svg?branch=master)](https://travis-ci.org/lamyj/odil)
[![Coverage Status](https://coveralls.io/repos/lamyj/odil/badge.svg)](https://coveralls.io/r/lamyj/odil)
52 changes: 52 additions & 0 deletions appveyor.full.yml
@@ -0,0 +1,52 @@
version: "{build}"

os: Visual Studio 2015

clone_folder: c:\projects\dcmtkpp

environment:
BOOST_ROOT: C:/Libraries/boost_1_59_0
BOOST_LIBRARYDIR: C:/Libraries/boost_1_59_0/lib64-msvc-14.0
ICU_INCLUDE_DIR: C:/Libraries/icu/include
ICU_LIBRARY: C:/Libraries/icu/lib64/icuuc.lib
JsonCpp_INCLUDE_DIR: c:/Libraries/jsoncpp_0_10_5/include
JsonCpp_LIBRARY: c:/Libraries/jsoncpp_0_10_5/lib/jsoncpp.lib
DCMTK_INCLUDE_DIR: C:/Libraries/dcmtk-3.6.1_20150924/include
DCMTK_LIBRARY: C:/Libraries/dcmtk-3.6.1_20150924/lib/dcmdata.lib

#init:
#- ps: iex ((new-object net.webclient).DownloadString('https://raw.githubusercontent.com/appveyor/ci/master/scripts/enable-rdp.ps1'))

install:
# ICU4C
- ps: Start-FileDownload http://download.icu-project.org/files/icu4c/56.1/icu4c-56_1-Win64-msvc10.zip
- 7z x -oC:\Libraries icu4c-56_1-Win64-msvc10.zip
# JsonCpp
- ps: Start-FileDownload https://github.com/open-source-parsers/jsoncpp/archive/0.10.5.zip
- 7z x -oC:\projects 0.10.5.zip
- cd C:\projects\jsoncpp-0.10.5
- mkdir build
- cd build
- cmake -D CMAKE_INSTALL_PREFIX=c:\Libraries\jsoncpp_0_10_5 ..
- cmake --build . --config release --target install
# DCMTK
- ps: Start-FileDownload http://dicom.offis.de/download/dcmtk/snapshot/dcmtk-3.6.1_20150924.tar.gz
- 7z x -so dcmtk-3.6.1_20150924.tar.gz | 7z x -si -oC:\projects -ttar
- cd C:\projects\dcmtk-3.6.1_20150924
- mkdir build
- cd build
- cmake -D CMAKE_INSTALL_PREFIX=c:\Libraries\dcmtk-3.6.1_20150924 ..
- cmake --build . --config release --target install

before_build:
- cd c:\projects\dcmtkpp
- md build
- cd build
- set PATH=C:\Program Files (x86)\MSBuild\14.0\Bin;%PATH%
- cmake -DBOOST_ROOT="%BOOST_ROOT%" -DBOOST_LIBRARYDIR="%BOOST_LIBRARYDIR%" -DICU_INCLUDE_DIR="%ICU_INCLUDE_DIR%" -DICU_LIBRARY="%ICU_LIBRARY%" -DJsonCpp_INCLUDE_DIR="%JsonCpp_INCLUDE_DIR%" -DJsonCpp_LIBRARY="%JsonCpp_LIBRARY%" -DDCMTK_INCLUDE_DIR="%DCMTK_INCLUDE_DIR%" -DDCMTK_LIBRARY="%DCMTK_LIBRARY%" ..

build:
project: C:\projects\dcmtkpp\build\dcmtkpp.sln

#on_finish:
#- ps: $blockRdp = $true; iex ((new-object net.webclient).DownloadString('https://raw.githubusercontent.com/appveyor/ci/master/scripts/enable-rdp.ps1'))
43 changes: 43 additions & 0 deletions appveyor.yml
@@ -0,0 +1,43 @@
version: "{build}"

os: Windows Server 2012 R2

clone_folder: c:\projects\odil

environment:
BOOST_ROOT: C:/Libraries/boost_1_59_0
BOOST_LIBRARYDIR: C:/Libraries/boost_1_59_0/lib64-msvc-14.0
ICU_INCLUDE_DIR: C:/Libraries/icu/include
ICU_LIBRARY: C:/Libraries/icu/lib64/icuuc.lib
JsonCpp_INCLUDE_DIR: c:/Libraries/jsoncpp_0_10_5/include
JsonCpp_LIBRARY: c:/Libraries/jsoncpp_0_10_5/lib/jsoncpp.lib
DCMTK_INCLUDE_DIR: C:/Libraries/dcmtk-3.6.1_20150924/include
DCMTK_LIBRARY: C:/Libraries/dcmtk-3.6.1_20150924/lib/dcmdata.lib

configuration:
- Release

install:
# ICU4C
- ps: Start-FileDownload http://download.icu-project.org/files/icu4c/56.1/icu4c-56_1-Win64-msvc10.zip
- 7z x -bd -oC:\Libraries icu4c-56_1-Win64-msvc10.zip
# JsonCpp
- ps: Start-FileDownload https://github.com/lamyj/jsoncpp/releases/download/0.10.5/jsoncpp_0_10_5_Win64_msvc14.zip
- 7z x -bd -oC:\Libraries jsoncpp_0_10_5_Win64_msvc14.zip
# DCMTK
- ps: Start-FileDownload https://github.com/lamyj/dcmtk/releases/download/DCMTK-3.6.1_20150924/dcmtk-3.6.1_20150924_Win64_msvc14.zip
- 7z x -bd -oC:\Libraries dcmtk-3.6.1_20150924_Win64_msvc14.zip

before_build:
- cd c:\projects\odil
- md build
- cd build
- cmake
-DBOOST_ROOT="%BOOST_ROOT%" -DBOOST_LIBRARYDIR="%BOOST_LIBRARYDIR%"
-DICU_INCLUDE_DIR="%ICU_INCLUDE_DIR%" -DICU_LIBRARY="%ICU_LIBRARY%"
-DJsonCpp_INCLUDE_DIR="%JsonCpp_INCLUDE_DIR%" -DJsonCpp_LIBRARY="%JsonCpp_LIBRARY%"
-DDCMTK_INCLUDE_DIR="%DCMTK_INCLUDE_DIR%" -DDCMTK_LIBRARY="%DCMTK_LIBRARY%"
..

build:
project: C:\projects\odil\build\odil.sln
12 changes: 9 additions & 3 deletions examples/CMakeLists.txt
@@ -1,11 +1,17 @@
add_definitions("-D HAVE_CONFIG_H")
find_package(DCMTK REQUIRED)
find_package(JsonCpp REQUIRED)

include_directories(${CMAKE_SOURCE_DIR}/src)
include_directories(${CMAKE_SOURCE_DIR}/src ${JsonCpp_INCLUDE_DIRS})
add_definitions(
${DCMTK_DEFINITIONS}
-D BOOST_ASIO_DYN_LINK
-D ODIL_MAJOR_VERSION=${odil_MAJOR_VERSION}
)

file(GLOB_RECURSE examples *.cpp)

foreach(example_file ${examples})
get_filename_component(example ${example_file} NAME_WE)
add_executable(${example} ${example_file})
target_link_libraries(${example} dcmtkpp dcmdata)
target_link_libraries(${example} odil)
endforeach()
14 changes: 7 additions & 7 deletions examples/dicomdir.cpp
@@ -1,20 +1,20 @@
#include <string>
#include <vector>

#include <dcmtkpp/BasicDirectoryCreator.h>
#include <dcmtkpp/registry.h>
#include <odil/BasicDirectoryCreator.h>
#include <odil/registry.h>

int main(int argc, char** argv)
{
std::string const root(argv[1]);
std::vector<std::string> const files(argv+2, argv+argc);

dcmtkpp::BasicDirectoryCreator creator(root, files,
odil::BasicDirectoryCreator creator(root, files,
{
{"PATIENT", { {dcmtkpp::registry::PatientBirthDate, 3} }},
{"STUDY", { {dcmtkpp::registry::PatientAge, 3} }},
{"SERIES", { {dcmtkpp::registry::SeriesDescription, 3} }},
{"IMAGE", { {dcmtkpp::registry::ImageType, 3} }},
{"PATIENT", { {odil::registry::PatientBirthDate, 3} }},
{"STUDY", { {odil::registry::PatientAge, 3} }},
{"SERIES", { {odil::registry::SeriesDescription, 3} }},
{"IMAGE", { {odil::registry::ImageType, 3} }},
});

creator();
Expand Down
18 changes: 9 additions & 9 deletions examples/dump.cpp
Expand Up @@ -4,9 +4,9 @@
#include <string>
#include <utility>

#include <dcmtkpp/DataSet.h>
#include <dcmtkpp/Reader.h>
#include <dcmtkpp/Value.h>
#include <odil/DataSet.h>
#include <odil/Reader.h>
#include <odil/Value.h>

struct Printer
{
Expand All @@ -30,7 +30,7 @@ struct Printer
}
}

void operator()(dcmtkpp::Value::DataSets const & value) const
void operator()(odil::Value::DataSets const & value) const
{
this->stream << "\n";

Expand All @@ -46,17 +46,17 @@ struct Printer
}
}

void operator()(dcmtkpp::Value::Binary const & value) const
void operator()(odil::Value::Binary const & value) const
{
this->stream << this->indent << "(binary)";
}

void operator()(dcmtkpp::DataSet const & data_set) const
void operator()(odil::DataSet const & data_set) const
{
for(auto const & item: data_set)
{
this->stream << this->indent << item.first << " " << as_string(item.second.vr) << " ";
dcmtkpp::apply_visitor(*this, item.second.get_value());
odil::apply_visitor(*this, item.second.get_value());
this->stream << "\n";
}
}
Expand All @@ -68,10 +68,10 @@ int main(int argc, char** argv)
{
std::ifstream stream(argv[i], std::ios::in | std::ios::binary);

std::pair<dcmtkpp::DataSet, dcmtkpp::DataSet> file;
std::pair<odil::DataSet, odil::DataSet> file;
try
{
file = dcmtkpp::Reader::read_file(stream);
file = odil::Reader::read_file(stream);
}
catch(std::exception & e)
{
Expand Down

0 comments on commit e3881c2

Please sign in to comment.