[med-svn] [gdcm] 01/09: Imported Upstream version 2.6.3

Gert Wollny gert-guest at moszumanska.debian.org
Sat Jan 30 21:48:13 UTC 2016


This is an automated email from the git hooks/post-receive script.

gert-guest pushed a commit to branch master
in repository gdcm.

commit 600fd4e1ba92eed61c6892920dff5dde50b62a82
Author: Gert Wollny <gw.fossdev at gmail.com>
Date:   Sat Jan 30 20:57:57 2016 +0100

    Imported Upstream version 2.6.3
---
 .travis.yml                                        | 62 +++++++++++++++++-----
 AUTHORS                                            |  2 +-
 CMake/FindJavaProperties.cmake                     |  2 +-
 CMake/FindOpenJPEG.cmake                           |  1 +
 CMake/FindUUID.cmake                               |  8 +--
 CMake/UseCSharp.cmake                              |  9 +++-
 CMake/UseJavaTest.cmake                            | 14 +++--
 CMake/UsePythonTest.cmake                          | 27 ++++++++--
 CMakeLists.txt                                     |  2 +-
 Copyright.txt                                      |  2 +-
 Examples/Csharp/DecompressImage.cs                 |  5 ++
 Examples/Java/CMakeLists.txt                       | 10 ++--
 Examples/Python/ConvertNumpy.py                    |  4 +-
 README.txt                                         | 20 +++----
 Source/Common/CMakeLists.txt                       |  6 +++
 Source/Common/gdcmBoxRegion.cxx                    |  2 +-
 Source/Common/gdcmConfigure.h.in                   |  1 +
 Source/Common/gdcmDummyValueGenerator.cxx          |  2 +-
 Source/Common/gdcmSystem.cxx                       | 57 ++------------------
 .../gdcmDataSet.h                                  | 19 ++++---
 .../DataStructureAndEncodingDefinition/gdcmVR.cxx  |  9 ++--
 Source/DataStructureAndEncodingDefinition/gdcmVR.h | 15 +++++-
 .../MediaStorageAndFileFormat/gdcmImageHelper.cxx  |  4 +-
 .../MediaStorageAndFileFormat/gdcmJPEGLSCodec.cxx  |  2 +-
 Source/MediaStorageAndFileFormat/gdcmJSON.cxx      | 32 +++++++----
 Source/MediaStorageAndFileFormat/gdcmRLECodec.cxx  |  2 +-
 Source/MediaStorageAndFileFormat/gdcmSegment.cxx   |  2 +-
 .../MediaStorageAndFileFormat/gdcmSerieHelper.cxx  |  2 +-
 .../MediaStorageAndFileFormat/gdcmStringFilter.cxx |  1 +
 .../gdcmSurfaceReader.cxx                          |  2 +-
 .../MediaStorageAndFileFormat/gdcmXMLPrinter.cxx   |  1 +
 Testing/Source/Common/Cxx/TestByteSwap.cxx         |  2 +-
 Testing/Source/Common/Cxx/TestSystem1.cxx          |  2 +-
 Testing/Source/Common/Python/CMakeLists.txt        |  8 ++-
 Testing/Source/Common/Python/TestDirectory.py      |  2 +-
 Testing/Source/Common/Python/TestTesting.py        |  2 +-
 .../Java/CMakeLists.txt                            | 11 ++--
 .../Python/CMakeLists.txt                          |  7 ++-
 .../Python/TestReader.py                           | 14 ++---
 .../Python/TestTag.py                              |  2 +-
 .../Cxx/TestPhotometricInterpretation.cxx          |  2 +-
 .../Python/CMakeLists.txt                          | 23 +++++---
 .../Python/TestAnonymizer.py                       | 22 ++++----
 .../Python/TestDCMTKMD5.py                         |  8 +--
 .../Python/TestIPPSorter.py                        |  2 +-
 .../Python/TestImageReader.py                      |  8 +--
 .../Python/TestKakaduDecompressionMD5.py           | 10 ++--
 .../Python/TestModifyFields.py                     | 14 ++---
 .../Python/TestOrientation.py                      | 10 ++--
 .../Python/TestPythonFilter.py                     | 12 ++---
 .../Python/TestStringFilter.py                     | 12 ++---
 .../Cxx/TestFindPatientRootQuery.cxx               |  2 +-
 .../Cxx/TestFindStudyRootQuery.cxx                 |  2 +-
 Utilities/VTK/CMakeLists.txt                       |  6 ++-
 .../VTK/Testing/Python/TestvtkGDCMImageWriter.py   |  2 +-
 .../Python/TestvtkGDCMThreadedImageReader.py       |  6 +--
 .../Python/TestvtkGDCMThreadedImageReader2.py      |  2 +-
 Utilities/VTK/vtkGDCMThreadedImageReader.cxx       |  8 +--
 Utilities/doxygen/CMakeLists.txt                   | 35 +++++++++++-
 Utilities/doxygen/man/gdcm2pnm.xml                 |  2 +-
 Utilities/doxygen/man/gdcm2vtk.xml                 |  2 +-
 Utilities/doxygen/man/gdcmanon.xml                 |  2 +-
 Utilities/doxygen/man/gdcmconv.xml                 |  2 +-
 Utilities/doxygen/man/gdcmdiff.xml                 |  2 +-
 Utilities/doxygen/man/gdcmdump.xml                 |  2 +-
 Utilities/doxygen/man/gdcmgendir.xml               |  2 +-
 Utilities/doxygen/man/gdcmimg.xml                  |  2 +-
 Utilities/doxygen/man/gdcminfo.xml                 |  2 +-
 Utilities/doxygen/man/gdcmpap3.xml                 |  2 +-
 Utilities/doxygen/man/gdcmpdf.xml                  |  2 +-
 Utilities/doxygen/man/gdcmraw.xml                  |  2 +-
 Utilities/doxygen/man/gdcmscanner.xml              |  2 +-
 Utilities/doxygen/man/gdcmscu.xml                  |  2 +-
 Utilities/doxygen/man/gdcmtar.xml                  |  2 +-
 Utilities/doxygen/man/gdcmviewer.xml               |  2 +-
 Utilities/doxygen/man/gdcmxml.xml                  |  2 +-
 Utilities/doxygen/vtk/CMakeLists.txt               |  8 ++-
 Utilities/gdcmopenjpeg-v1/libopenjpeg/t2.c         |  6 ++-
 Utilities/gdcmzlib/gzio.c                          |  4 +-
 Wrapping/Csharp/gdcm.i                             |  6 +++
 Wrapping/Java/CMakeLists.txt                       | 15 +++---
 Wrapping/Java/gdcm.i                               | 17 ++++++
 Wrapping/Python/CMakeLists.txt                     |  7 +++
 Wrapping/Python/TestWrap.py                        | 15 ++++++
 Wrapping/Python/gdcmPythonFilter.h                 |  2 +-
 Wrapping/Python/gdcmswig.i                         | 13 ++++-
 appveyor.yml                                       | 52 ++++++++++++------
 87 files changed, 468 insertions(+), 274 deletions(-)

diff --git a/.travis.yml b/.travis.yml
index 9c3b659..5657d4b 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -1,3 +1,5 @@
+# https://docs.travis-ci.com/user/environment-variables/#Default-Environment-Variables
+# https://github.com/travis-ci/travis-ci/issues/3505
 language: cpp
 # Use the faster container-based infrastructure.
 sudo: false
@@ -5,33 +7,44 @@ env:
   global:
    # The next declaration is the encrypted COVERITY_SCAN_TOKEN, created
    #   via the "travis encrypt" command using the project repo's public key
-   - secure: "ClIqhtIIfQPhil8GH9bnJg70rvJfuYs7Z2Aq2SrdwQsIFNvvfFD5pVxQiaYbZI3nxNclggQ50BmGB96e6jLxbbd/xlIOjcU19W2nzyP6LGkXFHDHm8FwhqqDNpfYvirAOfqgjqf7khRe3ajF33jhrLrhb5QOO5640N93pdChu1sAvI0LZv8JFIUcN7A7To3+WYc7H4CK3U8B2V8nzqcBSHDZNBGAdeVdmldwrlBtQeWBg5wJAEzzUHn0x+kltqvuoPYi2ShpaUkEfHeUWYhOT1uoyXNRAqHXiM1jhiw3JCkqaf7sUKLzyx0ozjTnYntNMggtBzavKjuYg6RhdlNdNbdsi2nxrycCOyCZcF+d4limq+yDMqoP7g/DnPag7XFgjkG/ThULPu+pEK/6nV1NqGNWFu1CqgAwPW7hGbIUADPsMEb+Bz2L2KUof2wU1cdvGK4fzsM9Qpdipbagghn4b5eGtvyBzY [...]
+   - secure: ClIqhtIIfQPhil8GH9bnJg70rvJfuYs7Z2Aq2SrdwQsIFNvvfFD5pVxQiaYbZI3nxNclggQ50BmGB96e6jLxbbd/xlIOjcU19W2nzyP6LGkXFHDHm8FwhqqDNpfYvirAOfqgjqf7khRe3ajF33jhrLrhb5QOO5640N93pdChu1sAvI0LZv8JFIUcN7A7To3+WYc7H4CK3U8B2V8nzqcBSHDZNBGAdeVdmldwrlBtQeWBg5wJAEzzUHn0x+kltqvuoPYi2ShpaUkEfHeUWYhOT1uoyXNRAqHXiM1jhiw3JCkqaf7sUKLzyx0ozjTnYntNMggtBzavKjuYg6RhdlNdNbdsi2nxrycCOyCZcF+d4limq+yDMqoP7g/DnPag7XFgjkG/ThULPu+pEK/6nV1NqGNWFu1CqgAwPW7hGbIUADPsMEb+Bz2L2KUof2wU1cdvGK4fzsM9Qpdipbagghn4b5eGtvyBzYz [...]
 
 # -m32 is not supported 
 # no poppler, openjpeg, uuid, json
 # no swig
+
+# using debian-sid I get:
+# /usr/bin/ld: BFD (GNU Binutils for Ubuntu) 2.22 internal error, aborting at
+#  ../../bfd/reloc.c line 443 in bfd_get_reloc_size
 matrix:
   fast_finish: true
   include:
     - compiler: gcc
       os: linux
       env:
+        - CFLAGS="-g -O2"
+        - CXXFLAGS="-g -O2"
+        - B_NAME=default
+    - compiler: gcc
+      os: linux
+      addons: {apt: {packages: [default-jdk, mono-devel, swig, libcharls-dev, libvtk5-dev, libopenjpeg-dev, libexpat-dev, libz-dev, uuid-dev, python-all-dev, libpoppler-dev, xsltproc, dcmtk]}}
+      env:
         - CFLAGS="-Wall -Wextra -m64"
         - CXXFLAGS="-Wall -Wextra -m64"
-        - CMAKE_EXTRA="-DGDCM_USE_SYSTEM_OPENSSL:BOOL=ON -DGDCM_WRAP_PYTHON:BOOL=OFF -DGDCM_WRAP_CSHARP:BOOL=OFF -DGDCM_WRAP_JAVA:BOOL=OFF -DGDCM_WRAP_PHP:BOOL=OFF -DGDCM_USE_SYSTEM_EXPAT:BOOL=ON -DGDCM_USE_SYSTEM_JSON:BOOL=OFF -DGDCM_USE_SYSTEM_LIBXML2:BOOL=ON -DGDCM_USE_SYSTEM_OPENJPEG:BOOL=OFF -DGDCM_USE_SYSTEM_POPPLER:BOOL=OFF -DGDCM_USE_SYSTEM_UUID:BOOL=OFF -DGDCM_USE_SYSTEM_ZLIB:BOOL=ON"
+        - CMAKE_EXTRA="-DGDCM_USE_SYSTEM_OPENSSL:BOOL=ON -DGDCM_WRAP_PYTHON:BOOL=ON -DGDCM_WRAP_CSHARP:BOOL=ON -DGDCM_WRAP_JAVA:BOOL=ON -DGDCM_WRAP_PHP:BOOL=OFF -DGDCM_USE_SYSTEM_EXPAT:BOOL=ON -DGDCM_USE_SYSTEM_JSON:BOOL=OFF -DGDCM_USE_SYSTEM_LIBXML2:BOOL=ON -DGDCM_USE_SYSTEM_OPENJPEG:BOOL=ON -DGDCM_USE_SYSTEM_POPPLER:BOOL=ON -DGDCM_USE_SYSTEM_UUID:BOOL=ON -DGDCM_USE_SYSTEM_ZLIB:BOOL=ON -DGDCM_WEAK_SWIG_CHECK:BOOL=ON -DGDCM_LEGACY_SILENT:BOOL=ON"
         - B_NAME=system
     - compiler: clang
       os: linux
       env:
-        - CFLAGS="-Wall -Wextra -m64 -fsanitize=address,undefined,shift"
-        - CXXFLAGS="-g -Wall -Wextra -m64 -fsanitize=address,undefined,shift"
+        - CFLAGS="-g -O0 -Wall -Wextra -m64 -fsanitize=address,undefined,shift"
+        - CXXFLAGS="-g -O0 -Wall -Wextra -m64 -fsanitize=address,undefined,shift"
         - B_NAME=fsanitize
     - compiler: clang
       os: osx
       env:
         - CFLAGS="-Wall -Wextra" # -m64 -fsanitize=address,undefined
         - CXXFLAGS="-Wall -Wextra" # -m64 -fsanitize=address,undefined
-        - B_NAME=fsanitize
+        - B_NAME=default
 
 before_install:
   #- env
@@ -39,25 +52,50 @@ before_install:
   #- swig -version
   # do not run the full test suite for now
   - mv Testing/Data Testing/Data.old
+  - if [ "$B_NAME" == "system" ]; then wget http://kakadusoftware.com/wp-content/uploads/2014/06/KDU77_Demo_Apps_for_Linux-x86-64_150710.zip; fi
+  - if [ "$B_NAME" == "system" ]; then unzip KDU77_Demo_Apps_for_Linux-x86-64_150710.zip; fi
+  - if [ "$B_NAME" == "system" ]; then export PATH=$PATH:$PWD/KDU77_Demo_Apps_for_Linux-x86-64_150710; fi
 install: true
-before_script: true
-script:
-  - cmake -Wno-dev -G "Unix Makefiles" -DCMAKE_BUILD_TYPE:STRING=None -DGDCM_BUILD_TESTING:BOOL=ON -DGDCM_BUILD_APPLICATIONS:BOOL=ON -DGDCM_BUILD_SHARED_LIBS:BOOL=ON -DGDCM_ALLOW_INSOURCE_BUILD:BOOL=ON -DBUILDNAME:STRING=${TRAVIS_OS_NAME}-${TRAVIS_BRANCH}-${B_NAME} ${CMAKE_EXTRA} .
+before_script:
+  - cmake -Wno-dev -G "Unix Makefiles" -DCMAKE_BUILD_TYPE:STRING=None -DGDCM_BUILD_TESTING:BOOL=ON -DGDCM_BUILD_APPLICATIONS:BOOL=ON -DGDCM_BUILD_SHARED_LIBS:BOOL=ON -DBUILDNAME:STRING=${TRAVIS_OS_NAME}-${TRAVIS_BRANCH}-${B_NAME} ${CMAKE_EXTRA} .
   - ctest -D ExperimentalStart
+script:
   - ctest -D ExperimentalBuild -j2
   - ctest -D ExperimentalTest -j2 || true
+after_success:
   - ctest -D ExperimentalSubmit || true
-
-after_success: true
+  # prefer after_success since before_deploy is not called (conditions unmet)
+  - cpack -G TGZ
+  - cpack -G TBZ2
 after_failure: true
+
+before_deploy:
+- VTAG=$(echo $TRAVIS_TAG | cut -f2 -dv)
+deploy:
+  edge: true
+  provider: releases
+  api_key:
+    secure: R5+dbibdcgPHq6cAPC8uepifDuS3yjZu2dBB2oSeQtBZTAeN1VIfJMrF8TeQDqj2GC28RHxXm4BHwdJ2FUpBXjOS2eUE6Mto1Rbbvfi63MREnFPIAWkNyLtR2Jxq/Gzb8X05PbCWGwCNvX9eeo+qcWTpczuQvJ+/bds7MyRsk45+sUc+j7rglAbxewgijsXebCkObwaXmhqTYJwrvf2lyEnA2Jo1gL2WmK6iPjHvTOVS9JfBMqVRmlk7j8efnqag8fMCzNp1Ess5wBy5Jf58qvVs7RuuBi16s7vOOBtb9xVjcDB1KaAxc/dDQGQhRkrveBtH18ZpFrArOj6DBPbupS3+xuU4ywdYbCuGnvdpRFafBc+iNU4M81crkFUDmSPEQChBnL4wwpaYaQ1LlgdlF0r9/Rlu2/iqKe4t7rdZnkQqQ/3SNNf+x4AKnGmaSGasV/VUXstTGVrtl7hsDMzSdrVCXODao0SR [...]
+  file:
+  - GDCM-$VTAG-Linux-x86_64.tar.gz
+  - GDCM-$VTAG-Linux-x86_64.tar.bz2
+  skip_cleanup: true
+  on:
+    repo: malaterre/GDCM
+    condition: $B_NAME = default
+    all_branches: true
+    tags: true
+
+# final
 after_script: true
 
 addons:
   coverity_scan:
     project:
-      name: "malaterre/GDCM"
+      name: malaterre/GDCM
       description: "Grassroots DICOM"
     notification_email: mathieu.malaterre at gmail.com
