Commit 8b2083eb authored by Gert Wollny's avatar Gert Wollny
Browse files

New upstream version 0.8.12

parent c8b97ae1
Loading
Loading
Loading
Loading
+102 −90
Original line number Diff line number Diff line
@@ -14,7 +14,7 @@ include(CTest)
# Project version
set(DICOM_MAJOR_VERSION 0)
set(DICOM_MINOR_VERSION 8)
set(DICOM_PATCH_VERSION 11)
set(DICOM_PATCH_VERSION 12)
set(DICOM_SHORT_VERSION "${DICOM_MAJOR_VERSION}.${DICOM_MINOR_VERSION}")
set(DICOM_VERSION "${DICOM_SHORT_VERSION}.${DICOM_PATCH_VERSION}")

@@ -29,7 +29,18 @@ set(DICOM_INCLUDE_DIRS
  "${DICOM_SOURCE_DIR}/Source"
  "${DICOM_BINARY_DIR}/Source")

if(DEFINED VTK_MODULE_ENABLE_VTK_DICOM)
# Is this CMakeLists.txt file being called directly by cmake?
if("${CMAKE_PROJECT_NAME}" STREQUAL "${PROJECT_NAME}")
  set(_dicom_direct_build ON)
else()
  set(_dicom_direct_build OFF)
endif()

set(DICOM_EXTERNAL_BUILD ${_dicom_direct_build} CACHE BOOL
    "Building DICOM module external to the VTK build")
mark_as_advanced(DICOM_EXTERNAL_BUILD)

if(DEFINED VTK_MODULE_ENABLE_VTK_DICOM AND NOT DICOM_EXTERNAL_BUILD)
  # When building as a remote module for VTK 9 (or VTK 8.90+)
  message(STATUS "vtkDICOM: Building vtkDICOM as a Remote VTK Module")

@@ -65,6 +76,23 @@ elseif(Module_vtkDICOM)
  set(BUILD_EXAMPLES ${BUILD_DICOM_EXAMPLES})

else()
  # When building external to VTK
  message(STATUS "vtkDICOM: Building vtkDICOM outside of VTK")

  # Find VTK and get VTK configuration information
  find_package(VTK REQUIRED)

  # define VTK_VERSION if not already defined
  if(NOT DEFINED VTK_VERSION)
    set(VTK_VERSION ${VTK_MAJOR_VERSION}.${VTK_MINOR_VERSION})
  endif()
  if(VTK_VERSION VERSION_LESS 8.90)
    include(${VTK_USE_FILE})
  endif()
  if(VTK_VERSION VERSION_LESS 5.8)
    message(FATAL_ERROR "VTK 5.8 or later is required.")
  endif()

  # We are being built as a stand-alone package
  set(VTK_DICOM_LINK_TARGET vtkDICOM)

@@ -80,30 +108,9 @@ else()
  option(BUILD_PROGRAMS "Build some useful DICOM tools" ON)
  option(BUILD_EXAMPLES "Build the examples" OFF)

  find_package(VTK REQUIRED)
  message(STATUS "vtkDICOM: Building vtkDICOM stand-alone")
  if(NOT DEFINED VTK_VERSION)
    # backwards compatibility pre VTK 9.x
    set(VTK_VERSION ${VTK_MAJOR_VERSION}.${VTK_MINOR_VERSION})
  endif()
  if(VTK_VERSION VERSION_LESS 8.90)
    include(${VTK_USE_FILE})
  endif()
  if(VTK_VERSION VERSION_LESS 5.8)
    message(FATAL_ERROR "VTK 5.8 or later is required.")
  endif()

  # Wrap Python option
  if(VTK_WRAP_PYTHON)
    if(VTK_VERSION VERSION_LESS 8.90)
    option(BUILD_PYTHON_WRAPPERS "Build python wrappers" ON)
    else()
      message(WARNING
              "Stand-alone vtkDICOMPython not yet supported for "
              "VTK ${VTK_VERSION}, try building vtk-dicom as a remote "
              "module instead.")
      unset(BUILD_PYTHON_WRAPPERS CACHE)
    endif()
  else()
    unset(BUILD_PYTHON_WRAPPERS CACHE)
  endif()
@@ -117,19 +124,14 @@ else()

  # Wrap Java option
  if(VTK_WRAP_JAVA)
    if(VTK_VERSION VERSION_LESS 8.90)
      option(BUILD_PYTHON_WRAPPERS "Build python wrappers" ON)
    else()
      message(WARNING
              "Stand-alone vtkDICOMJava not yet supported for "
              "VTK ${VTK_VERSION}, try building vtk-dicom as a remote "
              "module instead.")
      unset(BUILD_JAVA_WRAPPERS CACHE)
    endif()
    option(BUILD_JAVA_WRAPPERS "Build java wrappers" OFF)
  else()
    unset(BUILD_JAVA_WRAPPERS CACHE)
  endif()

  # Defines CMAKE_INSTALL_LIBDIR etcetera
  include(GNUInstallDirs)

  # Set up our directory structure for output libraries and binaries
  # (Note: these are the build locations, not the install locations)
  if(NOT CMAKE_RUNTIME_OUTPUT_DIRECTORY)