-    build_command_prepend: cmake -G "Unix Makefiles" -DCMAKE_BUILD_TYPE:STRING=RelWithDebInfo -DGDCM_BUILD_SHARED_LIBS:BOOL=ON -DGDCM_ALLOW_INSOURCE_BUILD:BOOL=ON ..
+    build_command_prepend: cmake -G "Unix Makefiles" -DCMAKE_BUILD_TYPE:STRING=RelWithDebInfo
+      -DGDCM_BUILD_SHARED_LIBS:BOOL=ON ..
     build_command: cmake --build .
     branch_pattern: coverity_scan
diff --git a/AUTHORS b/AUTHORS
index b7516bc..e37e40b 100644
--- a/AUTHORS
+++ b/AUTHORS
@@ -18,7 +18,7 @@ GDCM 2.x:
        Jean-Pierre Roux              : Developer, maintain gdcmDataExtra
          Christina Rossmanith        : Contributor (Siemens CSA)
      Christopher W Treml             : Contributor (C#)
-              Joel Spaltenstein      : Developer (MacOSX)
+              Joel Spaltenstein      : Developer (Mac OS X)
 
 
 GDCM 1.x (Developpers and contributors, alphabetical order)
diff --git a/CMake/FindJavaProperties.cmake b/CMake/FindJavaProperties.cmake
index b60eb5d..10f28cf 100644
--- a/CMake/FindJavaProperties.cmake
+++ b/CMake/FindJavaProperties.cmake
@@ -57,7 +57,7 @@ if(${current_list_path}/GetSystemProperty.java IS_NEWER_THAN ${CMAKE_BINARY_DIR}
   #message("${current_list_path}/GetSystemProperty.java")
   #message("${CMAKE_CURRENT_BINARY_DIR}/GetSystemProperty.class")
   execute_process(
-    COMMAND ${Java_JAVAC_EXECUTABLE} -source 1.5 -target 1.5
+    COMMAND ${Java_JAVAC_EXECUTABLE} -source ${GDCM_JAVA_SOURCE_VERSION} -target ${GDCM_JAVA_TARGET_VERSION}
     ${current_list_path}/GetSystemProperty.java -d ${CMAKE_BINARY_DIR}
     WORKING_DIRECTORY ${CMAKE_BINARY_DIR}
     )
diff --git a/CMake/FindOpenJPEG.cmake b/CMake/FindOpenJPEG.cmake
index 26b169f..010f22c 100644
--- a/CMake/FindOpenJPEG.cmake
+++ b/CMake/FindOpenJPEG.cmake
@@ -20,6 +20,7 @@
 
 # Try first to locate a cmake config file
 find_package(OpenJPEG QUIET NO_MODULE)
+mark_as_advanced(OpenJPEG_DIR)
 
 if( NOT OpenJPEG_DIR )
 set(OPENJPEG_MAJOR_VERSION 1) # FIXME ?
diff --git a/CMake/FindUUID.cmake b/CMake/FindUUID.cmake
index 45c7244..f72ddca 100644
--- a/CMake/FindUUID.cmake
+++ b/CMake/FindUUID.cmake
@@ -7,18 +7,14 @@
 # also defined, but not for general use are
 #  UUID_LIBRARY, where to find the UUID library.
 #
-#  Copyright (c) 2006-2011 Mathieu Malaterre <mathieu.malaterre at gmail.com>
+#  Copyright (c) 2006-2016 Mathieu Malaterre <mathieu.malaterre at gmail.com>
 #
 #  Redistribution and use is allowed according to the terms of the New
 #  BSD license.
 #  For details see the accompanying COPYING-CMAKE-SCRIPTS file.
 #
 
-# On MacOSX we have:
-# $ nm -g /usr/lib/libSystem.dylib | grep uuid_generate
-# 000b3aeb T _uuid_generate
-# 0003e67e T _uuid_generate_random
-# 000b37a1 T _uuid_generate_time
+# On Mac OS X the uuid functions are in the System library.
 if(APPLE)
   set(UUID_LIBRARY_VAR System)
 else()
diff --git a/CMake/UseCSharp.cmake b/CMake/UseCSharp.cmake
index 3216b84..ed49a44 100644
--- a/CMake/UseCSharp.cmake
+++ b/CMake/UseCSharp.cmake
@@ -56,11 +56,16 @@ endif()
 if(WIN32)
 # There is a subttle issue when compiling on 64bits platform using a 32bits compiler
 # See bug ID: 3510023 (BadImageFormatException: An attempt was made to load a progr)
-
 set(CSC_ACCEPTS_PLATFORM_FLAG 0)
 
 if(CMAKE_CSHARP_COMPILER)
   execute_process(COMMAND "${CMAKE_CSHARP_COMPILER}" "/?" OUTPUT_VARIABLE CSC_HELP)
+  # get version (no /version, so use /help output):
+  if("${CSC_HELP}" MATCHES "Compiler version")
+    string(REGEX REPLACE ".*Compiler version ([0-9\\.]+).*" "\\1" VERSION_STRING 
+      "${CSC_HELP}")
+    message(STATUS "Comp version: ${VERSION_STRING}")
+  endif()
   # when cmd locale is in French it displays: "/platform:<chaine>" in english: "/platform:<string>"
   # so only regex match in /platform:
   if("${CSC_HELP}" MATCHES "/platform:")
@@ -175,7 +180,7 @@ macro(CSHARP_LINK_LIBRARIES name)
     ARGS ${CSHARP_EXECUTABLE_${name}_ARGS}
     WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
     #DEPENDS ${csharp_cs_sources}
-    COMMENT "Create HelloWorld.exe"
+    COMMENT "Create ${name}.exe"
   )
 
   #message("DEBUG2:${csharp_libraries_depends}")
diff --git a/CMake/UseJavaTest.cmake b/CMake/UseJavaTest.cmake
index a48998a..ea2ca65 100644
--- a/CMake/UseJavaTest.cmake
+++ b/CMake/UseJavaTest.cmake
@@ -18,6 +18,10 @@
 # UseCSharp.cmake
 
 macro(ADD_JAVA_TEST TESTNAME FILENAME)
+  set(_sep ":")
+  if(WIN32)
+    set(_sep "\\;")
+  endif()
   get_source_file_property(loc ${FILENAME}.class LOCATION)
   get_source_file_property(pyenv ${FILENAME}.class RUNTIMEPATH)
   get_source_file_property(theclasspath ${FILENAME}.class CLASSPATH)
@@ -36,7 +40,7 @@ macro(ADD_JAVA_TEST TESTNAME FILENAME)
     endif()
   else()
     if(pyenv)
-      set(pyenv ${pyenv}:${LIBRARY_OUTPUT_PATH})
+      set(pyenv ${pyenv}${_sep}${LIBRARY_OUTPUT_PATH})
     else()
       set(pyenv ${LIBRARY_OUTPUT_PATH})
     endif()
@@ -55,7 +59,7 @@ macro(ADD_JAVA_TEST TESTNAME FILENAME)
     set(ld_library_path ${theld_library_path})
   endif()
   if(pyenv)
-    set(ld_library_path ${ld_library_path}:${pyenv})
+    set(ld_library_path ${ld_library_path}${_sep}${pyenv})
   endif()
 
   file(WRITE ${CMAKE_CURRENT_BINARY_DIR}/${TESTNAME}.cmake
@@ -63,18 +67,20 @@ macro(ADD_JAVA_TEST TESTNAME FILENAME)
   if(UNIX)
   set(ENV{LD_LIBRARY_PATH} ${ld_library_path})
   set(ENV{DYLD_LIBRARY_PATH} ${ld_library_path})
-  #set(ENV{CLASSPATH} ${pyenv}/gdcm.jar:.)
-  message(\"pyenv: ${pyenv}\")
+  #set(ENV{CLASSPATH} ${pyenv}/gdcm.jar${_sep}.)
+  #message(\"pyenv: ${pyenv}\")
   else()
   #set(the_path $ENV{PATH})
   set(ENV{PATH} ${ld_library_path})
   endif()
+  message(\"ld_library_path: ${ld_library_path}\")
   message(\"loc: ${loc}\")
   message(\"loc2: ${loc2}\")
   message(\"classpath: ${classpath}\")
   message(\"java runtime: ${Java_JAVA_EXECUTABLE}\")
   #message( \"wo_semicolumn: ${wo_semicolumn}\" )
   execute_process(
+    #COMMAND ${Java_JAVA_EXECUTABLE} -Djava.library.path=\"${GDCM_LIBRARY_DIR}\" -classpath \"${classpath}\" ${loc2} ${wo_semicolumn}
     COMMAND ${Java_JAVA_EXECUTABLE} -classpath \"${classpath}\" ${loc2} ${wo_semicolumn}
     WORKING_DIRECTORY \"${EXECUTABLE_OUTPUT_PATH}\"
     RESULT_VARIABLE import_res
diff --git a/CMake/UsePythonTest.cmake b/CMake/UsePythonTest.cmake
index b9eca5a..7bf576c 100644
--- a/CMake/UsePythonTest.cmake
+++ b/CMake/UsePythonTest.cmake
@@ -24,6 +24,10 @@ find_package(PythonInterp REQUIRED)
 mark_as_advanced(PYTHON_EXECUTABLE)
 
 macro(ADD_PYTHON_TEST TESTNAME FILENAME)
+  set(_sep ":")
+  if(WIN32)
+    set(_sep "\\;")
+  endif()
   get_source_file_property(loc ${FILENAME} LOCATION)
   get_source_file_property(pyenv ${FILENAME} PYTHONPATH)
   if(CMAKE_CONFIGURATION_TYPES)
@@ -38,7 +42,7 @@ macro(ADD_PYTHON_TEST TESTNAME FILENAME)
     endif()
   else()
     if(pyenv)
-      set(pyenv ${pyenv}:${LIBRARY_OUTPUT_PATH})
+      set(pyenv ${pyenv}${_sep}${LIBRARY_OUTPUT_PATH})
     else()
       set(pyenv ${LIBRARY_OUTPUT_PATH})
     endif()
@@ -46,9 +50,11 @@ macro(ADD_PYTHON_TEST TESTNAME FILENAME)
   string(REGEX REPLACE ";" " " wo_semicolumn "${ARGN}")
   file(WRITE ${CMAKE_CURRENT_BINARY_DIR}/${TESTNAME}.cmake
 "
-  set(ENV{PYTHONPATH} ${pyenv}:\$ENV{PYTHONPATH})
-  set(ENV{LD_LIBRARY_PATH} ${pyenv}:\$ENV{LD_LIBRARY_PATH})
-  message(\"${pyenv}\")
+  set(ENV{PYTHONPATH} ${pyenv}${_sep}\$ENV{PYTHONPATH})
+  set(ENV{LD_LIBRARY_PATH} ${pyenv}${_sep}\$ENV{LD_LIBRARY_PATH})
+  message(\"pyenv is: ${pyenv}\")
+  message(\"py_exec is: ${PYTHON_EXECUTABLE}\")
+  message(\"py_found is: ${PYTHONINTERP_FOUND}\")
   execute_process(
     COMMAND ${PYTHON_EXECUTABLE} ${loc} ${wo_semicolumn}
     RESULT_VARIABLE import_res
@@ -58,9 +64,20 @@ macro(ADD_PYTHON_TEST TESTNAME FILENAME)
 
   # Pass the output back to ctest
   if(import_output)
-    message(\"\${import_output}\")
+    message(\"import_output is: \${import_output}\")
   endif()
   if(import_res)
+    message(\"Import res: \${import_res}\")
+    message(\"py_exec is: \${PYTHON_EXECUTABLE}\")
+    message(\"loc is: \${loc}\")
+    message(\"wo is: \${wo_semicolumn}\")
+    execute_process(
+      COMMAND ${PYTHON_EXECUTABLE} -v ${loc} ${wo_semicolumn}
+      RESULT_VARIABLE import2_res
+      OUTPUT_VARIABLE import2_output
+      ERROR_VARIABLE  import2_output
+      )
+    message(\"\${import2_output}\")
     message(SEND_ERROR \"\${import_res}\")
   endif()
 "
diff --git a/CMakeLists.txt b/CMakeLists.txt
index e33645a..a5175ff 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -32,7 +32,7 @@ set(GDCM_PACKAGE_CONTACT "GDCM Developers <gdcm-developers at lists.sourceforge.net
 #----------------------------------------------------------------------------
 set(GDCM_MAJOR_VERSION 2)
 set(GDCM_MINOR_VERSION 6)
-set(GDCM_BUILD_VERSION 2)
+set(GDCM_BUILD_VERSION 3)
 set(GDCM_VERSION
   "${GDCM_MAJOR_VERSION}.${GDCM_MINOR_VERSION}.${GDCM_BUILD_VERSION}")
 # let advanced user the option to define GDCM_API_VERSION:
diff --git a/Copyright.txt b/Copyright.txt
index 0f5435f..9623a3a 100644
--- a/Copyright.txt
+++ b/Copyright.txt
@@ -2,7 +2,7 @@
 
   Program: GDCM (Grassroots DICOM). A DICOM library
 
-Copyright (c) 2006-2011 Mathieu Malaterre
+Copyright (c) 2006-2016 Mathieu Malaterre
 Copyright (c) 1993-2005 CREATIS
 (CREATIS = Centre de Recherche et d'Applications en Traitement de l'Image)
 All rights reserved.
diff --git a/Examples/Csharp/DecompressImage.cs b/Examples/Csharp/DecompressImage.cs
index c5800b8..c1cb802 100644
--- a/Examples/Csharp/DecompressImage.cs
+++ b/Examples/Csharp/DecompressImage.cs
@@ -34,6 +34,11 @@ public class DecompressImage
       return 1;
       }
 
+    // check that one can access a Fragment from C#:
+    var de = reader.GetFile().GetDataSet().GetDataElement(new Tag(0x7fe0, 0x0010));
+    var sq = de.GetSequenceOfFragments();
+    sq.GetFragment(0);
+
     Image image = new Image();
     Image ir = reader.GetImage();
 
diff --git a/Examples/Java/CMakeLists.txt b/Examples/Java/CMakeLists.txt
index a36a8c0..aa86a72 100644
--- a/Examples/Java/CMakeLists.txt
+++ b/Examples/Java/CMakeLists.txt
@@ -19,13 +19,13 @@ set(examples
   )
 foreach(example ${examples})
   add_custom_command(
-    OUTPUT ${EXECUTABLE_OUTPUT_PATH}/${example}.class
-    COMMAND ${Java_JAVAC_EXECUTABLE} ARGS -source ${GDCM_JAVA_SOURCE_VERSION} -target ${GDCM_JAVA_TARGET_VERSION} ${CMAKE_CURRENT_SOURCE_DIR}/${example}.java -d ${EXECUTABLE_OUTPUT_PATH} -classpath ${LIBRARY_OUTPUT_PATH}/gdcm.jar
+    OUTPUT ${GDCM_EXECUTABLE_DIR}/${example}.class
+    COMMAND ${Java_JAVAC_EXECUTABLE} ARGS -source ${GDCM_JAVA_SOURCE_VERSION} -target ${GDCM_JAVA_TARGET_VERSION} ${CMAKE_CURRENT_SOURCE_DIR}/${example}.java -d ${GDCM_EXECUTABLE_DIR} -classpath ${GDCM_LIBRARY_DIR}/gdcm.jar
     WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
     DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/${example}.java
     COMMENT "javac ${example}.java"
     )
-  list(APPEND classfilesdep ${EXECUTABLE_OUTPUT_PATH}/${example}.class)
+  list(APPEND classfilesdep ${GDCM_EXECUTABLE_DIR}/${example}.class)
 endforeach()
 
 # 3. ok now add the target
@@ -38,7 +38,7 @@ add_dependencies(GDCMJavaExample GDCMJavaJar)
 
 if(BUILD_TESTING)
   if(GDCM_DATA_ROOT)
-    set_source_files_properties(${EXECUTABLE_OUTPUT_PATH}/HelloSimple.class PROPERTIES CLASSPATH "${EXECUTABLE_OUTPUT_PATH}/gdcm.jar")
-    ADD_JAVA_TEST(TestHelloSimpleJava ${EXECUTABLE_OUTPUT_PATH}/HelloSimple ${GDCM_DATA_ROOT}/012345.002.050.dcm)
+    set_source_files_properties(${GDCM_EXECUTABLE_DIR}/HelloSimple.class PROPERTIES CLASSPATH "${GDCM_LIBRARY_DIR}/gdcm.jar")
+    ADD_JAVA_TEST(TestHelloSimpleJava ${GDCM_EXECUTABLE_DIR}/HelloSimple ${GDCM_DATA_ROOT}/012345.002.050.dcm)
   endif()
 endif()
diff --git a/Examples/Python/ConvertNumpy.py b/Examples/Python/ConvertNumpy.py
index e9db128..608912f 100644
--- a/Examples/Python/ConvertNumpy.py
+++ b/Examples/Python/ConvertNumpy.py
@@ -27,8 +27,8 @@ import numpy
 
 def get_gdcm_to_numpy_typemap():
     """Returns the GDCM Pixel Format to numpy array type mapping."""
-    _gdcm_np = {gdcm.PixelFormat.UINT8  :numpy.int8,
-                gdcm.PixelFormat.INT8   :numpy.uint8,
+    _gdcm_np = {gdcm.PixelFormat.UINT8  :numpy.uint8,
+                gdcm.PixelFormat.INT8   :numpy.int8,
                 #gdcm.PixelFormat.UINT12 :numpy.uint12,
                 #gdcm.PixelFormat.INT12  :numpy.int12,
                 gdcm.PixelFormat.UINT16 :numpy.uint16,
diff --git a/README.txt b/README.txt
index 45b588c..0305a04 100644
--- a/README.txt
+++ b/README.txt
@@ -12,23 +12,23 @@ Just a quick note on the build process of GDCM. GDCM build process
 make use of the cmake software(*). This allow us:
 1. To get rid of the autoconf/autotools insanity
 2. Transparently generate Unix Makefiles, NMake Makefiles,
-VS8/9/10 Solution, XCode 2.1...
-3. Automatic nightly testing, one of the most important thing
-for a robust library/software devlpt process. GDCM devpt is develop
+VS8/9/10 Solution, Xcode projects, etc.
+3. Automatic nightly testing, one of the most important things
+for a robust library/software development process. GDCM development is develop
 based on the XP definition, and to preserve backward compatibility
 make sure that code is working from one release to another: each night
-we configure, we build and we test GDCM. The result are then send to
+we configure, we build and we test GDCM. The result are then sent to
 the dashboard located at:
 
-   http://public.kitware.com/dashboard.php?name=gdcm
+  https://open.cdash.org/index.php?project=GDCM
 
-A continuous dashboard make also sure that any commit did not introduce
-any error on another plateform, a warning or broke a test...
+A continuous dashboard also makes sure that any commit did not introduce
+any error on another platform, a warning or a broken test...
 
 Therefore you should be able to use GDCM from the bleeding edge without
-knowing too much on what is going on. All you need to do is have a look
-at the GDCM dashboard, and if your plateform is 'green' then you can
-update your git copy and compile safely knowing that there are very few chances
+knowing too much about what is going on. All you need to do is have a look
+at the GDCM dashboard, and if your platform is 'green' then you can
+update your git copy and compile safely knowing that there is very little chance
 that something won't work. Cheers !
 
 
diff --git a/Source/Common/CMakeLists.txt b/Source/Common/CMakeLists.txt
index a3b4218..b2ea721 100644
--- a/Source/Common/CMakeLists.txt
+++ b/Source/Common/CMakeLists.txt
@@ -55,6 +55,12 @@ check_function_exists(lround GDCM_HAVE_LROUND)
 
 #include(CheckSymbolExists)
 CHECK_FUNCTION_EXISTS(gettimeofday GDCM_HAVE_GETTIMEOFDAY)
+# json-c API changed:
+if(GDCM_USE_SYSTEM_JSON)
+  set(CMAKE_REQUIRED_INCLUDES ${JSON_INCLUDE_DIRS})
+  set(CMAKE_REQUIRED_LIBRARIES ${JSON_LIBRARIES})
+  CHECK_SYMBOL_EXISTS(json_object_object_get_ex "json.h" GDCM_HAVE_JSON_OBJECT_OBJECT_GET_EX)
+endif()
 
 include(CheckCXXSourceCompiles)
 CHECK_CXX_SOURCE_COMPILES(
diff --git a/Source/Common/gdcmBoxRegion.cxx b/Source/Common/gdcmBoxRegion.cxx
index f0d4960..b675a0d 100644
--- a/Source/Common/gdcmBoxRegion.cxx
+++ b/Source/Common/gdcmBoxRegion.cxx
@@ -102,7 +102,7 @@ size_t BoxRegion::Area() const
     // multiplication exceed range of unsigned
     return 0;
   }
-  return tmp * C;
+  return (size_t)(tmp * C);
 }
 
 unsigned int BoxRegion::GetXMin() const
diff --git a/Source/Common/gdcmConfigure.h.in b/Source/Common/gdcmConfigure.h.in
index 0f7ded0..41e1772 100644
--- a/Source/Common/gdcmConfigure.h.in
+++ b/Source/Common/gdcmConfigure.h.in
@@ -122,6 +122,7 @@
 #cmakedefine GDCM_HAVE__SNPRINTF
 #cmakedefine GDCM_HAVE_LROUND
 #cmakedefine GDCM_HAVE_GETTIMEOFDAY
+#cmakedefine GDCM_HAVE_JSON_OBJECT_OBJECT_GET_EX
 
 // MM: I have a feeling that if GDCM_HAVE_WCHAR_IFSTREAM, then UNICODE filename
 // are expected to be specified as UTF-16, but if no API exist for UTF-16
diff --git a/Source/Common/gdcmDummyValueGenerator.cxx b/Source/Common/gdcmDummyValueGenerator.cxx
index e7867ce..8e76f55 100644
--- a/Source/Common/gdcmDummyValueGenerator.cxx
+++ b/Source/Common/gdcmDummyValueGenerator.cxx
@@ -29,7 +29,7 @@ const char* DummyValueGenerator::Generate(const char *input)
   if( input )
     {
     // Cannot use MD5 as it has been broken multiple time (2005)
-    b = MD5::Compute(input, strlen(input), digest);
+    b = MD5::Compute(input, (unsigned long)strlen(input), digest);
     //b = SHA1::Compute(input, strlen(input), digest);
     }
 
diff --git a/Source/Common/gdcmSystem.cxx b/Source/Common/gdcmSystem.cxx
index 1f4c863..c975cdb 100644
--- a/Source/Common/gdcmSystem.cxx
+++ b/Source/Common/gdcmSystem.cxx
@@ -2,7 +2,7 @@
 
   Program: GDCM (Grassroots DICOM). A DICOM library
 
-  Copyright (c) 2006-2011 Mathieu Malaterre
+  Copyright (c) 2006-2016 Mathieu Malaterre
   All rights reserved.
   See Copyright.txt or http://gdcm.sourceforge.net/Copyright.html for details.
 
@@ -43,9 +43,7 @@
 #define snprintf _snprintf
 #endif
 #ifdef __APPLE__
-#include <CoreFoundation/CFBase.h>
-#include <CoreFoundation/CFBundle.h>
-#include <CoreFoundation/CFURL.h>
+#include <CoreFoundation/CoreFoundation.h>
 #endif // __APPLE__
 
 #if defined(_WIN32) && (defined(_MSC_VER) || defined(__WATCOMC__) ||defined(__BORLANDC__) || defined(__MINGW32__))
@@ -398,51 +396,6 @@ size_t System::FileSize(const char* filename)
   return size2;
 }
 
-#if 0
-const char *System::GetCurrentDataDirectory()
-{
-#ifdef _WIN32
-  static char path[MAX_PATH];
-  gdcm::Filename fn( GetCurrentProcessFileName() );
-  if ( !fn.IsEmpty() )
-    {
-    std::string str = fn.GetPath();
-    str += "/../" GDCM_INSTALL_DATA_DIR;
-    strcpy(path, str.c_str());
-    return path;
-    }
-#else
-
-  static char path[PATH_MAX];
-
-#ifdef __APPLE__
-  Boolean success = false;
-  CFURLRef pathURL = CFBundleCopyResourcesDirectoryURL(CFBundleGetMainBundle());
-  if (pathURL != NULL)
-    {
-    success = CFURLGetFileSystemRepresentation(pathURL, true /*resolveAgainstBase*/, (unsigned char*) path, PATH_MAX);
-    CFRelease(pathURL);
-    }
-  if (success)
-    {
-    strncat(path, "/" GDCM_INSTALL_DATA_DIR, PATH_MAX);
-    return path;
-    }
-#endif
-
-  gdcm::Filename fn( GetCurrentProcessFileName() );
-  if ( !fn.IsEmpty() )
-    {
-    std::string str = fn.GetPath();
-    str += "/../" GDCM_INSTALL_DATA_DIR;
-    strcpy(path, str.c_str());
-    return path;
-    }
-#endif
-  return 0;
-}
-#endif
-
 /*
  * TODO:
  * check cygwin
@@ -450,9 +403,6 @@ const char *System::GetCurrentDataDirectory()
  * check solaris
  * check hpux
  * check os2: DosGetInfoBlocks / DosQueryModuleName
- * check macosx :
- *  ProcessSerialNumber psn = {kNoProcess, kCurrentProcess};
- *  GetProcessInformation -> FSMakeFSSpec
  * ...
  */
 const char *System::GetCurrentProcessFileName()
@@ -464,7 +414,6 @@ const char *System::GetCurrentProcessFileName()
     return buf;
     }
 #elif defined(__APPLE__)
-  //  _NSGetExecutablePath()
   static char buf[PATH_MAX];
   Boolean success = false;
   CFURLRef pathURL = CFBundleCopyExecutableURL(CFBundleGetMainBundle());
@@ -544,7 +493,7 @@ const char *System::GetCurrentResourcesDirectory()
     }
   if (success)
     {
-    strncat(path, "/" GDCM_INSTALL_DATA_DIR, PATH_MAX);
+    strlcat(path, "/" GDCM_INSTALL_DATA_DIR, PATH_MAX);
     return path;
     }
 #endif
diff --git a/Source/DataStructureAndEncodingDefinition/gdcmDataSet.h b/Source/DataStructureAndEncodingDefinition/gdcmDataSet.h
index 82745a2..198ef58 100644
--- a/Source/DataStructureAndEncodingDefinition/gdcmDataSet.h
+++ b/Source/DataStructureAndEncodingDefinition/gdcmDataSet.h
@@ -149,19 +149,24 @@ public:
   /// Replace a dataelement with another one
   void Replace(const DataElement& de) {
     ConstIterator it = DES.find(de);
-    // detect loop:
-    gdcmAssertAlwaysMacro( &*it != &de );
-    if( it != DES.end() ) DES.erase(de);
+	if( it != DES.end() )
+	{
+	  // detect loop:
+	  gdcmAssertAlwaysMacro( &*it != &de );
+	  DES.erase(it);
+	}
     DES.insert(de);
   }
   /// Only replace a DICOM attribute when it is missing or empty
   void ReplaceEmpty(const DataElement& de) {
     ConstIterator it = DES.find(de);
-    // detect loop:
-    gdcmAssertAlwaysMacro( &*it != &de );
     if( it != DES.end() && it->IsEmpty() )
-      DES.erase(de);
-    DES.insert(de);
+    {
+      // detect loop:
+	  gdcmAssertAlwaysMacro( &*it != &de );
+	  DES.erase(it);
+    }
+	DES.insert(de);
   }
   /// Completely remove a dataelement from the dataset
   SizeType Remove(const Tag& tag) {
diff --git a/Source/DataStructureAndEncodingDefinition/gdcmVR.cxx b/Source/DataStructureAndEncodingDefinition/gdcmVR.cxx
index e0ea954..824801e 100644
--- a/Source/DataStructureAndEncodingDefinition/gdcmVR.cxx
+++ b/Source/DataStructureAndEncodingDefinition/gdcmVR.cxx
@@ -307,11 +307,14 @@ VR::VRType VR::GetVRTypeFromFile(const char *vr)
     std::lower_bound(start, end, vr, MySort());
   if( (*p)[0] != vr[0] || (*p)[1] != vr[1] )
     {
-    if( vr[0] >= 'A' && vr[0] <= 'Z'
-     && vr[1] >= 'A' && vr[1] <= 'Z' )
+    // https://groups.google.com/d/msg/comp.protocols.dicom/0ata_3lpjF4/xlkjOKRGBwAJ
+    // http://dicom.nema.org/medical/dicom/current/output/chtml/part05/chapter_E.html
+    if( vr[0] >= ' ' && vr[0] <= '~'
+     && vr[1] >= ' ' && vr[1] <= '~' ) // FIXME Control Char LF/FF/CR TAB and ESC should be accepted
       {
       // newly added VR ?
-      return VR::VL32;
+      // we are not capable of preserving the original VR. this is accepted behavior
+      return VR::UN;
       }
     return VR::INVALID;
     }
diff --git a/Source/DataStructureAndEncodingDefinition/gdcmVR.h b/Source/DataStructureAndEncodingDefinition/gdcmVR.h
index 8c6d513..fddb94e 100644
--- a/Source/DataStructureAndEncodingDefinition/gdcmVR.h
+++ b/Source/DataStructureAndEncodingDefinition/gdcmVR.h
@@ -152,8 +152,19 @@ public:
     is.read(vr, 2);
     VRField = GetVRTypeFromFile(vr);
     assert( VRField != VR::VR_END );
-    //assert( VRField != VR::INVALID );
-    if( VRField == VR::INVALID ) throw Exception( "INVALID VR" );
+    if( VRField == VR::INVALID )
+    {
+      // \0\2 Data/TheralysGDCM120Bug.dcm
+      // \0\0 Data/MR_Philips_Intera_PrivateSequenceExplicitVR_in_SQ_2001_e05f_item_wrong_lgt_use_NOSHADOWSEQ.dcm
+      // \0\4 Data/BugGDCM2_UndefItemWrongVL.dcm
+      // \44\0 Data/gdcm-MR-PHILIPS-16-Multi-Seq.dcm
+      // \0\20 Data/ExplicitVRforPublicElementsImplicitVRforShadowElements.dcm
+      // \0\3 Data/DMCPACS_ExplicitImplicit_BogusIOP.dcm
+      // \0\4 Data/THERALYS-12-MONO2-Uncompressed-Even_Length_Tag.dcm
+      // \0\4 Data/PrivateGEImplicitVRBigEndianTransferSyntax16Bits.dcm
+      // \0\4 Data/GE_DLX-8-MONO2-PrivateSyntax.dcm
+      throw Exception( "INVALID VR" );
+    }
     if( VRField & VL32 )
       {
 #if 0
diff --git a/Source/MediaStorageAndFileFormat/gdcmImageHelper.cxx b/Source/MediaStorageAndFileFormat/gdcmImageHelper.cxx
index e7bfd00..72109a0 100644
--- a/Source/MediaStorageAndFileFormat/gdcmImageHelper.cxx
+++ b/Source/MediaStorageAndFileFormat/gdcmImageHelper.cxx
@@ -961,7 +961,7 @@ std::vector<double> ImageHelper::GetRescaleInterceptSlopeValue(File const & f)
       {
         interceptslope[0] = el_ri.GetValue();
         interceptslope[1] = el_rs.GetValue();
-        gdcmWarningMacro( "PMS Modality LUT found for MR Image Storage: [" << interceptslope[0] << "," << interceptslope[1] << "]" );
+        gdcmWarningMacro( "PMS Modality LUT loaded for MR Image Storage: [" << interceptslope[0] << "," << interceptslope[1] << "]" );
       }
       }
     else
@@ -970,7 +970,7 @@ std::vector<double> ImageHelper::GetRescaleInterceptSlopeValue(File const & f)
       if( GetRescaleInterceptSlopeValueFromDataSet(ds, dummy) )
         {
         // for everyone else, read your DCS, and set: ForceRescaleInterceptSlope = true if needed
-        gdcmDebugMacro( "Modality LUT found for MR Image Storage: [" << dummy[0] << "," << dummy[1] << "]" );
+        gdcmDebugMacro( "Modality LUT unused for MR Image Storage: [" << dummy[0] << "," << dummy[1] << "]" );
         }
       }
 #endif
diff --git a/Source/MediaStorageAndFileFormat/gdcmJPEGLSCodec.cxx b/Source/MediaStorageAndFileFormat/gdcmJPEGLSCodec.cxx
index a56d6b1..abd0b09 100644
--- a/Source/MediaStorageAndFileFormat/gdcmJPEGLSCodec.cxx
+++ b/Source/MediaStorageAndFileFormat/gdcmJPEGLSCodec.cxx
@@ -564,7 +564,7 @@ bool JPEGLSCodec::AppendRowEncode( std::ostream & , const char * , size_t )
 bool JPEGLSCodec::AppendFrameEncode( std::ostream & out, const char * data, size_t datalen )
 {
   const unsigned int * dimensions = this->GetDimensions();
-  const PixelFormat & pf = this->GetPixelFormat();
+  const PixelFormat & pf = this->GetPixelFormat(); (void)pf;
   assert( datalen == dimensions[0] * dimensions[1] * pf.GetPixelSize() );
 
   std::vector<BYTE> rgbyteCompressed;
diff --git a/Source/MediaStorageAndFileFormat/gdcmJSON.cxx b/Source/MediaStorageAndFileFormat/gdcmJSON.cxx
index 9059914..b88bcea 100644
--- a/Source/MediaStorageAndFileFormat/gdcmJSON.cxx
+++ b/Source/MediaStorageAndFileFormat/gdcmJSON.cxx
@@ -21,6 +21,16 @@
 #include <json.h>
 #endif
 
+#ifdef GDCM_HAVE_JSON_OBJECT_OBJECT_GET_EX
+// https://github.com/json-c/json-c/issues/142
+static inline json_object * json_object_object_get_old(json_object * obj, const char * name) {
+    json_object * sub;
+    return json_object_object_get_ex(obj, name, & sub) ? sub : NULL;
+}
+#else
+#define json_object_object_get_old json_object_object_get
+#endif
+
 /*
  * Implementation is done based on Sup166, which may change in the future.
  */
@@ -576,14 +586,14 @@ static void ProcessJSONElement( const char *tag_str, json_object * obj, DataElem
 {
   json_type jtype = json_object_get_type( obj );
   assert( jtype == json_type_object );
-  json_object * jvr = json_object_object_get(obj, "VR");
+  json_object * jvr = json_object_object_get_old(obj, "VR");
 
   const char * vr_str = json_object_get_string ( jvr );
   de.GetTag().ReadFromContinuousString( tag_str );
   const char * pc_str = 0;
   if( de.GetTag().IsPrivate() && !de.GetTag().IsPrivateCreator() )
     {
-    json_object * jprivatecreator = json_object_object_get(obj, "PrivateCreator");
+    json_object * jprivatecreator = json_object_object_get_old(obj, "PrivateCreator");
     pc_str = json_object_get_string ( jprivatecreator );
     assert( pc_str );
     }
@@ -595,11 +605,11 @@ static void ProcessJSONElement( const char *tag_str, json_object * obj, DataElem
 
   if( vrtype == VR::SQ )
     {
-    json_object * jvalue = json_object_object_get(obj, "Value");
+    json_object * jvalue = json_object_object_get_old(obj, "Value");
     json_type jvaluetype = json_object_get_type( jvalue );
     assert( jvaluetype != json_type_null && jvaluetype == json_type_array  );
 #ifndef NDEBUG
-    json_object * jseq = json_object_object_get(obj, "Sequence");
+    json_object * jseq = json_object_object_get_old(obj, "Sequence");
     json_type jsqtype = json_object_get_type( jseq );
     assert( jsqtype == json_type_null );
 #endif
@@ -655,9 +665,9 @@ static void ProcessJSONElement( const char *tag_str, json_object * obj, DataElem
     with the value of "null". For example:
     "Value": [ null ]
 */
-    json_object * jvalue = json_object_object_get(obj, "Value");
+    json_object * jvalue = json_object_object_get_old(obj, "Value");
 #ifndef NDEBUG
-    json_object * jpn = json_object_object_get(obj, "PersonName");
+    json_object * jpn = json_object_object_get_old(obj, "PersonName");
     json_type jpntype = json_object_get_type( jpn );
     assert( jpntype == json_type_null );
 #endif
@@ -686,9 +696,9 @@ static void ProcessJSONElement( const char *tag_str, json_object * obj, DataElem
           case VR::PN:
               {
               json_object * jopn[3];
-              jopn[0] = json_object_object_get(value, "Alphabetic");
-              jopn[1]= json_object_object_get(value, "Ideographic");
-              jopn[2]= json_object_object_get(value, "Phonetic");
+              jopn[0] = json_object_object_get_old(value, "Alphabetic");
+              jopn[1]= json_object_object_get_old(value, "Ideographic");
+              jopn[2]= json_object_object_get_old(value, "Phonetic");
               for( int i = 0; i < 3; ++i )
                 {
                 const char *tmp = json_object_get_string ( jopn[i] );
@@ -740,9 +750,9 @@ static void ProcessJSONElement( const char *tag_str, json_object * obj, DataElem
     }
   else
     {
-    json_object * jvaluebin = json_object_object_get(obj, "InlineBinary");
+    json_object * jvaluebin = json_object_object_get_old(obj, "InlineBinary");
     json_type jvaluebintype = json_object_get_type( jvaluebin );
-    json_object * jvalue = json_object_object_get(obj, "Value");
+    json_object * jvalue = json_object_object_get_old(obj, "Value");
     json_type jvaluetype = json_object_get_type( jvalue );
     //const char * dummy = json_object_to_json_string ( jvalue );
     assert( jvaluetype == json_type_array || jvaluetype == json_type_null );
diff --git a/Source/MediaStorageAndFileFormat/gdcmRLECodec.cxx b/Source/MediaStorageAndFileFormat/gdcmRLECodec.cxx
index b91db2f..157432f 100644
--- a/Source/MediaStorageAndFileFormat/gdcmRLECodec.cxx
+++ b/Source/MediaStorageAndFileFormat/gdcmRLECodec.cxx
@@ -628,7 +628,7 @@ bool RLECodec::Decode(DataElement const &in, DataElement &out)
     const unsigned long len = GetBufferLength();
     unsigned long pos = 0;
     // Each RLE Frame store a 2D frame. len is the 3d length
-    const unsigned long nframes = sf->GetNumberOfFragments();
+    const size_t nframes = sf->GetNumberOfFragments();
     const size_t zdim = Dimensions[2];
     if( nframes != zdim )
     {
diff --git a/Source/MediaStorageAndFileFormat/gdcmSegment.cxx b/Source/MediaStorageAndFileFormat/gdcmSegment.cxx
index eb75c68..90f16d3 100644
--- a/Source/MediaStorageAndFileFormat/gdcmSegment.cxx
+++ b/Source/MediaStorageAndFileFormat/gdcmSegment.cxx
@@ -192,7 +192,7 @@ void Segment::SetSegmentAlgorithmName(const char * name)
 
 void Segment::ComputeSurfaceCount()
 {
-  SurfaceCount = Surfaces.size();
+  SurfaceCount = (unsigned long)Surfaces.size();
 }
 
 unsigned long Segment::GetSurfaceCount()
diff --git a/Source/MediaStorageAndFileFormat/gdcmSerieHelper.cxx b/Source/MediaStorageAndFileFormat/gdcmSerieHelper.cxx
index 1667c55..b87372d 100644
--- a/Source/MediaStorageAndFileFormat/gdcmSerieHelper.cxx
+++ b/Source/MediaStorageAndFileFormat/gdcmSerieHelper.cxx
@@ -148,7 +148,7 @@ void SerieHelper::AddFileName(std::string const &filename)
     }
 }
 
-bool CompareDicomString(const std::string &s1, const char *s2, int op)
+static bool CompareDicomString(const std::string &s1, const char *s2, int op)
 {
   // s2 is the string from the DICOM reference e.g. : 'MONOCHROME1'
   std::string s1_even = s1; //Never change input parameter
diff --git a/Source/MediaStorageAndFileFormat/gdcmStringFilter.cxx b/Source/MediaStorageAndFileFormat/gdcmStringFilter.cxx
index b290a4c..6efce54 100644
--- a/Source/MediaStorageAndFileFormat/gdcmStringFilter.cxx
+++ b/Source/MediaStorageAndFileFormat/gdcmStringFilter.cxx
@@ -221,6 +221,7 @@ bool StringFilter::ExecuteQuery(std::string const & query_const,
     }
   if( state != 2 )
     {
+    free( query );
     return false;
     }
   free( query );
diff --git a/Source/MediaStorageAndFileFormat/gdcmSurfaceReader.cxx b/Source/MediaStorageAndFileFormat/gdcmSurfaceReader.cxx
index b7621f0..bc0ffec 100644
--- a/Source/MediaStorageAndFileFormat/gdcmSurfaceReader.cxx
+++ b/Source/MediaStorageAndFileFormat/gdcmSurfaceReader.cxx
@@ -29,7 +29,7 @@ SurfaceReader::~SurfaceReader()
 
 unsigned long SurfaceReader::GetNumberOfSurfaces() const
 {
-  return Segments.size();
+  return (unsigned long)Segments.size();
 }
 
 bool SurfaceReader::Read()
diff --git a/Source/MediaStorageAndFileFormat/gdcmXMLPrinter.cxx b/Source/MediaStorageAndFileFormat/gdcmXMLPrinter.cxx
index 1d7ca08..a024ba4 100644
--- a/Source/MediaStorageAndFileFormat/gdcmXMLPrinter.cxx
+++ b/Source/MediaStorageAndFileFormat/gdcmXMLPrinter.cxx
@@ -499,6 +499,7 @@ void XMLPrinter::PrintDataSet(const DataSet &ds, const TransferSyntax & ts, std:
         	}        
         }
       */
+      delete[] bulkData;
       }
     else
       {
diff --git a/Testing/Source/Common/Cxx/TestByteSwap.cxx b/Testing/Source/Common/Cxx/TestByteSwap.cxx
index a997fda..88b511a 100644
--- a/Testing/Source/Common/Cxx/TestByteSwap.cxx
+++ b/Testing/Source/Common/Cxx/TestByteSwap.cxx
@@ -136,7 +136,7 @@ int TestByteSwap(int , char *[])
 
   uint16_t array[] = { 0x1234 };
   gdcm::ByteSwap<uint16_t>::SwapRangeFromSwapCodeIntoSystem(array,
-    gdcm::SwapCode::BigEndian,2);
+    gdcm::SwapCode::BigEndian,1);
    if ( array[0] != 0x3412 )
      {
      std::cerr << std::hex << "array: " << array[0] << std::endl;
diff --git a/Testing/Source/Common/Cxx/TestSystem1.cxx b/Testing/Source/Common/Cxx/TestSystem1.cxx
index ab6f7e1..b6b6d23 100644
--- a/Testing/Source/Common/Cxx/TestSystem1.cxx
+++ b/Testing/Source/Common/Cxx/TestSystem1.cxx
@@ -96,7 +96,7 @@ int TestSystem1(int, char *[])
   if( size2 != size4 )
     {
     std::cerr << "size_t is diff from std::streamsize: " << size2 << " " << size4 << std::endl;
-    return 1;
+    //return 1;
     }
 
   char datetime[22];
diff --git a/Testing/Source/Common/Python/CMakeLists.txt b/Testing/Source/Common/Python/CMakeLists.txt
index 11cf827..629709f 100644
--- a/Testing/Source/Common/Python/CMakeLists.txt
+++ b/Testing/Source/Common/Python/CMakeLists.txt
@@ -2,9 +2,13 @@
 # gdcm-python
 set(GDCM_PYTHON_TEST_SRCS
   TestTesting
-  TestDirectory
   )
-
+if(GDCM_DATA_ROOT)
+  set(GDCM_PYTHON_TEST_SRCS
+    ${GDCM_PYTHON_TEST_SRCS}
+    TestDirectory
+  )
+endif()
 
 # Loop over files and create executables
 foreach(name ${GDCM_PYTHON_TEST_SRCS})
diff --git a/Testing/Source/Common/Python/TestDirectory.py b/Testing/Source/Common/Python/TestDirectory.py
index ac15e31..9edfdf1 100644
--- a/Testing/Source/Common/Python/TestDirectory.py
+++ b/Testing/Source/Common/Python/TestDirectory.py
@@ -34,4 +34,4 @@ for file in dir.GetFilenames():
   print(file)
 
 # Test succeed ?
-#sys.exit(sucess != 1)
+#sys.exit(success != 1)
diff --git a/Testing/Source/Common/Python/TestTesting.py b/Testing/Source/Common/Python/TestTesting.py
index 2a10150..65ef70f 100644
--- a/Testing/Source/Common/Python/TestTesting.py
+++ b/Testing/Source/Common/Python/TestTesting.py
@@ -26,4 +26,4 @@ print(t.GetFileName(10000))
 print(t.GetDataRoot())
 
 # Test succeed ?
-#sys.exit(sucess != 1)
+#sys.exit(success != 1)
diff --git a/Testing/Source/DataStructureAndEncodingDefinition/Java/CMakeLists.txt b/Testing/Source/DataStructureAndEncodingDefinition/Java/CMakeLists.txt
index eb76a05..46e27ce 100644
--- a/Testing/Source/DataStructureAndEncodingDefinition/Java/CMakeLists.txt
+++ b/Testing/Source/DataStructureAndEncodingDefinition/Java/CMakeLists.txt
@@ -14,15 +14,16 @@ set(classfilesdep)
 
 foreach(example ${GDCM_JAVA_TEST_SRCS})
   add_custom_command(
-    OUTPUT ${EXECUTABLE_OUTPUT_PATH}/${example}.class
-    COMMAND ${Java_JAVAC_EXECUTABLE} ARGS ${CMAKE_CURRENT_SOURCE_DIR}/${example}.java -d ${EXECUTABLE_OUTPUT_PATH} -source ${GDCM_JAVA_SOURCE_VERSION} -target ${GDCM_JAVA_TARGET_VERSION} -classpath ${LIBRARY_OUTPUT_PATH}/gdcm.jar
+    OUTPUT ${GDCM_EXECUTABLE_DIR}/${example}.class
+    COMMAND ${Java_JAVAC_EXECUTABLE} ARGS ${CMAKE_CURRENT_SOURCE_DIR}/${example}.java -d ${GDCM_EXECUTABLE_DIR} -source ${GDCM_JAVA_SOURCE_VERSION} -target ${GDCM_JAVA_TARGET_VERSION} -classpath ${GDCM_LIBRARY_DIR}/gdcm.jar
     WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
     DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/${example}.java
     COMMENT "javac ${example}.java"
     )
-  list(APPEND classfilesdep ${EXECUTABLE_OUTPUT_PATH}/${example}.class)
-  set_source_files_properties(${EXECUTABLE_OUTPUT_PATH}/${example}.class PROPERTIES CLASSPATH "${EXECUTABLE_OUTPUT_PATH}/gdcm.jar")
-  ADD_JAVA_TEST(${example}Java ${EXECUTABLE_OUTPUT_PATH}/${example})
+  list(APPEND classfilesdep ${GDCM_EXECUTABLE_DIR}/${example}.class)
+  set(GDCM_LIBRARY_DIR2 ${LIBRARY_OUTPUT_PATH}/\${BUILD_TYPE})
+  set_source_files_properties(${GDCM_EXECUTABLE_DIR}/${example}.class PROPERTIES CLASSPATH "${GDCM_LIBRARY_DIR2}/gdcm.jar")
+  ADD_JAVA_TEST(${example}Java ${GDCM_EXECUTABLE_DIR}/${example})
 endforeach()
 
 # 3. ok now add the target
diff --git a/Testing/Source/DataStructureAndEncodingDefinition/Python/CMakeLists.txt b/Testing/Source/DataStructureAndEncodingDefinition/Python/CMakeLists.txt
index 225c63f..89d9e38 100644
--- a/Testing/Source/DataStructureAndEncodingDefinition/Python/CMakeLists.txt
+++ b/Testing/Source/DataStructureAndEncodingDefinition/Python/CMakeLists.txt
@@ -1,9 +1,14 @@
 # Define the tests for gdcm-python
 # gdcm-python
 set(GDCM_PYTHON_TEST_SRCS
-  TestReader
   TestTag
   )
+if(GDCM_DATA_ROOT)
+  set(GDCM_PYTHON_TEST_SRCS
+    ${GDCM_PYTHON_TEST_SRCS}
+    TestReader
+  )
+endif()
 
 # Loop over files and create executables
 foreach(name ${GDCM_PYTHON_TEST_SRCS})
diff --git a/Testing/Source/DataStructureAndEncodingDefinition/Python/TestReader.py b/Testing/Source/DataStructureAndEncodingDefinition/Python/TestReader.py
index b765dd7..6df8f2f 100644
--- a/Testing/Source/DataStructureAndEncodingDefinition/Python/TestReader.py
+++ b/Testing/Source/DataStructureAndEncodingDefinition/Python/TestReader.py
@@ -12,22 +12,22 @@
 #
 ############################################################################
 
-import gdcm
 import os,sys
+import gdcm
 
 def TestRead(filename, verbose = False):
   r = gdcm.Reader()
   r.SetFileName( filename )
-  sucess = r.Read()
+  success = r.Read()
   #if verbose: print r.GetFile()
   if verbose: print(r.GetFile().GetDataSet())
-  return sucess
+  return success
 
 if __name__ == "__main__":
-  sucess = 0
+  success = 0
   try:
     filename = os.sys.argv[1]
-    sucess += TestRead( filename, True )
+    success += TestRead( filename, True )
   except:
     # loop over all files:
     gdcm.Trace.DebugOff()
@@ -36,8 +36,8 @@ if __name__ == "__main__":
     nfiles = t.GetNumberOfFileNames()
     for i in range(0,nfiles):
       filename = t.GetFileName(i)
-      sucess += TestRead( filename )
+      success += TestRead( filename )
 
 
   # Test succeed ?
-  sys.exit(sucess == 0)
+  sys.exit(success == 0)
diff --git a/Testing/Source/DataStructureAndEncodingDefinition/Python/TestTag.py b/Testing/Source/DataStructureAndEncodingDefinition/Python/TestTag.py
index e4c3a06..fad1ac0 100644
--- a/Testing/Source/DataStructureAndEncodingDefinition/Python/TestTag.py
+++ b/Testing/Source/DataStructureAndEncodingDefinition/Python/TestTag.py
@@ -12,8 +12,8 @@
 #
 ############################################################################
 
-import gdcm
 import os,sys
+import gdcm
 
 if __name__ == "__main__":
   o1 = gdcm.Tag(0x0000,0x0000)
diff --git a/Testing/Source/MediaStorageAndFileFormat/Cxx/TestPhotometricInterpretation.cxx b/Testing/Source/MediaStorageAndFileFormat/Cxx/TestPhotometricInterpretation.cxx
index 63c8210..4a065c3 100644
--- a/Testing/Source/MediaStorageAndFileFormat/Cxx/TestPhotometricInterpretation.cxx
+++ b/Testing/Source/MediaStorageAndFileFormat/Cxx/TestPhotometricInterpretation.cxx
@@ -19,7 +19,7 @@ int TestPhotometricInterpretation(int, char *[])
 {
   gdcm::PhotometricInterpretation pi;
   int end = gdcm::PhotometricInterpretation::PI_END;
-  for( int i = 0; i < end; ++i)
+  for( int i = 1; i < end; ++i)
     {
     const char *pistr = gdcm::PhotometricInterpretation::GetPIString( (gdcm::PhotometricInterpretation::PIType)i );
     if( strlen( pistr ) % 2 )
diff --git a/Testing/Source/MediaStorageAndFileFormat/Python/CMakeLists.txt b/Testing/Source/MediaStorageAndFileFormat/Python/CMakeLists.txt
index ecd0336..2f63974 100644
--- a/Testing/Source/MediaStorageAndFileFormat/Python/CMakeLists.txt
+++ b/Testing/Source/MediaStorageAndFileFormat/Python/CMakeLists.txt
@@ -1,25 +1,32 @@
 # Define the tests for gdcm-python
 # gdcm-python
 set(GDCM_PYTHON_TEST_SRCS
-  TestScanner
-  TestImageReader
-  TestUIDGenerator
-  TestModifyFields
-  TestAnonymizer
+  #TestPythonFilter
   #TestStringFilter
-  TestOrientation
   TestIPPSorter
-  #TestPythonFilter
+  TestOrientation
+  TestUIDGenerator
+  )
+if(GDCM_DATA_ROOT)
+  set(GDCM_PYTHON_TEST_SRCS
+    ${GDCM_PYTHON_TEST_SRCS}
+    TestAnonymizer
+    TestModifyFields
+    TestImageReader
+    TestScanner
   )
+endif()
 if(BUILD_APPLICATIONS)
   if(DCMTK_DCMDUMP_EXECUTABLE)
   if(UNIX)
+  if(GDCM_DATA_ROOT)
     set(GDCM_PYTHON_TEST_SRCS
       ${GDCM_PYTHON_TEST_SRCS}
       TestDCMTKMD5 # need dcmdrle and dcmdjpeg
     )
   endif()
   endif()
+  endif()
 endif()
 
 # Loop over files and create executables
@@ -33,7 +40,9 @@ find_package(KAKADU)
 if(BUILD_APPLICATIONS)
   if(KDU_EXPAND_EXECUTABLE)
   if(UNIX)
+  if(GDCM_DATA_ROOT)
     ADD_PYTHON_TEST(TestKakaduDecompressionMD5Python TestKakaduDecompressionMD5.py ${KDU_EXPAND_EXECUTABLE})
   endif()
   endif()
+  endif()
 endif()
diff --git a/Testing/Source/MediaStorageAndFileFormat/Python/TestAnonymizer.py b/Testing/Source/MediaStorageAndFileFormat/Python/TestAnonymizer.py
index 5e8344e..81d4bce 100644
--- a/Testing/Source/MediaStorageAndFileFormat/Python/TestAnonymizer.py
+++ b/Testing/Source/MediaStorageAndFileFormat/Python/TestAnonymizer.py
@@ -18,8 +18,8 @@ import os,sys
 def TestAnonymizer(filename, verbose = False):
   r = gdcm.Reader()
   r.SetFileName( filename )
-  sucess = r.Read()
-  if( not sucess ): return 1
+  success = r.Read()
+  if( not success ): return 1
   #print r.GetFile().GetDataSet()
 
   ano = gdcm.Anonymizer()
@@ -31,8 +31,8 @@ def TestAnonymizer(filename, verbose = False):
   # 3. Make a tag empty
   ano.Empty( gdcm.Tag(0x0008,0x0070) )
   # Call the main function:
-  sucess = ano.RemovePrivateTags() # do it !
-  if( not sucess ): return 1
+  success = ano.RemovePrivateTags() # do it !
+  if( not success ): return 1
 
   # Check we can also change value from binary field
   #ano.Replace( gdcm.Tag(0x0010,0x0010), "16", gdcm. )
@@ -55,27 +55,27 @@ def TestAnonymizer(filename, verbose = False):
   w.SetFileName( outfilename )
   w.SetFile( r.GetFile() )
   w.SetCheckFileMetaInformation( False )
-  sucess = w.Write()
-  if( not sucess ): return 1
+  success = w.Write()
+  if( not success ): return 1
 
   if verbose:
     print("Success to write: %s"%outfilename)
 
-  return sucess
+  return success
 
 if __name__ == "__main__":
-  sucess = 0
+  success = 0
   try:
     filename = os.sys.argv[1]
-    sucess += TestAnonymizer( filename, True )
+    success += TestAnonymizer( filename, True )
   except:
     # loop over all files:
     t = gdcm.Testing()
     nfiles = t.GetNumberOfFileNames()
     for i in range(0,nfiles):
       filename = t.GetFileName(i)
-      sucess += TestAnonymizer( filename )
+      success += TestAnonymizer( filename )
 
 
   # Test succeed ?
-  sys.exit(sucess == 0)
+  sys.exit(success == 0)
diff --git a/Testing/Source/MediaStorageAndFileFormat/Python/TestDCMTKMD5.py b/Testing/Source/MediaStorageAndFileFormat/Python/TestDCMTKMD5.py
index b72d791..29e1be8 100644
--- a/Testing/Source/MediaStorageAndFileFormat/Python/TestDCMTKMD5.py
+++ b/Testing/Source/MediaStorageAndFileFormat/Python/TestDCMTKMD5.py
@@ -172,10 +172,10 @@ def TestDCMTKMD5( filename, verbose = False ):
   return 1
 
 if __name__ == "__main__":
-  sucess = 0
+  success = 0
   try:
     filename = os.sys.argv[1]
-    sucess += TestDCMTKMD5( filename, True )
+    success += TestDCMTKMD5( filename, True )
   except:
     # loop over all files:
     t = gdcm.Testing()
@@ -184,7 +184,7 @@ if __name__ == "__main__":
     nfiles = t.GetNumberOfFileNames()
     for i in range(0,nfiles):
       filename = t.GetFileName(i)
-      sucess += TestDCMTKMD5( filename )
+      success += TestDCMTKMD5( filename )
 
   # Test succeed ?
-  sys.exit(sucess)
+  sys.exit(success)
diff --git a/Testing/Source/MediaStorageAndFileFormat/Python/TestIPPSorter.py b/Testing/Source/MediaStorageAndFileFormat/Python/TestIPPSorter.py
index 6283041..4e7751e 100644
--- a/Testing/Source/MediaStorageAndFileFormat/Python/TestIPPSorter.py
+++ b/Testing/Source/MediaStorageAndFileFormat/Python/TestIPPSorter.py
@@ -16,7 +16,7 @@ import gdcm
 import os,sys
 
 if __name__ == "__main__":
-  sucess = 0
+  success = 0
   s = gdcm.IPPSorter()
   # black box test:
   if not s.Sort([]):
diff --git a/Testing/Source/MediaStorageAndFileFormat/Python/TestImageReader.py b/Testing/Source/MediaStorageAndFileFormat/Python/TestImageReader.py
index aeba8af..dbc45f0 100644
--- a/Testing/Source/MediaStorageAndFileFormat/Python/TestImageReader.py
+++ b/Testing/Source/MediaStorageAndFileFormat/Python/TestImageReader.py
@@ -23,10 +23,10 @@ def TestImageRead(filename, verbose = False):
   return success
 
 if __name__ == "__main__":
-  sucess = 0
+  success = 0
   try:
     filename = os.sys.argv[1]
-    sucess += TestImageRead( filename, True )
+    success += TestImageRead( filename, True )
   except:
     # loop over all files:
     gdcm.Trace.DebugOff()
@@ -36,7 +36,7 @@ if __name__ == "__main__":
     for i in range(0,nfiles):
       #print t.GetFileName(i)
       filename = t.GetFileName(i)
-      sucess += TestImageRead( filename )
+      success += TestImageRead( filename )
 
   # Test succeed ?
-  sys.exit(sucess == 0)
+  sys.exit(success == 0)
diff --git a/Testing/Source/MediaStorageAndFileFormat/Python/TestKakaduDecompressionMD5.py b/Testing/Source/MediaStorageAndFileFormat/Python/TestKakaduDecompressionMD5.py
index cf45e42..9b7e38c 100644
--- a/Testing/Source/MediaStorageAndFileFormat/Python/TestKakaduDecompressionMD5.py
+++ b/Testing/Source/MediaStorageAndFileFormat/Python/TestKakaduDecompressionMD5.py
@@ -67,17 +67,17 @@ def TestKakadu(filename, kdu_expand):
   return retval
 
 if __name__ == "__main__":
-    sucess = 0
+    success = 0
     #try:
     #  filename = os.sys.argv[1]
-    #  sucess += TestKakadu( filename )
+    #  success += TestKakadu( filename )
     #except:
     # loop over all files:
     #t = gdcm.Testing()
     #nfiles = t.GetNumberOfFileNames()
     #for i in range(0,nfiles):
     #  filename = t.GetFileName(i)
-    #  sucess += TestKakadu( filename )
+    #  success += TestKakadu( filename )
     d = gdcm.Directory()
     tempdir = gdcm.Testing.GetTempDirectory()
     j2ksubdir = 'TestImageChangeTransferSyntax2' # FIXME hardcoded !
@@ -89,7 +89,7 @@ if __name__ == "__main__":
     files = d.GetFilenames()
     for i in range(0,nfiles):
       filename = files[i]
-      sucess += TestKakadu( filename, os.sys.argv[1] )
+      success += TestKakadu( filename, os.sys.argv[1] )
 
     # Test succeed ?
-    sys.exit(sucess)
+    sys.exit(success)
diff --git a/Testing/Source/MediaStorageAndFileFormat/Python/TestModifyFields.py b/Testing/Source/MediaStorageAndFileFormat/Python/TestModifyFields.py
index eda3cda..675ef7d 100644
--- a/Testing/Source/MediaStorageAndFileFormat/Python/TestModifyFields.py
+++ b/Testing/Source/MediaStorageAndFileFormat/Python/TestModifyFields.py
@@ -19,7 +19,7 @@ def TestModifyFields(filename):
   outfilename = filename + ".rewrite"
   r = gdcm.Reader()
   r.SetFileName( filename )
-  sucess = r.Read()
+  success = r.Read()
   #print r.GetFile().GetDataSet()
 
   ds = r.GetFile().GetDataSet()
@@ -63,22 +63,22 @@ def TestModifyFields(filename):
   #w = gdcm.Writer()
   #w.SetFileName( outfilename )
   #w.SetFile( r.GetFile() )
-  #sucess = w.Write()
-  return sucess
+  #success = w.Write()
+  return success
 
 if __name__ == "__main__":
-  sucess = 0
+  success = 0
   try:
     filename = os.sys.argv[1]
-    sucess += TestModifyFields( filename, True )
+    success += TestModifyFields( filename, True )
   except:
     # loop over all files:
     t = gdcm.Testing()
     nfiles = t.GetNumberOfFileNames()
     for i in range(0,nfiles):
       filename = t.GetFileName(i)
-      sucess += TestModifyFields( filename )
+      success += TestModifyFields( filename )
 
 
   # Test succeed ?
-  sys.exit(sucess == 0)
+  sys.exit(success == 0)
diff --git a/Testing/Source/MediaStorageAndFileFormat/Python/TestOrientation.py b/Testing/Source/MediaStorageAndFileFormat/Python/TestOrientation.py
index 8f3dcc7..5f23743 100644
--- a/Testing/Source/MediaStorageAndFileFormat/Python/TestOrientation.py
+++ b/Testing/Source/MediaStorageAndFileFormat/Python/TestOrientation.py
@@ -16,7 +16,7 @@ import gdcm
 import os,sys
 
 if __name__ == "__main__":
-  sucess = True
+  success = True
 
   ori1 = (1,0,0,0,1,0)
   ori2 = (1,0,0,0,0,1)
@@ -25,15 +25,15 @@ if __name__ == "__main__":
   label1 = gdcm.Orientation.GetLabel( gdcm.Orientation.GetType( ori1 ) )
   if label1 != 'AXIAL':
     print("Found:",label1)
-    sucess = False
+    success = False
   label2 = gdcm.Orientation.GetLabel( gdcm.Orientation.GetType( ori2 ) )
   if label2 != 'CORONAL':
     print("Found:",label2)
-    sucess = False
+    success = False
   label3 = gdcm.Orientation.GetLabel( gdcm.Orientation.GetType( ori3 ) )
   if label3 != 'SAGITTAL':
     print("Found:",label3)
-    sucess = False
+    success = False
 
   image = gdcm.Image()
   image.SetNumberOfDimensions(2)
@@ -53,4 +53,4 @@ if __name__ == "__main__":
   #print dircos.Cross()
 
   # Test succeed ?
-  sys.exit(sucess == False)
+  sys.exit(success == False)
diff --git a/Testing/Source/MediaStorageAndFileFormat/Python/TestPythonFilter.py b/Testing/Source/MediaStorageAndFileFormat/Python/TestPythonFilter.py
index eaac6fb..6250469 100644
--- a/Testing/Source/MediaStorageAndFileFormat/Python/TestPythonFilter.py
+++ b/Testing/Source/MediaStorageAndFileFormat/Python/TestPythonFilter.py
@@ -18,8 +18,8 @@ import os,sys
 def TestPythonFilter(filename, verbose = False):
   r = gdcm.Reader()
   r.SetFileName( filename )
-  sucess = r.Read()
-  if( not sucess ): return 1
+  success = r.Read()
+  if( not success ): return 1
 
   file = r.GetFile()
   ds = file.GetDataSet()
@@ -46,10 +46,10 @@ def TestPythonFilter(filename, verbose = False):
   return 0
 
 if __name__ == "__main__":
-  sucess = 0
+  success = 0
   try:
     filename = os.sys.argv[1]
-    sucess += TestPythonFilter( filename, True )
+    success += TestPythonFilter( filename, True )
   except:
     # loop over all files:
     gdcm.Trace.WarningOff()
@@ -57,8 +57,8 @@ if __name__ == "__main__":
     nfiles = t.GetNumberOfFileNames()
     for i in range(0,nfiles):
       filename = t.GetFileName(i)
-      sucess += TestPythonFilter( filename )
+      success += TestPythonFilter( filename )
 
 
   # Test succeed ?
-  sys.exit(sucess == 0)
+  sys.exit(success == 0)
diff --git a/Testing/Source/MediaStorageAndFileFormat/Python/TestStringFilter.py b/Testing/Source/MediaStorageAndFileFormat/Python/TestStringFilter.py
index f1b8490..cd47e3b 100644
--- a/Testing/Source/MediaStorageAndFileFormat/Python/TestStringFilter.py
+++ b/Testing/Source/MediaStorageAndFileFormat/Python/TestStringFilter.py
@@ -18,8 +18,8 @@ import os,sys
 def TestStringFilter(filename, verbose = False):
   r = gdcm.Reader()
   r.SetFileName( filename )
-  sucess = r.Read()
-  if( not sucess ): return 1
+  success = r.Read()
+  if( not success ): return 1
 
   file = r.GetFile()
   ds = file.GetDataSet()
@@ -45,10 +45,10 @@ def TestStringFilter(filename, verbose = False):
   return 0
 
 if __name__ == "__main__":
-  sucess = 0
+  success = 0
   try:
     filename = os.sys.argv[1]
-    sucess += TestStringFilter( filename, True )
+    success += TestStringFilter( filename, True )
   except:
     # loop over all files:
     gdcm.Trace.WarningOff()
@@ -56,8 +56,8 @@ if __name__ == "__main__":
     nfiles = t.GetNumberOfFileNames()
     for i in range(0,nfiles):
       filename = t.GetFileName(i)
-      sucess += TestStringFilter( filename )
+      success += TestStringFilter( filename )
 
 
   # Test succeed ?
-  sys.exit(sucess == 0)
+  sys.exit(success == 0)
diff --git a/Testing/Source/MessageExchangeDefinition/Cxx/TestFindPatientRootQuery.cxx b/Testing/Source/MessageExchangeDefinition/Cxx/TestFindPatientRootQuery.cxx
index caf4e87..2c227e3 100644
--- a/Testing/Source/MessageExchangeDefinition/Cxx/TestFindPatientRootQuery.cxx
+++ b/Testing/Source/MessageExchangeDefinition/Cxx/TestFindPatientRootQuery.cxx
@@ -248,6 +248,6 @@ int TestFindPatientRootQuery(int , char *[])
       }
     }
 
-  //std::cout << "sucess" << std::endl;
+  //std::cout << "success" << std::endl;
   return 0;
 }
diff --git a/Testing/Source/MessageExchangeDefinition/Cxx/TestFindStudyRootQuery.cxx b/Testing/Source/MessageExchangeDefinition/Cxx/TestFindStudyRootQuery.cxx
index eb72c4e..1dcba0e 100644
--- a/Testing/Source/MessageExchangeDefinition/Cxx/TestFindStudyRootQuery.cxx
+++ b/Testing/Source/MessageExchangeDefinition/Cxx/TestFindStudyRootQuery.cxx
@@ -213,6 +213,6 @@ int TestFindStudyRootQuery(int , char *[])
       }
     }
 
-  //std::cout << "sucess" << std::endl;
+  //std::cout << "success" << std::endl;
   return 0;
 }
diff --git a/Utilities/VTK/CMakeLists.txt b/Utilities/VTK/CMakeLists.txt
index 5ab4bda..e8eb0c8 100644
--- a/Utilities/VTK/CMakeLists.txt
+++ b/Utilities/VTK/CMakeLists.txt
@@ -648,6 +648,10 @@ if(GDCM_WRAP_JAVA)
     if(EXISTS ${VTK_JAVA_JAR})
       # http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=533193
       set(GDCM_VTK_JAVA_JAR ${VTK_JAVA_JAR})
+    else()
+      find_file(VTK_JAVA_JAR NAMES vtk.jar vtk6.jar vtk5.jar
+        PATHS ${vtkWrappingJava_RUNTIME_LIBRARY_DIRS})
+      set(GDCM_VTK_JAVA_JAR ${VTK_JAVA_JAR})
     endif()
     if(EXISTS /usr/lib/jni/libvtkCommonJava.so)
       # http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=533198
@@ -678,7 +682,7 @@ if(GDCM_WRAP_JAVA)
       #COMMAND ${Java_JAVAC_EXECUTABLE} ARGS -cp ${GDCM_VTK_JAVA_JAR} "vtk/*.java"
       # No such thing as -cp for javac only java is listed:
       # http://java.sun.com/j2se/1.5.0/docs/tooldocs/windows/classpath.html
-      COMMAND ${Java_JAVAC_EXECUTABLE} ARGS ${jflags} -source 1.5 -target 1.5 -classpath ${GDCM_VTK_JAVA_JAR} "vtk/*.java"
+      COMMAND ${Java_JAVAC_EXECUTABLE} ARGS ${jflags} -source ${GDCM_JAVA_SOURCE_VERSION} -target ${GDCM_JAVA_TARGET_VERSION} -classpath ${GDCM_VTK_JAVA_JAR} "vtk/*.java"
       COMMAND ${Java_JAR_EXECUTABLE} ARGS -cvfm ${LIBRARY_OUTPUT_PATH}/${PROJECT_NAME}.jar ${CMAKE_CURRENT_SOURCE_DIR}/manifest.txt vtk/*.class
       WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/java
       DEPENDS ${VTKGDCM_NAME}Java
diff --git a/Utilities/VTK/Testing/Python/TestvtkGDCMImageWriter.py b/Utilities/VTK/Testing/Python/TestvtkGDCMImageWriter.py
index 7474939..1b2a346 100644
--- a/Utilities/VTK/Testing/Python/TestvtkGDCMImageWriter.py
+++ b/Utilities/VTK/Testing/Python/TestvtkGDCMImageWriter.py
@@ -42,4 +42,4 @@ if __name__ == "__main__":
   writer.Write()
 
   # Test succeed ?
-  #sys.exit(sucess != 1)
+  #sys.exit(success != 1)
diff --git a/Utilities/VTK/Testing/Python/TestvtkGDCMThreadedImageReader.py b/Utilities/VTK/Testing/Python/TestvtkGDCMThreadedImageReader.py
index acb1be3..a20f039 100644
--- a/Utilities/VTK/Testing/Python/TestvtkGDCMThreadedImageReader.py
+++ b/Utilities/VTK/Testing/Python/TestvtkGDCMThreadedImageReader.py
@@ -35,8 +35,8 @@ def ExecuteInformation(reader, filename, dimz = 1):
   #print reader
   r = gdcm.ImageReader()
   r.SetFileName( reffile )
-  sucess = r.Read()
-  assert sucess
+  success = r.Read()
+  assert success
   #print r.GetImage().Print()
   image = r.GetImage()
   assert image.GetNumberOfDimensions() == 2 or image.GetNumberOfDimensions() == 3
@@ -118,4 +118,4 @@ if __name__ == "__main__":
 
 
   # Test succeed ?
-  #sys.exit(sucess != 1)
+  #sys.exit(success != 1)
diff --git a/Utilities/VTK/Testing/Python/TestvtkGDCMThreadedImageReader2.py b/Utilities/VTK/Testing/Python/TestvtkGDCMThreadedImageReader2.py
index 163f031..b41b088 100644
--- a/Utilities/VTK/Testing/Python/TestvtkGDCMThreadedImageReader2.py
+++ b/Utilities/VTK/Testing/Python/TestvtkGDCMThreadedImageReader2.py
@@ -92,4 +92,4 @@ if __name__ == "__main__":
     print(r.GetOutput())
 
   # Test succeed ?
-  #sys.exit(sucess != 1)
+  #sys.exit(success != 1)
diff --git a/Utilities/VTK/vtkGDCMThreadedImageReader.cxx b/Utilities/VTK/vtkGDCMThreadedImageReader.cxx
index 90042d8..93e281e 100644
--- a/Utilities/VTK/vtkGDCMThreadedImageReader.cxx
+++ b/Utilities/VTK/vtkGDCMThreadedImageReader.cxx
@@ -2,7 +2,7 @@
 
   Program: GDCM (Grassroots DICOM). A DICOM library
 
-  Copyright (c) 2006-2011 Mathieu Malaterre
+  Copyright (c) 2006-2016 Mathieu Malaterre
   All rights reserved.
   See Copyright.txt or http://gdcm.sourceforge.net/Copyright.html for details.
 
@@ -39,7 +39,6 @@
 #endif
 
 #ifdef __APPLE__
-// For some reason sysconf + _SC_NPROCESSORS_ONLN is documented on macosx tiger, but it does not compile
 #include <sys/types.h>
 #include <sys/sysctl.h>
 #endif
@@ -450,8 +449,11 @@ void vtkGDCMThreadedImageReader::ReadFiles(unsigned int nfiles, const char *file
   const unsigned int nprocs = (unsigned int)sysconf( _SC_NPROCESSORS_ONLN );
 #else
 #ifdef __APPLE__
-  int count = 1;
+  int32_t count = 1;
   size_t size = sizeof(count);
+
+  // hw.ncpu is deprecated and should be replaced with hw.logicalcpu one day.
+  // hw.logicalcpu exists since at least 10.8, but maybe not earlier...
   int res = sysctlbyname("hw.ncpu",&count,&size,NULL,0);
   if( res == -1 )
     {
diff --git a/Utilities/doxygen/CMakeLists.txt b/Utilities/doxygen/CMakeLists.txt
index 055cf3a..cf8f616 100644
--- a/Utilities/doxygen/CMakeLists.txt
+++ b/Utilities/doxygen/CMakeLists.txt
@@ -247,10 +247,41 @@ set(MANPAGES_XML
 find_package(LibXslt)
 # need an XSLT 1.0 processor, use xsltproc, maybe add more implementations later
 if(LIBXSLT_XSLTPROC_EXECUTABLE)
+  set(XSLT_PROCESSOR ${LIBXSLT_XSLTPROC_EXECUTABLE})
+# http://docbook.sourceforge.net/release/xsl/current/doc/manpages/man.output.quietly.html
+  set(XSLT_PROCESSOR_ARG --param man.output.quietly 1)
+  # User can change the behavior at cmake time:
+  if(NOT DEFINED GDCM_MANPAGES_USE_NONET)
+    set(GDCM_MANPAGES_USE_NONET FALSE)
+    # By default I want nonet on Debian:
+    if(EXISTS /etc/xml/catalog)
+      set(GDCM_MANPAGES_USE_NONET TRUE)
+    endif()
+  endif()
+  if(GDCM_MANPAGES_USE_NONET)
+    list(APPEND XSLT_PROCESSOR_ARG --nonet)
+  endif()
+else()
+  find_program(MSXSL_EXECUTABLE
+    msxsl
+    )
+  if(MSXSL_EXECUTABLE)
+    set(XSLT_PROCESSOR ${MSXSL_EXECUTABLE})
+    set(XSLT_PROCESSOR_ARG "-pi")
+# msxsl.exe -pi gdcmimg.xml
+#
+#Error occurred while executing stylesheet 'http://docbook.sourceforge.net/release/xsl-ns/current/manpages/docbook.xsl'.
+#
+#Code:   0x80004005
+#Namespace 'http://exslt.org/common' does not contain any functions.
+# -> http://stackoverflow.com/a/16605034/136285 ??
+  endif()
+endif()
+if(XSLT_PROCESSOR)
 foreach(docbook ${MANPAGES_XML})
   add_custom_command(
     OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/${docbook}.1
-    COMMAND ${LIBXSLT_XSLTPROC_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/man/${docbook}.xml
+    COMMAND ${XSLT_PROCESSOR} ${XSLT_PROCESSOR_ARG} ${CMAKE_CURRENT_SOURCE_DIR}/man/${docbook}.xml
     DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/man/${docbook}.xml
     )
   list(APPEND MANPAGES
@@ -267,5 +298,5 @@ install(FILES
   DESTINATION ${GDCM_INSTALL_MAN_DIR}/man1 COMPONENT DebugDevel
 )
 else()
-  message(WARNING "Cannot build man page from docbook (need xsltproc)")
+  message(WARNING "Cannot build man page from docbook (need an XSL processor)")
 endif()
diff --git a/Utilities/doxygen/man/gdcm2pnm.xml b/Utilities/doxygen/man/gdcm2pnm.xml
index 5ccb02c..ba6e660 100644
--- a/Utilities/doxygen/man/gdcm2pnm.xml
+++ b/Utilities/doxygen/man/gdcm2pnm.xml
@@ -1,5 +1,5 @@
 <?xml version='1.0' encoding='UTF-8' standalone='no'?>
-<?xml-stylesheet type="text/xsl" href="http://docbook.sourceforge.net/release/xsl/current/manpages/docbook.xsl" ?>
+<?xml-stylesheet type="text/xsl" href="http://docbook.sourceforge.net/release/xsl-ns/current/manpages/docbook.xsl" ?>
 <refentry xmlns="http://docbook.org/ns/docbook" version="5.0" xmlns:xlink="http://www.w3.org/1999/xlink">
 <info>
 <author><personname><firstname>Mathieu</firstname><surname>Malaterre</surname></personname><contrib>Main developer</contrib></author>
diff --git a/Utilities/doxygen/man/gdcm2vtk.xml b/Utilities/doxygen/man/gdcm2vtk.xml
index ff5ad6f..f8a1986 100644
--- a/Utilities/doxygen/man/gdcm2vtk.xml
+++ b/Utilities/doxygen/man/gdcm2vtk.xml
@@ -1,5 +1,5 @@
 <?xml version='1.0' encoding='UTF-8' standalone='no'?>
-<?xml-stylesheet type="text/xsl" href="http://docbook.sourceforge.net/release/xsl/current/manpages/docbook.xsl" ?>
+<?xml-stylesheet type="text/xsl" href="http://docbook.sourceforge.net/release/xsl-ns/current/manpages/docbook.xsl" ?>
 <refentry xmlns="http://docbook.org/ns/docbook" version="5.0" xmlns:xlink="http://www.w3.org/1999/xlink">
 <info>
 <author><personname><firstname>Mathieu</firstname><surname>Malaterre</surname></personname><contrib>Main developer</contrib></author>
diff --git a/Utilities/doxygen/man/gdcmanon.xml b/Utilities/doxygen/man/gdcmanon.xml
index 49ff84c..d681acf 100644
--- a/Utilities/doxygen/man/gdcmanon.xml
+++ b/Utilities/doxygen/man/gdcmanon.xml
@@ -1,5 +1,5 @@
 <?xml version='1.0' encoding='UTF-8' standalone='no'?>
-<?xml-stylesheet type="text/xsl" href="http://docbook.sourceforge.net/release/xsl/current/manpages/docbook.xsl" ?>
+<?xml-stylesheet type="text/xsl" href="http://docbook.sourceforge.net/release/xsl-ns/current/manpages/docbook.xsl" ?>
 <refentry xmlns="http://docbook.org/ns/docbook" version="5.0" xmlns:xlink="http://www.w3.org/1999/xlink">
 <info>
 <author><personname><firstname>Mathieu</firstname><surname>Malaterre</surname></personname><contrib>Main developer</contrib></author>
diff --git a/Utilities/doxygen/man/gdcmconv.xml b/Utilities/doxygen/man/gdcmconv.xml
index e207c76..9f495bc 100644
--- a/Utilities/doxygen/man/gdcmconv.xml
+++ b/Utilities/doxygen/man/gdcmconv.xml
@@ -1,5 +1,5 @@
 <?xml version='1.0' encoding='UTF-8' standalone='no'?>
-<?xml-stylesheet type="text/xsl" href="http://docbook.sourceforge.net/release/xsl/current/manpages/docbook.xsl" ?>
+<?xml-stylesheet type="text/xsl" href="http://docbook.sourceforge.net/release/xsl-ns/current/manpages/docbook.xsl" ?>
 <refentry xmlns="http://docbook.org/ns/docbook" version="5.0" xmlns:xlink="http://www.w3.org/1999/xlink">
 <info>
 <author><personname><firstname>Mathieu</firstname><surname>Malaterre</surname></personname><contrib>Main developer</contrib></author>
diff --git a/Utilities/doxygen/man/gdcmdiff.xml b/Utilities/doxygen/man/gdcmdiff.xml
index ccd35b9..8635707 100644
--- a/Utilities/doxygen/man/gdcmdiff.xml
+++ b/Utilities/doxygen/man/gdcmdiff.xml
@@ -1,5 +1,5 @@
 <?xml version='1.0' encoding='UTF-8' standalone='no'?>
-<?xml-stylesheet type="text/xsl" href="http://docbook.sourceforge.net/release/xsl/current/manpages/docbook.xsl" ?>
+<?xml-stylesheet type="text/xsl" href="http://docbook.sourceforge.net/release/xsl-ns/current/manpages/docbook.xsl" ?>
 <refentry xmlns="http://docbook.org/ns/docbook" version="5.0" xmlns:xlink="http://www.w3.org/1999/xlink">
 <info>
 <author><personname><firstname>Mathieu</firstname><surname>Malaterre</surname></personname><contrib>Main developer</contrib></author>
diff --git a/Utilities/doxygen/man/gdcmdump.xml b/Utilities/doxygen/man/gdcmdump.xml
index fe7de6d..9ae5698 100644
--- a/Utilities/doxygen/man/gdcmdump.xml
+++ b/Utilities/doxygen/man/gdcmdump.xml
@@ -1,5 +1,5 @@
 <?xml version="1.0" encoding="utf-8"?>
-<?xml-stylesheet type="text/xsl" href="http://docbook.sourceforge.net/release/xsl/current/manpages/docbook.xsl" ?>
+<?xml-stylesheet type="text/xsl" href="http://docbook.sourceforge.net/release/xsl-ns/current/manpages/docbook.xsl" ?>
 <refentry xmlns="http://docbook.org/ns/docbook" version="5.0" xmlns:xlink="http://www.w3.org/1999/xlink">
 <info>
 <author><personname><firstname>Mathieu</firstname><surname>Malaterre</surname></personname><contrib>Main developer</contrib></author>
diff --git a/Utilities/doxygen/man/gdcmgendir.xml b/Utilities/doxygen/man/gdcmgendir.xml
index 4e75d72..207b649 100644
--- a/Utilities/doxygen/man/gdcmgendir.xml
+++ b/Utilities/doxygen/man/gdcmgendir.xml
@@ -1,5 +1,5 @@
 <?xml version='1.0' encoding='UTF-8' standalone='no'?>
-<?xml-stylesheet type="text/xsl" href="http://docbook.sourceforge.net/release/xsl/current/manpages/docbook.xsl" ?>
+<?xml-stylesheet type="text/xsl" href="http://docbook.sourceforge.net/release/xsl-ns/current/manpages/docbook.xsl" ?>
 <refentry xmlns="http://docbook.org/ns/docbook" version="5.0" xmlns:xlink="http://www.w3.org/1999/xlink">
 <info>
 <author><personname><firstname>Mathieu</firstname><surname>Malaterre</surname></personname><contrib>Main developer</contrib></author>
diff --git a/Utilities/doxygen/man/gdcmimg.xml b/Utilities/doxygen/man/gdcmimg.xml
index 2911ce9..7fb7e16 100644
--- a/Utilities/doxygen/man/gdcmimg.xml
+++ b/Utilities/doxygen/man/gdcmimg.xml
@@ -1,5 +1,5 @@
 <?xml version='1.0' encoding='UTF-8' standalone='no'?>
-<?xml-stylesheet type="text/xsl" href="http://docbook.sourceforge.net/release/xsl/current/manpages/docbook.xsl" ?>
+<?xml-stylesheet type="text/xsl" href="http://docbook.sourceforge.net/release/xsl-ns/current/manpages/docbook.xsl" ?>
 <refentry xmlns="http://docbook.org/ns/docbook" version="5.0" xmlns:xlink="http://www.w3.org/1999/xlink">
 <info>
 <author><personname><firstname>Mathieu</firstname><surname>Malaterre</surname></personname><contrib>Main developer</contrib></author>
diff --git a/Utilities/doxygen/man/gdcminfo.xml b/Utilities/doxygen/man/gdcminfo.xml
index 3affa95..3c80686 100644
--- a/Utilities/doxygen/man/gdcminfo.xml
+++ b/Utilities/doxygen/man/gdcminfo.xml
@@ -1,5 +1,5 @@
 <?xml version='1.0' encoding='UTF-8' standalone='no'?>
-<?xml-stylesheet type="text/xsl" href="http://docbook.sourceforge.net/release/xsl/current/manpages/docbook.xsl" ?>
+<?xml-stylesheet type="text/xsl" href="http://docbook.sourceforge.net/release/xsl-ns/current/manpages/docbook.xsl" ?>
 <refentry xmlns="http://docbook.org/ns/docbook" version="5.0" xmlns:xlink="http://www.w3.org/1999/xlink">
 <info>
 <author><personname><firstname>Mathieu</firstname><surname>Malaterre</surname></personname><contrib>Main developer</contrib></author>
diff --git a/Utilities/doxygen/man/gdcmpap3.xml b/Utilities/doxygen/man/gdcmpap3.xml
index 0b8bc58..0b87e6a 100644
--- a/Utilities/doxygen/man/gdcmpap3.xml
+++ b/Utilities/doxygen/man/gdcmpap3.xml
@@ -1,5 +1,5 @@
 <?xml version='1.0' encoding='UTF-8' standalone='no'?>
-<?xml-stylesheet type="text/xsl" href="http://docbook.sourceforge.net/release/xsl/current/manpages/docbook.xsl" ?>
+<?xml-stylesheet type="text/xsl" href="http://docbook.sourceforge.net/release/xsl-ns/current/manpages/docbook.xsl" ?>
 <refentry xmlns="http://docbook.org/ns/docbook" version="5.0" xmlns:xlink="http://www.w3.org/1999/xlink">
 <info>
 <author><personname><firstname>Mathieu</firstname><surname>Malaterre</surname></personname><contrib>Main developer</contrib></author>
diff --git a/Utilities/doxygen/man/gdcmpdf.xml b/Utilities/doxygen/man/gdcmpdf.xml
index 961d214..77655bf 100644
--- a/Utilities/doxygen/man/gdcmpdf.xml
+++ b/Utilities/doxygen/man/gdcmpdf.xml
@@ -1,5 +1,5 @@
 <?xml version='1.0' encoding='UTF-8' standalone='no'?>
-<?xml-stylesheet type="text/xsl" href="http://docbook.sourceforge.net/release/xsl/current/manpages/docbook.xsl" ?>
+<?xml-stylesheet type="text/xsl" href="http://docbook.sourceforge.net/release/xsl-ns/current/manpages/docbook.xsl" ?>
 <refentry xmlns="http://docbook.org/ns/docbook" version="5.0" xmlns:xlink="http://www.w3.org/1999/xlink">
 <info>
 <author><personname><firstname>Mathieu</firstname><surname>Malaterre</surname></personname><contrib>Main developer</contrib></author>
diff --git a/Utilities/doxygen/man/gdcmraw.xml b/Utilities/doxygen/man/gdcmraw.xml
index 6b3d316..2d406cb 100644
--- a/Utilities/doxygen/man/gdcmraw.xml
+++ b/Utilities/doxygen/man/gdcmraw.xml
@@ -1,5 +1,5 @@
 <?xml version='1.0' encoding='UTF-8' standalone='no'?>
-<?xml-stylesheet type="text/xsl" href="http://docbook.sourceforge.net/release/xsl/current/manpages/docbook.xsl" ?>
+<?xml-stylesheet type="text/xsl" href="http://docbook.sourceforge.net/release/xsl-ns/current/manpages/docbook.xsl" ?>
 <refentry xmlns="http://docbook.org/ns/docbook" version="5.0" xmlns:xlink="http://www.w3.org/1999/xlink">
 <info>
 <author><personname><firstname>Mathieu</firstname><surname>Malaterre</surname></personname><contrib>Main developer</contrib></author>
diff --git a/Utilities/doxygen/man/gdcmscanner.xml b/Utilities/doxygen/man/gdcmscanner.xml
index 047d23a..9eaab42 100644
--- a/Utilities/doxygen/man/gdcmscanner.xml
+++ b/Utilities/doxygen/man/gdcmscanner.xml
@@ -1,5 +1,5 @@
 <?xml version='1.0' encoding='UTF-8' standalone='no'?>
-<?xml-stylesheet type="text/xsl" href="http://docbook.sourceforge.net/release/xsl/current/manpages/docbook.xsl" ?>
+<?xml-stylesheet type="text/xsl" href="http://docbook.sourceforge.net/release/xsl-ns/current/manpages/docbook.xsl" ?>
 <refentry xmlns="http://docbook.org/ns/docbook" version="5.0" xmlns:xlink="http://www.w3.org/1999/xlink">
 <info>
 <author><personname><firstname>Mathieu</firstname><surname>Malaterre</surname></personname><contrib>Main developer</contrib></author>
diff --git a/Utilities/doxygen/man/gdcmscu.xml b/Utilities/doxygen/man/gdcmscu.xml
index 083baa7..8471ef1 100644
--- a/Utilities/doxygen/man/gdcmscu.xml
+++ b/Utilities/doxygen/man/gdcmscu.xml
@@ -1,5 +1,5 @@
 <?xml version='1.0' encoding='UTF-8' standalone='no'?>
-<?xml-stylesheet type="text/xsl" href="http://docbook.sourceforge.net/release/xsl/current/manpages/docbook.xsl" ?>
+<?xml-stylesheet type="text/xsl" href="http://docbook.sourceforge.net/release/xsl-ns/current/manpages/docbook.xsl" ?>
 <refentry xmlns="http://docbook.org/ns/docbook" version="5.0" xmlns:xlink="http://www.w3.org/1999/xlink">
 <info>
 <author><personname><firstname>Mathieu</firstname><surname>Malaterre</surname></personname><contrib>Main developer</contrib></author>
diff --git a/Utilities/doxygen/man/gdcmtar.xml b/Utilities/doxygen/man/gdcmtar.xml
index ac36457..2e0efe0 100644
--- a/Utilities/doxygen/man/gdcmtar.xml
+++ b/Utilities/doxygen/man/gdcmtar.xml
@@ -1,5 +1,5 @@
 <?xml version='1.0' encoding='UTF-8' standalone='no'?>
-<?xml-stylesheet type="text/xsl" href="http://docbook.sourceforge.net/release/xsl/current/manpages/docbook.xsl" ?>
+<?xml-stylesheet type="text/xsl" href="http://docbook.sourceforge.net/release/xsl-ns/current/manpages/docbook.xsl" ?>
 <refentry xmlns="http://docbook.org/ns/docbook" version="5.0" xmlns:xlink="http://www.w3.org/1999/xlink">
 <info>
 <author><personname><firstname>Mathieu</firstname><surname>Malaterre</surname></personname><contrib>Main developer</contrib></author>
diff --git a/Utilities/doxygen/man/gdcmviewer.xml b/Utilities/doxygen/man/gdcmviewer.xml
index 985e15e..1857c2a 100644
--- a/Utilities/doxygen/man/gdcmviewer.xml
+++ b/Utilities/doxygen/man/gdcmviewer.xml
@@ -1,5 +1,5 @@
 <?xml version='1.0' encoding='UTF-8' standalone='no'?>
-<?xml-stylesheet type="text/xsl" href="http://docbook.sourceforge.net/release/xsl/current/manpages/docbook.xsl" ?>
+<?xml-stylesheet type="text/xsl" href="http://docbook.sourceforge.net/release/xsl-ns/current/manpages/docbook.xsl" ?>
 <refentry xmlns="http://docbook.org/ns/docbook" version="5.0" xmlns:xlink="http://www.w3.org/1999/xlink">
 <info>
 <author><personname><firstname>Mathieu</firstname><surname>Malaterre</surname></personname><contrib>Main developer</contrib></author>
diff --git a/Utilities/doxygen/man/gdcmxml.xml b/Utilities/doxygen/man/gdcmxml.xml
index 2803fbd..ad4e53a 100644
--- a/Utilities/doxygen/man/gdcmxml.xml
+++ b/Utilities/doxygen/man/gdcmxml.xml
@@ -1,5 +1,5 @@
 <?xml version='1.0' encoding='UTF-8' standalone='no'?>
-<?xml-stylesheet type="text/xsl" href="http://docbook.sourceforge.net/release/xsl/current/manpages/docbook.xsl" ?>
+<?xml-stylesheet type="text/xsl" href="http://docbook.sourceforge.net/release/xsl-ns/current/manpages/docbook.xsl" ?>
 <refentry xmlns="http://docbook.org/ns/docbook" version="5.0" xmlns:xlink="http://www.w3.org/1999/xlink">
 <info>
 <author><personname><firstname>Mathieu</firstname><surname>Malaterre</surname></personname><contrib>Main developer</contrib></author>
diff --git a/Utilities/doxygen/vtk/CMakeLists.txt b/Utilities/doxygen/vtk/CMakeLists.txt
index 83a9fbd..7f1432c 100644
--- a/Utilities/doxygen/vtk/CMakeLists.txt
+++ b/Utilities/doxygen/vtk/CMakeLists.txt
@@ -31,7 +31,13 @@ mark_as_advanced(VTK_DIR)
   set(DOXYGEN_SOURCE_DIR "${VTK_SOURCE_DIR}/Utilities/Doxygen")
   else()
       # sudo apt-get install vtk-doc
-  set(DOXYGEN_SOURCE_DIR "/usr/share/doc/vtk-doc/html/")
+  if(EXISTS "/usr/share/doc/vtk-doc/html")
+  set(DOXYGEN_SOURCE_DIR "/usr/share/doc/vtk-doc/html")
+  elseif(EXISTS "/usr/share/doc/vtk6-doc/doxygen")
+  set(DOXYGEN_SOURCE_DIR "/usr/share/doc/vtk6-doc/doxygen")
+  else()
+  message(WARNING "DOXYGEN_SOURCE_DIR need to be set.")
+  endif()
   endif()
   set(DOXYGEN_PROJECT_SOURCE_DIR "${vtkgdcm_SOURCE_DIR}")
   set(VTK_DOXYGEN_HOME "${vtkgdcm_SOURCE_DIR}/VTK/Utilities/Doxygen")
diff --git a/Utilities/gdcmopenjpeg-v1/libopenjpeg/t2.c b/Utilities/gdcmopenjpeg-v1/libopenjpeg/t2.c
index 48463c9..550dde9 100644
--- a/Utilities/gdcmopenjpeg-v1/libopenjpeg/t2.c
+++ b/Utilities/gdcmopenjpeg-v1/libopenjpeg/t2.c
@@ -714,7 +714,11 @@ int t2_decode_packets(opj_t2_t *t2, unsigned char *src, int len, int tileno, opj
 			} else {
 				e = 0;
 			}
-			if(e == -999) return -999;
+			if(e == -999)
+			{
+			pi_destroy(pi, cp, tileno);
+			return -999;
+			}
 			/* progression in resolution */
 			image->comps[pi[pino].compno].resno_decoded =	
 				(e > 0) ? 
diff --git a/Utilities/gdcmzlib/gzio.c b/Utilities/gdcmzlib/gzio.c
index 7e90f49..5cf50e0 100644
--- a/Utilities/gdcmzlib/gzio.c
+++ b/Utilities/gdcmzlib/gzio.c
@@ -256,7 +256,7 @@ int ZEXPORT gzsetparams (file, level, strategy)
 /* ===========================================================================
      Read a byte from a gz_stream; update next_in and avail_in. Return EOF
    for end of file.
-   IN assertion: the stream s has been sucessfully opened for reading.
+   IN assertion: the stream s has been successfully opened for reading.
 */
 local int get_byte(s)
     gz_stream *s;
@@ -281,7 +281,7 @@ local int get_byte(s)
     mode to transparent if the gzip magic header is not present; set s->err
     to Z_DATA_ERROR if the magic header is present but the rest of the header
     is incorrect.
-    IN assertion: the stream s has already been created sucessfully;
+    IN assertion: the stream s has already been created successfully;
        s->stream.avail_in is zero for the first time, but may be non-zero
        for concatenated .gz files.
 */
diff --git a/Wrapping/Csharp/gdcm.i b/Wrapping/Csharp/gdcm.i
index 437f47b..b1a0dda 100644
--- a/Wrapping/Csharp/gdcm.i
+++ b/Wrapping/Csharp/gdcm.i
@@ -239,6 +239,7 @@ public class";
 #include "gdcmBoxRegion.h"
 #include "gdcmImageRegionReader.h"
 #include "gdcmJSON.h"
+#include "gdcmFileDecompressLookupTable.h"
 
 using namespace gdcm;
 %}
@@ -356,6 +357,7 @@ EXTEND_CLASS_PRINT(gdcm::VM)
 %template (FilenamesType) std::vector<std::string>;
 %include "gdcmDirectory.h"
 EXTEND_CLASS_PRINT(gdcm::Directory)
+%clear FilenamesType;
 %include "gdcmObject.h"
 %include "gdcmValue.h"
 EXTEND_CLASS_PRINT(gdcm::Value)
@@ -441,6 +443,7 @@ EXTEND_CLASS_PRINT(gdcm::SequenceOfItems)
 %include "gdcmDataSet.h"
 EXTEND_CLASS_PRINT(gdcm::DataSet)
 //%include "gdcmString.h"
+//%include "gdcmCodeString.h"
 //%include "gdcmTransferSyntax.h"
 %include "gdcmPhotometricInterpretation.h"
 EXTEND_CLASS_PRINT(gdcm::PhotometricInterpretation)
@@ -537,6 +540,8 @@ EXTEND_CLASS_PRINT(gdcm::Pixmap)
 EXTEND_CLASS_PRINT(gdcm::Image)
 %include "gdcmFragment.h"
 EXTEND_CLASS_PRINT(gdcm::Fragment)
+// convert SWIGTYPE_p_std__vectorT_gdcm__Fragment_t__size_type
+%template() std::vector< gdcm::Fragment >;
 %include "gdcmPDBElement.h"
 EXTEND_CLASS_PRINT(gdcm::PDBElement)
 %include "gdcmPDBHeader.h"
@@ -865,3 +870,4 @@ EXTEND_CLASS_PRINT(gdcm::BoxRegion)
 %include "gdcmImageRegionReader.h"
 %clear char* inreadbuffer;
 %include "gdcmJSON.h"
+%include "gdcmFileDecompressLookupTable.h"
diff --git a/Wrapping/Java/CMakeLists.txt b/Wrapping/Java/CMakeLists.txt
index 12454d6..a1f46b3 100644
--- a/Wrapping/Java/CMakeLists.txt
+++ b/Wrapping/Java/CMakeLists.txt
@@ -1,6 +1,3 @@
-# TODO:
-# SWIG is really a pain in the neck to use, a better alternative is Py++ which is using
-# gccxml for the C++ parser and allow a full ANSI C++ support
 find_package(SWIG REQUIRED)
 include(${SWIG_USE_FILE})
 option(GDCM_AUTOLOAD_GDCMJNI "Automatically load gdcmjni" ON)
@@ -17,13 +14,12 @@ include_directories(
 
 # $ export JAVA_HOME=/usr/lib/j2sdk1.6-sun/
 # $ export JAVA_HOME=/usr/lib/jvm/java-1.5.0-sun/
-find_package(Java 1.5 REQUIRED) # javac, jar
+find_package(Java 1.7 REQUIRED) # javac, jar
 find_package(JNI REQUIRED)
 include_directories(
   ${JNI_INCLUDE_DIRS}
   )
 set_source_files_properties(gdcm.i PROPERTIES CPLUSPLUS ON)
-#include(${GDCM_SOURCE_DIR}/CMake/UseSWIGExtra.cmake)
 
 set(GDCM_JAVA_HOME ${CMAKE_CURRENT_BINARY_DIR}/java/gdcm)
 file(MAKE_DIRECTORY ${GDCM_JAVA_HOME})
@@ -70,7 +66,7 @@ if(CMAKE_COMPILER_IS_GNUCXX)
 endif()
 
 add_custom_command(
-  OUTPUT ${LIBRARY_OUTPUT_PATH}/gdcm.jar
+  OUTPUT ${GDCM_LIBRARY_DIR}/gdcm.jar
 # 1. run the custom command only when the gdcmJAVA_wrap.cxx has been generated
 # (which means all *.java should be there) Some compiler are picky about Java
 # version. For instance covariant return type was only added to Java 5, so to
@@ -81,7 +77,7 @@ add_custom_command(
 # 2. now that the *.class have been generated construct the jar file. We can
 # only rely on the gdcm.java / gdcm.class to build dependencie, I am pretty
 # sure it will break parallel builds... oh well
-  COMMAND ${Java_JAR_EXECUTABLE} ARGS cvf ${LIBRARY_OUTPUT_PATH}/gdcm.jar gdcm/*.class
+  COMMAND ${Java_JAR_EXECUTABLE} ARGS cvf ${GDCM_LIBRARY_DIR}/gdcm.jar gdcm/*.class
   WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/java
   DEPENDS "${swig_generated_file_fullname}"
   COMMENT "javac *.java; jar cvf -> gdcm.jar"
@@ -89,14 +85,15 @@ add_custom_command(
 
 # 3. ok now add the target
 add_custom_target(GDCMJavaJar ALL
-  DEPENDS ${LIBRARY_OUTPUT_PATH}/gdcm.jar
+  DEPENDS ${GDCM_LIBRARY_DIR}/gdcm.jar
   COMMENT "building gdcm.jar"
 )
 
 if(NOT GDCM_INSTALL_NO_LIBRARIES)
   install_swig_module(gdcmjni Java)
+  set(GDCM_LIBRARY_DIR2 ${LIBRARY_OUTPUT_PATH}/\${BUILD_TYPE})
   # because gdcm.jar is constructed with custom commands, it need the INSTALL(FILES signature:
-  install(FILES ${LIBRARY_OUTPUT_PATH}/gdcm.jar
+  install(FILES ${GDCM_LIBRARY_DIR2}/gdcm.jar
     DESTINATION ${GDCM_INSTALL_JARMODULE_DIR} COMPONENT JavaModule
   )
 endif()
diff --git a/Wrapping/Java/gdcm.i b/Wrapping/Java/gdcm.i
index 90edb5c..772996e 100644
--- a/Wrapping/Java/gdcm.i
+++ b/Wrapping/Java/gdcm.i
@@ -33,6 +33,7 @@
 #include "gdcmSwapCode.h"
 #include "gdcmEvent.h"
 #include "gdcmProgressEvent.h"
+#include "gdcmFileNameEvent.h"
 #include "gdcmAnonymizeEvent.h"
 #include "gdcmDirectory.h"
 #ifdef GDCM_BUILD_TESTING
@@ -89,6 +90,7 @@
 #include "gdcmUUIDGenerator.h"
 //#include "gdcmConstCharWrapper.h"
 #include "gdcmScanner.h"
+#include "gdcmStrictScanner.h"
 #include "gdcmAttribute.h"
 #include "gdcmSubject.h"
 #include "gdcmCommand.h"
@@ -147,6 +149,7 @@
 #include "gdcmDecoder.h"
 #include "gdcmCodec.h"
 #include "gdcmImageCodec.h"
+#include "gdcmRLECodec.h"
 #include "gdcmJPEGCodec.h"
 #include "gdcmJPEGLSCodec.h"
 #include "gdcmJPEG2000Codec.h"
@@ -189,6 +192,7 @@
 #include "gdcmBoxRegion.h"
 #include "gdcmImageRegionReader.h"
 #include "gdcmJSON.h"
+#include "gdcmFileDecompressLookupTable.h"
 
 using namespace gdcm;
 %}
@@ -310,6 +314,12 @@ EXTEND_CLASS_PRINT(gdcm::PrivateTag)
     return dynamic_cast<ProgressEvent*>(event);
   }
 };
+%include "gdcmFileNameEvent.h"
+%extend gdcm::FileNameEvent {
+  static FileNameEvent *Cast(Event *event) {
+    return dynamic_cast<FileNameEvent*>(event);
+  }
+};
 //%feature("director") AnonymizeEvent;
 %include "gdcmAnonymizeEvent.h"
 %extend gdcm::AnonymizeEvent {
@@ -508,6 +518,8 @@ EXTEND_CLASS_PRINT(gdcm::Pixmap)
 EXTEND_CLASS_PRINT(gdcm::Image)
 %include "gdcmFragment.h"
 EXTEND_CLASS_PRINT(gdcm::Fragment)
+// convert SWIGTYPE_p_std__vectorT_gdcm__Fragment_t__size_type
+%template() std::vector< gdcm::Fragment >;
 %include "gdcmPDBElement.h"
 EXTEND_CLASS_PRINT(gdcm::PDBElement)
 %include "gdcmPDBHeader.h"
@@ -652,6 +664,9 @@ $1 = JNU_GetStringNativeChars(jenv, $input);
 %template(SmartPtrScan) gdcm::SmartPointer<gdcm::Scanner>;
 %include "gdcmScanner.h"
 EXTEND_CLASS_PRINT(gdcm::Scanner)
+%template(SmartPtrStrictScan) gdcm::SmartPointer<gdcm::StrictScanner>;
+%include "gdcmStrictScanner.h"
+EXTEND_CLASS_PRINT(gdcm::StrictScanner)
 
 %template(SmartPtrAno) gdcm::SmartPointer<gdcm::Anonymizer>;
 //%ignore gdcm::Anonymizer::Anonymizer;
@@ -776,6 +791,7 @@ EXTEND_CLASS_PRINT(gdcm::ModuleEntry)
 //%include "gdcmCodec.h"
 %feature("director") ImageCodec;
 %include "gdcmImageCodec.h"
+%include "gdcmRLECodec.h"
 %include "gdcmJPEGCodec.h"
 %include "gdcmJPEGLSCodec.h"
 %include "gdcmJPEG2000Codec.h"
@@ -852,3 +868,4 @@ EXTEND_CLASS_PRINT(gdcm::BoxRegion)
 //EXTEND_CLASS_PRINT(gdcm::ImageRegionReader)
 %clear signed char* inreadbuffer;
 %include "gdcmJSON.h"
+%include "gdcmFileDecompressLookupTable.h"
diff --git a/Wrapping/Python/CMakeLists.txt b/Wrapping/Python/CMakeLists.txt
index d019607..3bf7247 100644
--- a/Wrapping/Python/CMakeLists.txt
+++ b/Wrapping/Python/CMakeLists.txt
@@ -20,7 +20,11 @@ include_regular_expression("^(gdcm).*$")
 # http://sourceforge.net/mailarchive/message.php?msg_id=29294773
 # 2.0.6 cannot be used because of a serious typemap bug in 2.0.5
 # http://sourceforge.net/mailarchive/message.php?msg_id=29305946
+if(GDCM_WEAK_SWIG_CHECK)
+find_package(SWIG 2.0.4 REQUIRED)
+else()
 find_package(SWIG 2.0.7 REQUIRED)
+endif()
 mark_as_advanced(SWIG_DIR SWIG_EXECUTABLE SWIG_VERSION)
 include(${SWIG_USE_FILE})
 
@@ -109,6 +113,9 @@ if(WIN32 AND NOT CYGWIN)
   set_target_properties(${SWIG_MODULE_${GDCM_PYTHON_IMPLEMENTATION_NAME}_REAL_NAME} PROPERTIES SUFFIX ".pyd")
   # shared libs on windows needs to be fully resolved
   SWIG_LINK_LIBRARIES(${GDCM_PYTHON_IMPLEMENTATION_NAME} ${PYTHON_LIBRARIES})
+  message(STATUS "Will use pyd extension" )
+else()
+  message(STATUS "Will NOT use pyd extension" )
 endif()
 set_target_properties(${SWIG_MODULE_${GDCM_PYTHON_IMPLEMENTATION_NAME}_REAL_NAME} PROPERTIES LINK_INTERFACE_LIBRARIES "")
 
diff --git a/Wrapping/Python/TestWrap.py b/Wrapping/Python/TestWrap.py
index a77bf0a..abd0255 100755
--- a/Wrapping/Python/TestWrap.py
+++ b/Wrapping/Python/TestWrap.py
@@ -49,12 +49,14 @@ blacklist = (
 "GroupDict"
 "DictConverter"
 # Information thingy :
+"Tables"
 "MacroEntry"
 "XMLDictReader"
 "TableReader"
 "Table"
 "XMLPrivateDictReader"
 # Common
+"Configure"
 "LegacyMacro"
 "Swapper"
 "SmartPointer"
@@ -180,6 +182,19 @@ blacklist = (
 "SOPClassExtendedNegociationSub"
 "FindPatientRootQuery"
 "ServiceClassApplicationInformation"
+"ModalityPerformedProcedureStepSetQuery"
+"NormalizedMessageFactory"
+"NormalizedNetworkFunctions"
+"NSetMessages"
+"WLMFindQuery"
+"ModalityPerformedProcedureStepCreateQuery"
+"BaseNormalizedMessage"
+"NCreateMessages"
+"NActionMessages"
+"NGetMessages"
+"BaseQuery"
+"NEventReportMessages"
+"NDeleteMessages"
 )
 
 def processonedir(dirname):
diff --git a/Wrapping/Python/gdcmPythonFilter.h b/Wrapping/Python/gdcmPythonFilter.h
index 2874aeb..e255b66 100644
--- a/Wrapping/Python/gdcmPythonFilter.h
+++ b/Wrapping/Python/gdcmPythonFilter.h
@@ -34,7 +34,7 @@ public:
   PythonFilter();
   ~PythonFilter();
 
-  void UseDictAlways(bool use) {}
+  void UseDictAlways(bool ) {}
 
   // Allow user to pass in there own dicts
   void SetDicts(const Dicts &dicts);
diff --git a/Wrapping/Python/gdcmswig.i b/Wrapping/Python/gdcmswig.i
index b290737..7bf0027 100644
--- a/Wrapping/Python/gdcmswig.i
+++ b/Wrapping/Python/gdcmswig.i
@@ -33,6 +33,7 @@
 #include "gdcmSwapCode.h"
 #include "gdcmEvent.h"
 #include "gdcmProgressEvent.h"
+#include "gdcmFileNameEvent.h"
 #include "gdcmAnonymizeEvent.h"
 #include "gdcmDirectory.h"
 #ifdef GDCM_BUILD_TESTING
@@ -89,6 +90,7 @@
 #include "gdcmUUIDGenerator.h"
 //#include "gdcmConstCharWrapper.h"
 #include "gdcmScanner.h"
+#include "gdcmStrictScanner.h"
 #include "gdcmAttribute.h"
 #include "gdcmSubject.h"
 #include "gdcmCommand.h"
@@ -148,6 +150,7 @@
 #include "gdcmDecoder.h"
 #include "gdcmCodec.h"
 #include "gdcmImageCodec.h"
+#include "gdcmRLECodec.h"
 #include "gdcmJPEGCodec.h"
 #include "gdcmJPEGLSCodec.h"
 #include "gdcmJPEG2000Codec.h"
@@ -190,6 +193,7 @@
 #include "gdcmBoxRegion.h"
 #include "gdcmImageRegionReader.h"
 #include "gdcmJSON.h"
+#include "gdcmFileDecompressLookupTable.h"
 
 using namespace gdcm;
 %}
@@ -290,7 +294,6 @@ EXTEND_CLASS_PRINT(gdcm::VM)
 %template (FilenamesType) std::vector<std::string>;
 %include "gdcmDirectory.h"
 EXTEND_CLASS_PRINT(gdcm::Directory)
-//%clear FilenameType;
 %clear FilenamesType;
 %include "gdcmObject.h"
 %include "gdcmValue.h"
@@ -433,6 +436,9 @@ EXTEND_CLASS_PRINT(gdcm::Pixmap)
 EXTEND_CLASS_PRINT(gdcm::Image)
 %include "gdcmFragment.h"
 EXTEND_CLASS_PRINT(gdcm::Fragment)
+// convert SWIGTYPE_p_std__vectorT_gdcm__Fragment_t__size_type
+//%template() std::vector< gdcm::Fragment >;
+// -> error: ‘type_name’ is not a member of ‘swig::traits<gdcm::Fragment>’ (swig 3.0.7)
 %include "gdcmPDBElement.h"
 EXTEND_CLASS_PRINT(gdcm::PDBElement)
 %include "gdcmPDBHeader.h"
@@ -536,6 +542,9 @@ EXTEND_CLASS_PRINT(gdcm::Dicts)
 %template(SmartPtrScan) gdcm::SmartPointer<gdcm::Scanner>;
 %include "gdcmScanner.h"
 EXTEND_CLASS_PRINT(gdcm::Scanner)
+%template(SmartPtrStrictScan) gdcm::SmartPointer<gdcm::StrictScanner>;
+%include "gdcmStrictScanner.h"
+EXTEND_CLASS_PRINT(gdcm::StrictScanner)
 
 %template(SmartPtrAno) gdcm::SmartPointer<gdcm::Anonymizer>;
 //%ignore gdcm::Anonymizer::Anonymizer;
@@ -724,6 +733,7 @@ EXTEND_CLASS_PRINT(gdcm::ModuleEntry)
 //%include "gdcmCodec.h"
 %feature("director") ImageCodec;
 %include "gdcmImageCodec.h"
+%include "gdcmRLECodec.h"
 %include "gdcmJPEGCodec.h"
 %include "gdcmJPEGLSCodec.h"
 %include "gdcmJPEG2000Codec.h"
@@ -785,3 +795,4 @@ EXTEND_CLASS_PRINT(gdcm::BoxRegion)
 %include "gdcmImageRegionReader.h"
 %clear char* inreadbuffer;
 %include "gdcmJSON.h"
+%include "gdcmFileDecompressLookupTable.h"
diff --git a/appveyor.yml b/appveyor.yml
index 6860569..9322396 100644
--- a/appveyor.yml
+++ b/appveyor.yml
@@ -2,14 +2,24 @@
 # http://www.appveyor.com/docs/appveyor-yml
 
 # Set build version format here instead of in the admin panel.
-version: 2.6.2.{build}
+version: 2.6.3.{build}
 
 # http://www.appveyor.com/docs/build-cache#caching-chocolatey-packages
 # https://github.com/kvirc/KVIrc/blob/master/.appveyor.yml
 cache:
   - C:\ProgramData\chocolatey\bin -> appveyor.yml
   - C:\ProgramData\chocolatey\lib -> appveyor.yml
-  - 'c:\Program Files\NSIS'
+  - 'C:\Program Files (x86)\NSIS'
+
+## http://www.appveyor.com/docs/installed-software#python
+## Python 2.7; 32-bit version
+#    - python: C:\Python27;C:\Python27\Scripts
+## Python 2.7; 64-bit version
+#    - python: C:\Python27-x64;C:\Python27-x64\Scripts
+## Python 3.4; 32-bit version
+#    - python: C:\Python34;C:\Python34\Scripts
+## Python 3.4; 64-bit version
+#    - python: C:\Python34-x64;C:\Python34-x64\Scripts
 
 environment:
   matrix:
@@ -17,10 +27,14 @@ environment:
     CONFIG: Release
     B_NAME: Windows-x86
     DO_REL: true
+    PYTHONHOME: C:\Python27
+    JAVA_HOME: C:\Program Files (x86)\Java\jdk1.7.0
   - VS_GEN: Visual Studio 10 2010 Win64
     CONFIG: Release
     B_NAME: Windows-x86_64
     DO_REL: true
+    PYTHONHOME: C:\Python34-x64
+    JAVA_HOME: C:\Program Files\Java\jdk1.8.0
 #  - VS_GEN: Visual Studio 14 2015 Win64
 #    CONFIG: Release
 #    B_NAME: Win64
@@ -49,6 +63,7 @@ branches:
 # scripts that are called at very beginning, before repo cloning
 init:
   # Print environment info ( set / systeminfo)
+  - set PATH=%JAVA_HOME%\bin;%PYTHONHOME%;%PATH%
   - msbuild /version
   - cmake --version
   - python --version
@@ -57,29 +72,39 @@ init:
   - del c:\programdata\chocolatey\bin\cpack.exe
 
 # scripts that run after cloning repository
+# https://www.appveyor.com/docs/build-configuration#powershell
 install:
   # Fetch submodules
   #- git submodule update --init --recursive
-  - choco install swig
+  # PowerShell
+  #- ps: (New-Object Net.WebClient).DownloadFile('http://download.microsoft.com/download/f/2/6/f263ac46-1fe9-4ae9-8fd3-21102100ebf5/msxsl.exe', "$env:appveyor_build_folder\msxsl.exe")
+  #- msxsl -? --> code return is 1 !!
+  # chocolatey:
+  - ps: |
+      if (Test-Path "C:/ProgramData/chocolatey/bin/swig.exe") {
+          echo "using swig from cache"
+      } else {
+          choco install -y swig > $null
+      }
   - swig -version
   # https://chocolatey.org/packages/nsis.install/
   - ps: |
-      if (Test-Path "c:/Program Files/NSIS/makensis.exe") {
+      if (Test-Path "C:/Program Files (x86)/NSIS/makensis.exe") {
           echo "using nsis from cache"
       } else {
-          choco install nsis.install -pre -version 2.46.0.20150406
+          choco install -y nsis.install -pre -version 2.46.0.20150406
       }
-  # Set VC variables for the platform
-  #  - if %PLATFORM% == x64 call "C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\bin\x86_amd64\vcvarsx86_amd64.bat"
-  #  - if %PLATFORM% == x86 call "C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\bin\vcvars32.bat"
+  - cmd: SET PATH=%PATH%;C:\Program Files (x86)\NSIS
 
 on_failure:
   # Display error log file if generated
-  - if exist C:\ProgramData\chocolatey\logs\chocolatey.log type C:\ProgramData\chocolatey\logs\chocolatey.log
+  - dir C:\projects\gdcm\bin
+  - dir C:\projects\gdcm\bin\Release
+  #- if exist C:\ProgramData\chocolatey\logs\chocolatey.log type C:\ProgramData\chocolatey\logs\chocolatey.log
 
 # scripts to run before build
 before_build:
-  - cmake -Wno-dev -G"%VS_GEN%" -DCMAKE_BUILD_TYPE=%CONFIG% -DGDCM_BUILD_TESTING:BOOL=ON -DGDCM_BUILD_APPLICATIONS:BOOL=ON -DGDCM_BUILD_SHARED_LIBS:BOOL=ON -DBUILDNAME:STRING=%COMPUTERNAME%-%B_NAME% -DGDCM_WRAP_CSHARP:BOOL=ON -DGDCM_WRAP_JAVA:BOOL=ON -DGDCM_WRAP_PYTHON:BOOL=ON -DGDCM_USE_PVRG:BOOL=ON -DGDCM_JAVA_SOURCE_VERSION:STRING=1.7 -DGDCM_JAVA_TARGET_VERSION:STRING=1.7 -DCPACK_SYSTEM_NAME:STRING=%B_NAME% .
+  - cmake -Wno-dev -G"%VS_GEN%" -DCMAKE_BUILD_TYPE=%CONFIG% -DGDCM_BUILD_TESTING:BOOL=ON -DGDCM_BUILD_APPLICATIONS:BOOL=ON -DGDCM_BUILD_EXAMPLES:BOOL=ON -DGDCM_BUILD_SHARED_LIBS:BOOL=ON -DBUILDNAME:STRING=%COMPUTERNAME%-%branch%-%B_NAME% -DGDCM_WRAP_CSHARP:BOOL=ON -DGDCM_WRAP_JAVA:BOOL=ON -DGDCM_WRAP_PYTHON:BOOL=ON -DGDCM_USE_PVRG:BOOL=ON -DGDCM_LEGACY_SILENT:BOOL=ON -DCPACK_SYSTEM_NAME:STRING=%B_NAME% .
   - ctest -D ExperimentalStart -C %CONFIG%
 
 # scripts to run after build
@@ -88,18 +113,13 @@ after_build:
   - cpack -G NSIS -C %CONFIG%
   # create binary zip
   - cpack -G ZIP -C %CONFIG%
-  # on github it does make sense to do source package
+  # no need for source release on github
 
 # to run your custom scripts instead of automatic MSBuild
 build_script:
   # Do not run Test=Update/Configure, only Start/Build/Test/Submit (TODO: Coverage)
   - ctest -D ExperimentalBuild -j %NUMBER_OF_PROCESSORS% -C %CONFIG% -Q
 
-# scripts to run before tests
-#before_test:
-#  - echo %APPVEYOR_REPO_TAG_NAME%
-#  - echo %APPVEYOR_REPO_TAG_NAME:~1%
-
 # scripts to run after tests
 after_test:
 

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/debian-med/gdcm.git



More information about the debian-med-commit mailing list