@@ -168,58 +170,61 @@ else()
      include_directories("${ZLIB_INCLUDE_DIR}")
    endif()
  endif()
endif()

# GDCM or DCMTK are required for reading compressed DICOM images
option(USE_ITK_GDCM "Use ITK's GDCM for image decompression" OFF)
option(USE_GDCM "Use GDCM for image decompression" OFF)
if(USE_ITK_GDCM)
  # To avoid conflicts, we might want to use ITK's GDCM
  find_package(ITK REQUIRED)
  if(ITK_FOUND)
    include(${ITK_USE_FILE})
    set(GDCM_LIBS gdcmMSFF gdcmIOD gdcmDSED gdcmDICT)
    set(GDCM_FOUND 1)
    set(USE_GDCM ON CACHE BOOL "Use GDCM for image decompression" FORCE)
  endif()
elseif(USE_GDCM)
  find_package(GDCM)
  if(NOT GDCM_DIR)
    message(FATAL_ERROR "Please set GDCM_DIR.")
  endif()
  if(GDCM_FOUND)
    include(${GDCM_USE_FILE})
    set(GDCM_LIBS gdcmMSFF gdcmIOD gdcmDSED gdcmDICT)
  endif()
endif()
  if(NOT VTK_VERSION VERSION_LESS 8.90)
    # When building as a stand-alone module for VTK 9
    message(STATUS "vtkDICOM: Building as an External VTK Module")

option(USE_DCMTK "Use DCMTK for image decompression" OFF)
set(DCMTK_LIBS)
if(USE_DCMTK)
  find_package(DCMTK)
  if(NOT DCMTK_FOUND)
    message(FATAL_ERROR "DCMTK not found or incomplete.")
  endif()
  if(${DCMTK_charls_LIBRARY})
    set(DCMTK_LIBS ${DCMTK_LIBRARIES} ${DCMTK_charls_LIBRARY})
  else()
    set(DCMTK_LIBS ${DCMTK_LIBRARIES})
  endif()
  if(APPLE)
    list(APPEND DCMTK_LIBS iconv)
  endif()
  include_directories(${DCMTK_INCLUDE_DIRS})
    # Clear VTK_LIBS, linking will be handled by modular build
    set(VTK_LIBS)
    set(VTK_DICOM_LINK_TARGET VTK::DICOM)

    # To set DICOM_USE_VTKZLIB in vtkDICOMConfig.h
    set(DICOM_USE_VTKZLIB ON)

    vtk_module_scan(
      MODULE_FILES        "${CMAKE_CURRENT_SOURCE_DIR}/Source/dicom.module"
      REQUEST_MODULES     "VTK::DICOM"
      PROVIDES_MODULES    dicom_modules
      ENABLE_TESTS        "${BUILD_TESTING}")

    vtk_module_build(
      MODULES             ${dicom_modules}
      INSTALL_EXPORT      DICOM
      ARCHIVE_DESTINATION "lib"
      HEADERS_DESTINATION "include/dicom${DICOM_SHORT_VERSOIN}"
      CMAKE_DESTINATION   "${CMAKE_INSTALL_LIBDIR}/cmake/vtk"
      LICENSE_DESTINATION "${CMAKE_INSTALL_LIBDIR}/vtk"
      HIERARCHY_DESTINATION "${CMAKE_INSTALL_LIBDIR}/vtk/hierarchy/${CMAKE_PROJECT_NAME}"
      LIBRARY_NAME_SUFFIX "${DICOM_CUSTOM_LIBRARY_SUFFIX}"
      VERSION             "${DICOM_VERSION}"
      SOVERSION           "1"
      TEST_DATA_TARGET    DicomData
      USE_EXTERNAL        "${DICOM_USE_EXTERNAL}"
      TEST_INPUT_DATA_DIRECTORY   "${dicom_test_data_directory_input}"
      TEST_OUTPUT_DATA_DIRECTORY  "${dicom_test_data_directory_output}")

    if(BUILD_PYTHON_WRAPPERS)
      find_package(PythonInterp ${VTK_PYTHON_VERSION} QUIET)

      vtk_module_wrap_python(
        MODULES         ${dicom_modules}
        INSTALL_EXPORT  DICOMPython
        PYTHON_PACKAGE  "vtk.modules"
        #MODULE_DESTINATION  ""
        CMAKE_DESTINATION   "${CMAKE_INSTALL_LIBDIR}/cmake/vtk"
        LIBRARY_DESTINATION "${CMAKE_INSTALL_LIBDIR}"
        BUILD_STATIC    OFF)
    endif()

# Check for sqlite3 for reading OsiriX databases
set(USE_SQLITE_DEFAULT OFF)
set(SQLITE_LIBS)
if(APPLE)
  set(USE_SQLITE_DEFAULT ON)
    if(BUILD_JAVA_WRAPPERS)
      vtk_module_wrap_java(
        MODULES         ${dicom_modules}
        WRAPPED_MODULES dicom_java_wrapped_modules
        JAVA_OUTPUT     "${CMAKE_CURRENT_BINARY_DIR}/CMakeFiles")
    endif()
option(USE_SQLITE "Use SQLite for OsiriX databases" ${USE_SQLITE_DEFAULT})
if(USE_SQLITE)
  set(SQLITE_LIBS sqlite3)
  endif() #(NOT VTK_VERSION VERSION_LESS 8.90)

endif()

# Store the git hash of the current head
@@ -321,18 +326,23 @@ if(NOT Module_vtkDICOM)
  else()
    set(VTK_LIBS vtkCommon vtkFiltering vtkImaging vtkIO vtkInfovis) # VTK 5.x
  endif()
endif()

if(NOT Module_vtkDICOM AND VTK_VERSION VERSION_LESS 8.90)
  # External wrapping previous to VTK 9

  set(VTK_WRAP_INCLUDE_DIRS
    ${DICOM_INCLUDE_DIRS}
    ${VTK_WRAP_INCLUDE_DIRS})

  # For the python wrappers
  if(BUILD_PYTHON_WRAPPERS AND
     TARGET vtkCommonCorePythonD OR
  if(BUILD_PYTHON_WRAPPERS)
    if(TARGET vtkCommonCorePythonD OR
       TARGET vtkCommonKitPythonD OR
       TARGET vtkCommonPythonD)
      set(DICOM_PYTHON_LIBRARIES vtkDICOMPythonD)
    endif()
  endif()

  # For the tcl wrappers
  if(BUILD_TCL_WRAPPERS)
@@ -378,8 +388,10 @@ if(MSVC_VERSION EQUAL 1400 OR MSVC_VERSION GREATER 1400 OR MSVC10)
  add_definitions(-D_SCL_SECURE_NO_DEPRECATE -D_SCL_SECURE_NO_WARNINGS)
endif()

# The main library
if(NOT DICOM_EXTERNAL_BUILD OR NOT DEFINED VTK_MODULE_ENABLE_VTK_DICOM)
  # The main library, if not handled by the VTK 9 functions
  add_subdirectory(Source)
endif()

# Subdirectories
if(BUILD_PROGRAMS)
@@ -391,7 +403,7 @@ if(BUILD_EXAMPLES)
  add_subdirectory(Examples)
endif()

if(NOT DEFINED VTK_MODULE_ENABLE_VTK_DICOM)
if(DICOM_EXTERNAL_BUILD OR NOT DEFINED VTK_MODULE_ENABLE_VTK_DICOM)

  if(BUILD_TESTING)
    enable_testing()
+61 −2
Original line number Diff line number Diff line
# GDCM or DCMTK are required for reading compressed DICOM images
option(USE_ITK_GDCM "Use ITK's GDCM for image decompression" OFF)
option(USE_GDCM "Use GDCM for image decompression" OFF)
option(USE_DCMTK "Use DCMTK for image decompression" OFF)

# Check for sqlite3 for reading OsiriX databases
set(USE_SQLITE_DEFAULT OFF)
if(APPLE)
  set(USE_SQLITE_DEFAULT ON)
endif()
option(USE_SQLITE "Use SQLite for OsiriX databases" ${USE_SQLITE_DEFAULT})

# Configuration header
set(DICOM_BUILD_SHARED_LIBS ${BUILD_SHARED_LIBS})
set(DICOM_BUILD_TESTING ${BUILD_TESTING})
@@ -136,8 +148,54 @@ set_source_files_properties(${LIB_ABSTRACT}
set_source_files_properties(${LIB_PRIVATE_HDRS}
  PROPERTIES SKIP_HEADER_INSTALL ON)

# Third party library dependencies

if(USE_ITK_GDCM)
  # To avoid conflicts, we might want to use ITK's GDCM
  find_package(ITK REQUIRED)
  if(ITK_FOUND)
    include(${ITK_USE_FILE})
    set(GDCM_LIBS gdcmMSFF gdcmIOD gdcmDSED gdcmDICT)
    set(GDCM_FOUND 1)
    set(USE_GDCM ON CACHE BOOL "Use GDCM for image decompression" FORCE)
  endif()
elseif(USE_GDCM)
  find_package(GDCM)
  if(NOT GDCM_DIR)
    message(FATAL_ERROR "Please set GDCM_DIR.")
  endif()
  if(GDCM_FOUND)
    include(${GDCM_USE_FILE})
    set(GDCM_LIBS gdcmMSFF gdcmIOD gdcmDSED gdcmDICT)
  endif()
endif()

set(DCMTK_LIBS)
if(USE_DCMTK)
  find_package(DCMTK)
  if(NOT DCMTK_FOUND)
    message(FATAL_ERROR "DCMTK not found or incomplete.")
  endif()
  if(${DCMTK_charls_LIBRARY})
    set(DCMTK_LIBS ${DCMTK_LIBRARIES} ${DCMTK_charls_LIBRARY})
  else()
    set(DCMTK_LIBS ${DCMTK_LIBRARIES})
  endif()
  if(APPLE)
    list(APPEND DCMTK_LIBS iconv)
  endif()
  include_directories(${DCMTK_INCLUDE_DIRS})
endif()

set(SQLITE_LIBS)
if(USE_SQLITE)
  set(SQLITE_LIBS sqlite3)
endif()

# Create the library

if(DEFINED VTK_MODULE_ENABLE_VTK_DICOM)
  # When building as a remote module for VTK 9 (or VTK 8.90+)
  # When building as a module for VTK 8.90 or later
  set(LIB_SRC_HDRS)
  foreach(_src ${LIB_SRCS})
    get_filename_component(_base ${_src} NAME_WE)
@@ -156,6 +214,7 @@ elseif(Module_vtkDICOM)
    LINK_PRIVATE ${GDCM_LIBS} ${DCMTK_LIBS} ${SQLITE_LIBS})

else()
# The remainder of the file is for old, non-modular builds

configure_file(${DICOM_CMAKE_DIR}/vtkDICOMModule.h.in
  "${CMAKE_CURRENT_BINARY_DIR}/vtkDICOMModule.h" COPYONLY)
@@ -420,4 +479,4 @@ endif()
install(FILES ${LIB_HDRS}
  DESTINATION ${DICOM_INCLUDE_INSTALL_DEST} COMPONENT Development)

endif() # else MODULE_vtkDICOM
endif()

Source/dicom.module

0 → 100644
+18 −0
Original line number Diff line number Diff line
NAME
  VTK::DICOM
LIBRARY_NAME
  vtkDICOM
GROUPS
  StandAlone
DEPENDS
  VTK::CommonCore
  VTK::CommonDataModel
  VTK::CommonExecutionModel
  VTK::IOImage
PRIVATE_DEPENDS
  VTK::CommonMisc
  VTK::ImagingCore
  VTK::IOCore
  VTK::zlib
TEST_DEPENDS
  VTK::TestingCore
+3403 −3398

File changed.

Preview size limit exceeded, changes collapsed.

+4 −0
Original line number Diff line number Diff line
@@ -19,6 +19,9 @@ ImplementationVersionName = 0x00020013, // SH M1 0
SourceApplicationEntityTitle            = 0x00020016, // AE M1    0
SendingApplicationEntityTitle           = 0x00020017, // AE M1    0
ReceivingApplicationEntityTitle         = 0x00020018, // AE M1    0
SourcePresentationAddress               = 0x00020026, // UR M1    0
SendingPresentationAddress              = 0x00020027, // UR M1    0
ReceivingPresentationAddress            = 0x00020028, // UR M1    0
RTVMetaInformationVersion               = 0x00020031, // OB M1    0
RTVCommunicationSOPClassUID             = 0x00020032, // UI M1    0
RTVCommunicationSOPInstanceUID          = 0x00020033, // UI M1    0
@@ -242,6 +245,7 @@ AnatomicLocationOfExaminingInstrumentCodeSequenceTrial = 0x00082259, // SQ M1
AnatomicStructureSpaceOrRegionModifierCodeSequenceTrial = 0x0008225A, // SQ M1    1
OnAxisBackgroundAnatomicStructureCodeSequenceTrial = 0x0008225C, // SQ M1    1
AlternateRepresentationSequence         = 0x00083001, // SQ M1    0
AvailableTransferSyntaxUID              = 0x00083002, // UI M1TN  0
IrradiationEventUID                     = 0x00083010, // UI M1TN  0
SourceIrradiationEventSequence          = 0x00083011, // SQ M1    0
RadiopharmaceuticalAdministrationEventUID = 0x00083012, // UI M1    0
Loading