[ITK] Update to 5.1 (#11208)

* [vtk-m] new port vtk-m

* [VTK] Update to 9.0

* include local buildtree changes

* [pcl] disable VTK due to API changes in VTK 9.0

* [vtk-m] add supports field to be only x64

* [vtk-dicom] add python executable.

* fix vtkm dependency

* [vtk-dicom] fix missing std:: namespace

* [vtk-m] add uwp to unsupported triplets

* [vtk] add pegtl include patch, reenable IOMotionFX

* remove hdf5 changes for testing

* use different pgetl patch which redirects to the installed config of pegtl

* [pegtl-2] version file needs renaming too

* [vtk] change dependency to pgetl-2 and fix the patch

* [vtk] put in hdf5 fix again and correct manually installed include files

* remove deprecated function to retrigger CI

* [lz4] correctly lowercase the lz4 config

* [vtk] remove unnecessary code

* [pegtl-2] add homepage

* [pegtl] modernize portfiles

* [vtk-dicom] add homepage

* [vtk-dicom] modernize portfile

* [vtk-m] remove empty build depends

* [vtk] try fixing the permission issue

* [vtk] minimal dependency correction

* [itk] update

* fix portfile errors

* WIP commit

* should make ITK green in VCPKG CI but there a still issues with features

* more dependencies and features....

* remove itk from baseline failure so the check can get green

* more dependency updating.

* minor build fixes

* [openjpeg] Fix dll location

* fix other issues

* add rtkcuda

* [openjpeg] remove default features to make arm and uwp platforms happy

* [itk] more dependency fixes

* [openjpeg] fix no tools case

* [itk] fix wip patch

* [itk] split up patches & cleanup & and move rtk tools if build

* [itk] fix patch and remove old and wip patch

* [nifticlib] Add new port required by minc

* [nifticlib] change repo and add features

* [nifticilib] add zlib dependency & cleanup

* [minc] add new port

* [vcpkg/scripts] add swig to find acquire programm

* [itk/minc] update for external minc

* add supports field for nifticlib

* [itk] make python a default feature for testing

* [itk] cleanup python vars a bit
[vcpkg/scripts] correct swig hash

* [vcpkg/scripts] fix swig

* [itk] fix python include path on unix system

* [itk] remove python as a default. A bit of feature cleanup

* [itk] update remote RTK

* [itk|rtk] remove RTK module before configure to allow patching

* [opencl] update opencl wrapper

* [itk] fix opencl static linkage

* [itk] add cufftw fix

* update baseline

* [itk] fix itk[tbb]

* [itk] update python paths to 3.8

* [itk] add failure messages for unsupported architectures for some features

* [vcpkg_find_acquire_program] update swig to 4.0.2

* Update portfile.cmake

* [itk] move the module removal out of the if for people reusing the old source tree

* [itk] add missing auto_clean to vcpkg_copy_tools

* Update ports/nifticlib/CONTROL

Co-authored-by: Robert Schumacher <roschuma@microsoft.com>

* Update ports/openjpeg/portfile.cmake

Co-authored-by: Robert Schumacher <roschuma@microsoft.com>

* Update scripts/cmake/vcpkg_find_acquire_program.cmake

Co-authored-by: Robert Schumacher <roschuma@microsoft.com>

* [openjpeg] pass OPTIONS to vcpkg_configure_cmake

* [itk] fix typo and leave a todo.

* use sourceforge args for swig

* Update ports/openjpeg/CONTROL

Co-authored-by: Jack·Boos·Yu <47264268+JackBoosY@users.noreply.github.com>

* Update ports/opencl/CONTROL

Co-authored-by: Jack·Boos·Yu <47264268+JackBoosY@users.noreply.github.com>

* [itk] remove debug msgs from patch

* pre-install yasm on OSX

Co-authored-by: Lily <47812810+LilyWangL@users.noreply.github.com>
Co-authored-by: Robert Schumacher <roschuma@microsoft.com>
Co-authored-by: Jack·Boos·Yu <47264268+JackBoosY@users.noreply.github.com>
Co-authored-by: JackBoosY <yuzaiyang@beyondsoft.com>
This commit is contained in:
Alexander Neumann 2020-08-03 00:49:20 +02:00 committed by GitHub
parent 1c2af99415
commit 8e76503a76
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
29 changed files with 1954 additions and 69 deletions

View File

@ -1,9 +1,37 @@
Source: itk Source: itk
Version: 5.0.1-2 Version: 5.1.0
Description: Insight Segmentation and Registration Toolkit (ITK) is used for image processing and analysis. Description: Insight Segmentation and Registration Toolkit (ITK) is used for image processing and analysis.
Homepage: https://github.com/InsightSoftwareConsortium/ITK Homepage: https://github.com/InsightSoftwareConsortium/ITK
Build-Depends: double-conversion, libjpeg-turbo, zlib, libpng, tiff, expat, eigen3, hdf5[cpp], openjpeg Build-Depends: double-conversion, libjpeg-turbo, zlib, libpng, tiff, expat, eigen3, hdf5[core,cpp], openjpeg[core], fftw3[core], gtest, gdcm, icu, minc
Feature: vtk Feature: vtk
Description: Build ITKVtkGlue module. Description: Build ITKVtkGlue module.
Build-Depends: vtk Build-Depends: vtk[core]
Feature: python
Description: Python functionality for ITK
Build-Depends: python3
Feature: opencl
Description: Use OpenCL
Build-Depends: opencl
Feature: cufftw
Description: Use CUDA FFTW
Build-Depends: cuda
Feature: cuda
Description: Build CUDA module
Build-Depends: cuda, itk[core, opencl]
Feature: tbb
Description: Build TBB Module
Build-Depends: tbb
Feature: rtk
Description: Build RTK Module
Feature: tools
Description: Build RTK with tools
Build-Depends: itk[core, rtk]

58
ports/itk/cufftw.patch Normal file
View File

@ -0,0 +1,58 @@
From 0f47aae05217884193a39690c2beef566f4ed3b1 Mon Sep 17 00:00:00 2001
From: Stephen Aylward <stephen.aylward@kitware.com>
Date: Sat, 25 Apr 2020 20:15:21 -0400
Subject: [PATCH] BUG: CUFFTW paths were not being set and unnecessary FFTW
files used
FindFFTW sets the FFTW_INCLUDES variable. The FFTW_INCLUDE_PATH var is
specific to FFTW (not used by CUFFTW).
FFTWGlobalConfiguration file is only needed if FFTW is being used,
not if CUFFT is being used.
---
CMake/FindFFTW.cmake | 2 +-
Modules/Filtering/FFT/CMakeLists.txt | 2 +-
Modules/Filtering/FFT/src/CMakeLists.txt | 9 +++++----
3 files changed, 7 insertions(+), 6 deletions(-)
diff --git a/CMake/FindFFTW.cmake b/CMake/FindFFTW.cmake
index 785edc2b628..e1935899cab 100644
--- a/CMake/FindFFTW.cmake
+++ b/CMake/FindFFTW.cmake
@@ -62,7 +62,7 @@ if(ITK_USE_FFTWD OR ITK_USE_FFTWF)
find_path(FFTW_INCLUDE_PATH fftw3.h ${FFTW_INC_SEARCHPATH})
endif()
- if(FFTW_INCLUDE_PATH)
+ if(FFTW_INCLUDE_PATH OR CUFFTW_INCLUDE_PATH)
if(ITK_USE_CUFFTW)
file(TO_CMAKE_PATH "${CUFFTW_INCLUDE_PATH}" CUFFTW_INCLUDE_PATH)
set(FFTW_INCLUDE ${CUFFTW_INCLUDE_PATH})
diff --git a/Modules/Filtering/FFT/CMakeLists.txt b/Modules/Filtering/FFT/CMakeLists.txt
index 7d9d1900b56..713530149cb 100644
--- a/Modules/Filtering/FFT/CMakeLists.txt
+++ b/Modules/Filtering/FFT/CMakeLists.txt
@@ -5,5 +5,5 @@ if(ITK_USE_CUFFTW)
else()
set(ITKFFT_LIBRARIES ITKFFT)
endif()
-set(ITKFFT_INCLUDE_DIRS ${FFTW_INCLUDE_PATH})
+set(ITKFFT_INCLUDE_DIRS ${FFTW_INCLUDE})
itk_module_impl()
diff --git a/Modules/Filtering/FFT/src/CMakeLists.txt b/Modules/Filtering/FFT/src/CMakeLists.txt
index 3f3137b8cd4..bde3ee906f8 100644
--- a/Modules/Filtering/FFT/src/CMakeLists.txt
+++ b/Modules/Filtering/FFT/src/CMakeLists.txt
@@ -1,7 +1,8 @@
-set(ITKFFT_SRCS
- itkFFTWGlobalConfiguration.cxx
- itkComplexToComplexFFTImageFilter.cxx
- )
+set(ITKFFT_SRCS itkComplexToComplexFFTImageFilter.cxx)
+
+if( ITK_USE_FFTWF OR ITK_USE_FFTWD AND NOT ITK_USE_CUFFTW)
+ list(APPEND ITKFFT_SRCS itkFFTWGlobalConfiguration.cxx )
+endif()
itk_module_add_library(ITKFFT ${ITKFFT_SRCS})

View File

@ -0,0 +1,16 @@
diff --git a/Modules/ThirdParty/DoubleConversion/CMakeLists.txt b/Modules/ThirdParty/DoubleConversion/CMakeLists.txt
index 16c611fd3..13978724c 100644
--- a/Modules/ThirdParty/DoubleConversion/CMakeLists.txt
+++ b/Modules/ThirdParty/DoubleConversion/CMakeLists.txt
@@ -9,7 +9,10 @@ mark_as_advanced(ITK_USE_SYSTEM_DOUBLECONVERSION)
if(ITK_USE_SYSTEM_DOUBLECONVERSION)
find_package(double-conversion REQUIRED)
get_target_property(ITKDoubleConversion_INCLUDE_DIRS double-conversion::double-conversion INTERFACE_INCLUDE_DIRECTORIES)
- get_target_property(ITKDoubleConversion_LIBRARIES double-conversion::double-conversion LOCATION)
+ get_target_property(ITKDoubleConversion_LIBRARY_RELEASE double-conversion::double-conversion LOCATION_RELEASE)
+ get_target_property(ITKDoubleConversion_LIBRARY_DEBUG double-conversion::double-conversion LOCATION_DEBUG)
+ include(SelectLibraryConfigurations)
+ select_library_configurations(ITKDoubleConversion)
else()
set(ITKDoubleConversion_INCLUDE_DIRS
${ITKDoubleConversion_SOURCE_DIR}/src

View File

@ -1,13 +0,0 @@
diff --git a/Modules/ThirdParty/MINC/src/libminc/CMakeLists.txt b/Modules/ThirdParty/MINC/src/libminc/CMakeLists.txt
index 305b2c63..63f81a53 100644
--- a/Modules/ThirdParty/MINC/src/libminc/CMakeLists.txt
+++ b/Modules/ThirdParty/MINC/src/libminc/CMakeLists.txt
@@ -550,7 +550,7 @@ IF(LIBMINC_INSTALL_LIB_DIR AND NOT LIBMINC_INSTALL_NO_DEVELOPMENT)
${CMAKE_CURRENT_BINARY_DIR}/CMakeFiles/Use${LIBMINC_EXTERNAL_LIB_PREFIX}LIBMINC.cmake
${CMAKE_CURRENT_BINARY_DIR}/CMakeFiles/${LIBMINC_EXTERNAL_LIB_PREFIX}LIBMINCConfig.cmake
DESTINATION
- ${LIBMINC_INSTALL_LIB_DIR}/cmake
+ share/itk
COMPONENT Development)
ENDIF(LIBMINC_INSTALL_LIB_DIR AND NOT LIBMINC_INSTALL_NO_DEVELOPMENT)

View File

@ -1,13 +0,0 @@
diff --git a/Modules/ThirdParty/GDCM/src/gdcm/CMakeLists.txt b/Modules/ThirdParty/GDCM/src/gdcm/CMakeLists.txt
index 6ac16ab6..4638f13c 100644
--- a/Modules/ThirdParty/GDCM/src/gdcm/CMakeLists.txt
+++ b/Modules/ThirdParty/GDCM/src/gdcm/CMakeLists.txt
@@ -373,7 +373,7 @@ else()
endif()
if(GDCM_USE_SYSTEM_OPENJPEG)
- find_package(OpenJPEG 2.0.0 REQUIRED)
+ find_package(OpenJPEG REQUIRED)
set(GDCM_OPENJPEG_LIBRARIES ${OPENJPEG_LIBRARIES})
else()
set(GDCM_OPENJPEG_LIBRARIES gdcmopenjp2)

20
ports/itk/hdf5.patch Normal file
View File

@ -0,0 +1,20 @@
diff --git a/Modules/ThirdParty/HDF5/CMakeLists.txt b/Modules/ThirdParty/HDF5/CMakeLists.txt
index a700ecdfb..0a683a52b 100644
--- a/Modules/ThirdParty/HDF5/CMakeLists.txt
+++ b/Modules/ThirdParty/HDF5/CMakeLists.txt
@@ -25,11 +25,11 @@ endif()
")
endif()
- set(ITKHDF5_LIBRARIES )
- if(BUILD_SHARED_LIBS)
- list(APPEND ITKHDF5_LIBRARIES ${HDF5_C_SHARED_LIBRARY} ${HDF5_CXX_SHARED_LIBRARY})
+ set(ITKHDF5_LIBRARIES)
+ if(HDF5_BUILD_SHARED_LIBS)
+ list(APPEND ITKHDF5_LIBRARIES hdf5::hdf5_cpp-shared hdf5::hdf5-shared)
else()
- list(APPEND ITKHDF5_LIBRARIES ${HDF5_C_STATIC_LIBRARY} ${HDF5_CXX_STATIC_LIBRARY})
+ list(APPEND ITKHDF5_LIBRARIES hdf5::hdf5_cpp-static hdf5::hdf5-static)
endif()
set(ITKHDF5_INCLUDE_DIRS

176
ports/itk/opencl.patch Normal file
View File

@ -0,0 +1,176 @@
diff --git a/Modules/Core/GPUCommon/CMakeLists.txt b/Modules/Core/GPUCommon/CMakeLists.txt
index da2d66b63..6fb476680 100644
--- a/Modules/Core/GPUCommon/CMakeLists.txt
+++ b/Modules/Core/GPUCommon/CMakeLists.txt
@@ -24,9 +24,13 @@ if(ITK_USE_GPU AND APPLE AND NOT ITK_COMPILER_HAS_BLOCKS)
endif()
if(ITK_USE_GPU)
+ message(STATUS "OPENCL_LIBRARIES:${OPENCL_LIBRARIES}")
+ if(TARGET OpenCL::OpenCL)
+ message(STATUS "OPENCL_LIBRARIES:${OpenCL_LIBRARIES}")
+ endif()
set(ITKGPUCommon_LIBRARIES ITKGPUCommon)
- set(ITKGPUCommon_SYSTEM_INCLUDE_DIRS ${OPENCL_INCLUDE_DIRS})
- set(ITKGPUCommon_SYSTEM_LIBRARY_DIRS ${OPENCL_LIBRARIES})
+ set(ITKGPUCommon_SYSTEM_INCLUDE_DIRS ${OpenCL_INCLUDE_DIRS})
+ set(ITKGPUCommon_SYSTEM_LIBRARY_DIRS ${OpenCL_LIBRARIES})
endif()
if(NOT ITK_SOURCE_DIR)
diff --git a/Modules/Core/GPUCommon/src/CMakeLists.txt b/Modules/Core/GPUCommon/src/CMakeLists.txt
index 0b39f2a9a..160f7a752 100644
--- a/Modules/Core/GPUCommon/src/CMakeLists.txt
+++ b/Modules/Core/GPUCommon/src/CMakeLists.txt
@@ -14,5 +14,5 @@ if (ITK_USE_GPU)
write_gpu_kernels("${ITKGPUCommon_Kernels}" ITKGPUCommon_SRCS)
itk_module_add_library(ITKGPUCommon ${ITKGPUCommon_SRCS})
- target_link_libraries(ITKGPUCommon LINK_PUBLIC ${OPENCL_LIBRARIES})
+ target_link_libraries(ITKGPUCommon LINK_PUBLIC ${OpenCL_LIBRARIES})
endif()
diff --git a/Modules/Core/GPUFiniteDifference/CMakeLists.txt b/Modules/Core/GPUFiniteDifference/CMakeLists.txt
index c1bfde450..a642d9230 100644
--- a/Modules/Core/GPUFiniteDifference/CMakeLists.txt
+++ b/Modules/Core/GPUFiniteDifference/CMakeLists.txt
@@ -9,8 +9,8 @@ if(NOT ITK_SOURCE_DIR)
endif()
if (ITK_USE_GPU)
- set(ITKGPUFiniteDifference_SYSTEM_INCLUDE_DIRS ${OPENCL_INCLUDE_DIRS})
- set(ITKGPUFiniteDifference_SYSTEM_LIBRARY_DIRS ${OPENCL_LIBRARIES})
+ set(ITKGPUFiniteDifference_SYSTEM_INCLUDE_DIRS ${OpenCL_INCLUDE_DIRS})
+ set(ITKGPUFiniteDifference_SYSTEM_LIBRARY_DIRS ${OpenCL_LIBRARIES})
set(ITKGPUFiniteDifference_LIBRARIES ITKGPUFiniteDifference)
endif()
diff --git a/Modules/Core/GPUFiniteDifference/src/CMakeLists.txt b/Modules/Core/GPUFiniteDifference/src/CMakeLists.txt
index 8425cc025..8335c69a0 100644
--- a/Modules/Core/GPUFiniteDifference/src/CMakeLists.txt
+++ b/Modules/Core/GPUFiniteDifference/src/CMakeLists.txt
@@ -9,5 +9,5 @@ if (ITK_USE_GPU)
write_gpu_kernels("${ITKGPUFiniteDifference_Kernels}" ITKGPUFiniteDifference_SRCS)
itk_module_add_library(ITKGPUFiniteDifference ${ITKGPUFiniteDifference_SRCS})
- target_link_libraries(ITKGPUFiniteDifference LINK_PUBLIC ${OPENCL_LIBRARIES})
+ target_link_libraries(ITKGPUFiniteDifference LINK_PUBLIC ${OpenCL_LIBRARIES})
endif()
diff --git a/Modules/Filtering/GPUAnisotropicSmoothing/CMakeLists.txt b/Modules/Filtering/GPUAnisotropicSmoothing/CMakeLists.txt
index f36fd887d..310d983fa 100644
--- a/Modules/Filtering/GPUAnisotropicSmoothing/CMakeLists.txt
+++ b/Modules/Filtering/GPUAnisotropicSmoothing/CMakeLists.txt
@@ -10,8 +10,8 @@ endif()
if (ITK_USE_GPU)
set(ITKGPUAnisotropicSmoothing_LIBRARIES ITKGPUAnisotropicSmoothing)
- set(ITKGPUAnisotropicSmoothing_SYSTEM_INCLUDE_DIRS ${OPENCL_INCLUDE_DIRS})
- set(ITKGPUAnisotropicSmoothing_SYSTEM_LIBRARY_DIRS ${OPENCL_LIBRARIES})
+ set(ITKGPUAnisotropicSmoothing_SYSTEM_INCLUDE_DIRS ${OpenCL_INCLUDE_DIRS})
+ set(ITKGPUAnisotropicSmoothing_SYSTEM_LIBRARY_DIRS ${OpenCL_LIBRARIES})
endif()
if(NOT ITK_SOURCE_DIR)
diff --git a/Modules/Filtering/GPUImageFilterBase/CMakeLists.txt b/Modules/Filtering/GPUImageFilterBase/CMakeLists.txt
index 078905521..67fd7b832 100644
--- a/Modules/Filtering/GPUImageFilterBase/CMakeLists.txt
+++ b/Modules/Filtering/GPUImageFilterBase/CMakeLists.txt
@@ -10,8 +10,8 @@ endif()
if (ITK_USE_GPU)
set(ITKGPUImageFilterBase_LIBRARIES ITKGPUImageFilterBase)
- set(ITKGPUImageFilterBase_SYSTEM_INCLUDE_DIRS ${OPENCL_INCLUDE_DIRS})
- set(ITKGPUImageFilterBase_SYSTEM_LIBRARY_DIRS ${OPENCL_LIBRARIES})
+ set(ITKGPUImageFilterBase_SYSTEM_INCLUDE_DIRS ${OpenCL_INCLUDE_DIRS})
+ set(ITKGPUImageFilterBase_SYSTEM_LIBRARY_DIRS ${OpenCL_LIBRARIES})
endif()
if(NOT ITK_SOURCE_DIR)
diff --git a/Modules/Filtering/GPUImageFilterBase/src/CMakeLists.txt b/Modules/Filtering/GPUImageFilterBase/src/CMakeLists.txt
index 251493f5e..6d33fa964 100644
--- a/Modules/Filtering/GPUImageFilterBase/src/CMakeLists.txt
+++ b/Modules/Filtering/GPUImageFilterBase/src/CMakeLists.txt
@@ -10,5 +10,5 @@ if (ITK_USE_GPU)
write_gpu_kernels("${ITKGPUImageFilterBase_Kernels}" ITKGPUImageFilterBase_SRCS)
itk_module_add_library(ITKGPUImageFilterBase ${ITKGPUImageFilterBase_SRCS})
- target_link_libraries(ITKGPUImageFilterBase LINK_PUBLIC ${OPENCL_LIBRARIES})
+ target_link_libraries(ITKGPUImageFilterBase LINK_PUBLIC ${OpenCL_LIBRARIES})
endif()
diff --git a/Modules/Filtering/GPUSmoothing/CMakeLists.txt b/Modules/Filtering/GPUSmoothing/CMakeLists.txt
index 9bac40921..2ed493d40 100644
--- a/Modules/Filtering/GPUSmoothing/CMakeLists.txt
+++ b/Modules/Filtering/GPUSmoothing/CMakeLists.txt
@@ -10,8 +10,8 @@ endif()
if (ITK_USE_GPU)
set(ITKGPUSmoothing_LIBRARIES ITKGPUSmoothing)
- set(ITKGPUSmoothing_SYSTEM_INCLUDE_DIRS ${OPENCL_INCLUDE_DIRS})
- set(ITKGPUSmoothing_SYSTEM_LIBRARY_DIRS ${OPENCL_LIBRARIES})
+ set(ITKGPUSmoothing_SYSTEM_INCLUDE_DIRS ${OpenCL_INCLUDE_DIRS})
+ set(ITKGPUSmoothing_SYSTEM_LIBRARY_DIRS ${OpenCL_LIBRARIES})
endif()
if(NOT ITK_SOURCE_DIR)
diff --git a/Modules/Filtering/GPUSmoothing/src/CMakeLists.txt b/Modules/Filtering/GPUSmoothing/src/CMakeLists.txt
index d2120e842..2c6ca4a4a 100644
--- a/Modules/Filtering/GPUSmoothing/src/CMakeLists.txt
+++ b/Modules/Filtering/GPUSmoothing/src/CMakeLists.txt
@@ -9,5 +9,5 @@ if (ITK_USE_GPU)
write_gpu_kernels("${ITKGPUSmoothing_Kernels}" ITKGPUSmoothing_SRCS)
itk_module_add_library(ITKGPUSmoothing ${ITKGPUSmoothing_SRCS})
- target_link_libraries(ITKGPUSmoothing LINK_PUBLIC ${OPENCL_LIBRARIES})
+ target_link_libraries(ITKGPUSmoothing LINK_PUBLIC ${OpenCL_LIBRARIES})
endif()
diff --git a/Modules/Filtering/GPUThresholding/CMakeLists.txt b/Modules/Filtering/GPUThresholding/CMakeLists.txt
index 4390785f5..61786b7a8 100644
--- a/Modules/Filtering/GPUThresholding/CMakeLists.txt
+++ b/Modules/Filtering/GPUThresholding/CMakeLists.txt
@@ -2,8 +2,8 @@ project(ITKGPUThresholding)
if (ITK_USE_GPU)
set(ITKGPUThresholding_LIBRARIES ITKGPUThresholding)
- set(ITKGPUThresholding_SYSTEM_INCLUDE_DIRS ${OPENCL_INCLUDE_DIRS})
- set(ITKGPUThresholding_SYSTEM_LIBRARY_DIRS ${OPENCL_LIBRARIES})
+ set(ITKGPUThresholding_SYSTEM_INCLUDE_DIRS ${OpenCL_INCLUDE_DIRS})
+ set(ITKGPUThresholding_SYSTEM_LIBRARY_DIRS ${OpenCL_LIBRARIES})
endif()
itk_module_impl()
diff --git a/Modules/Filtering/GPUThresholding/src/CMakeLists.txt b/Modules/Filtering/GPUThresholding/src/CMakeLists.txt
index 326c86859..c07c80414 100644
--- a/Modules/Filtering/GPUThresholding/src/CMakeLists.txt
+++ b/Modules/Filtering/GPUThresholding/src/CMakeLists.txt
@@ -9,5 +9,5 @@ if (ITK_USE_GPU)
write_gpu_kernels("${ITKGPUThresholding_Kernels}" ITKGPUThresholding_SRCS)
itk_module_add_library(ITKGPUThresholding ${ITKGPUThresholding_SRCS})
- target_link_libraries(ITKGPUThresholding LINK_PUBLIC ${OPENCL_LIBRARIES})
+ target_link_libraries(ITKGPUThresholding LINK_PUBLIC ${OpenCL_LIBRARIES})
endif()
diff --git a/Modules/Registration/GPUPDEDeformable/CMakeLists.txt b/Modules/Registration/GPUPDEDeformable/CMakeLists.txt
index c8d70a423..097c974c5 100644
--- a/Modules/Registration/GPUPDEDeformable/CMakeLists.txt
+++ b/Modules/Registration/GPUPDEDeformable/CMakeLists.txt
@@ -2,8 +2,8 @@ project(ITKGPUPDEDeformableRegistration)
if (ITK_USE_GPU)
set(ITKGPUPDEDeformableRegistration_LIBRARIES ITKGPUPDEDeformableRegistration)
- set(ITKGPUPDEDeformableRegistration_SYSTEM_INCLUDE_DIRS ${OPENCL_INCLUDE_DIRS})
- set(ITKGPUPDEDeformableRegistration_SYSTEM_LIBRARY_DIRS ${OPENCL_LIBRARIES})
+ set(ITKGPUPDEDeformableRegistration_SYSTEM_INCLUDE_DIRS ${OpenCL_INCLUDE_DIRS})
+ set(ITKGPUPDEDeformableRegistration_SYSTEM_LIBRARY_DIRS ${OpenCL_LIBRARIES})
endif()
itk_module_impl()
diff --git a/Modules/Registration/GPUPDEDeformable/src/CMakeLists.txt b/Modules/Registration/GPUPDEDeformable/src/CMakeLists.txt
index 28b1d194c..1a049bdde 100644
--- a/Modules/Registration/GPUPDEDeformable/src/CMakeLists.txt
+++ b/Modules/Registration/GPUPDEDeformable/src/CMakeLists.txt
@@ -10,5 +10,5 @@ if (ITK_USE_GPU)
write_gpu_kernels("${ITKGPUPDEDeformableRegistration_Kernels}" ITKGPUPDEDeformableRegistration_SRCS)
itk_module_add_library(ITKGPUPDEDeformableRegistration ${ITKGPUPDEDeformableRegistration_SRCS})
- target_link_libraries(ITKGPUPDEDeformableRegistration LINK_PUBLIC ${OPENCL_LIBRARIES})
+ target_link_libraries(ITKGPUPDEDeformableRegistration LINK_PUBLIC ${OpenCL_LIBRARIES})
endif()

548
ports/itk/openjpeg.patch Normal file
View File

@ -0,0 +1,548 @@
diff --git a/Modules/IO/JPEG2000/src/itkJPEG2000ImageIO.cxx b/Modules/IO/JPEG2000/src/itkJPEG2000ImageIO.cxx
index 1b1fe9526..0da4aa0c4 100644
--- a/Modules/IO/JPEG2000/src/itkJPEG2000ImageIO.cxx
+++ b/Modules/IO/JPEG2000/src/itkJPEG2000ImageIO.cxx
@@ -26,9 +26,9 @@
extern "C"
{
-#include "openjpeg.h"
-#include "j2k.h"
-#include "jp2.h"
+#include <openjpeg.h>
+//#include "j2k.h"
+//##include "jp2.h"
}
@@ -62,8 +62,7 @@ public:
OPJ_UINT32 m_TileStartX;
OPJ_UINT32 m_TileStartY;
- OPJ_UINT32 m_NumberOfTilesInX;
- OPJ_UINT32 m_NumberOfTilesInY;
+ OPJ_UINT32 m_NumberOfTiles;
opj_dparameters_t m_DecompressionParameters; /* decompression parameters */
};
@@ -86,8 +85,7 @@ JPEG2000ImageIO::JPEG2000ImageIO()
this->m_Internal->m_TileStartX = 0;
this->m_Internal->m_TileStartY = 0;
- this->m_Internal->m_NumberOfTilesInX = 0;
- this->m_Internal->m_NumberOfTilesInY = 0;
+ this->m_Internal->m_NumberOfTiles = 0;
const char * extensions[] = { ".j2k", ".jp2", ".jpt" };
@@ -139,22 +137,16 @@ JPEG2000ImageIO::ReadImageInformation()
{
itkDebugMacro(<< "ReadImageInformation()");
- FILE * l_file = fopen(this->m_FileName.c_str(), "rb");
-
- /* decompression parameters */
+ /* set decoding parameters to default values */
+ opj_set_default_decoder_parameters(&(this->m_Internal->m_DecompressionParameters));
- if (!l_file)
+ opj_stream_t * cio = opj_stream_create_default_file_stream(this->m_FileName.c_str(), true);
+ if (!cio)
{
itkExceptionMacro("JPEG2000ImageIO failed to open file for reading: " << this->GetFileName() << std::endl
<< "Reason: "
<< itksys::SystemTools::GetLastSystemError());
}
-
- /* set decoding parameters to default values */
- opj_set_default_decoder_parameters(&(this->m_Internal->m_DecompressionParameters));
-
- opj_stream_t * cio = opj_stream_create_default_file_stream(l_file, true);
-
this->m_Internal->m_Dinfo = nullptr; /* handle to a decompressor */
opj_image_t * l_image = nullptr;
@@ -187,14 +179,14 @@ JPEG2000ImageIO::ReadImageInformation()
/* JPEG-2000 codestream */
/* get a decoder handle */
- this->m_Internal->m_Dinfo = opj_create_decompress(CODEC_J2K);
+ this->m_Internal->m_Dinfo = opj_create_decompress(OPJ_CODEC_J2K);
if (!this->m_Internal->m_Dinfo)
{
opj_stream_destroy(cio);
- fclose(l_file);
+ // fclose(l_file);
itkExceptionMacro("JPEG2000ImageIO failed to read file: "
<< this->GetFileName() << std::endl
- << "Reason: opj_create_decompress(CODEC_J2K) returns nullptr");
+ << "Reason: opj_create_decompress(OPJ_CODEC_J2K) returns nullptr");
}
break;
}
@@ -202,14 +194,14 @@ JPEG2000ImageIO::ReadImageInformation()
{
/* JPEG 2000 compressed image data */
/* get a decoder handle */
- this->m_Internal->m_Dinfo = opj_create_decompress(CODEC_JP2);
+ this->m_Internal->m_Dinfo = opj_create_decompress(OPJ_CODEC_JP2);
if (!this->m_Internal->m_Dinfo)
{
opj_stream_destroy(cio);
- fclose(l_file);
+ // fclose(l_file);
itkExceptionMacro("JPEG2000ImageIO failed to read file: "
<< this->GetFileName() << std::endl
- << "Reason: opj_create_decompress(CODEC_JP2) returns nullptr");
+ << "Reason: opj_create_decompress(OPJ_CODEC_JP2) returns nullptr");
}
break;
}
@@ -217,20 +209,19 @@ JPEG2000ImageIO::ReadImageInformation()
{
/* JPEG 2000, JPIP */
/* get a decoder handle */
- this->m_Internal->m_Dinfo = opj_create_decompress(CODEC_JPT);
+ this->m_Internal->m_Dinfo = opj_create_decompress(OPJ_CODEC_JPT);
if (!this->m_Internal->m_Dinfo)
{
opj_stream_destroy(cio);
- fclose(l_file);
+ // fclose(l_file);
itkExceptionMacro("JPEG2000ImageIO failed to read file: "
<< this->GetFileName() << std::endl
- << "Reason: opj_create_decompress(CODEC_JPT) returns nullptr");
+ << "Reason: opj_create_decompress(OPJ_CODEC_JPT) returns nullptr");
}
break;
}
default:
opj_stream_destroy(cio);
- fclose(l_file);
itkExceptionMacro("JPEG2000ImageIO failed to read file: "
<< this->GetFileName() << std::endl
<< "Reason: "
@@ -247,27 +238,11 @@ JPEG2000ImageIO::ReadImageInformation()
<< "Reason: opj_setup_decoder returns false");
}
- // Image parameters - first tile
- OPJ_INT32 l_tile_x0;
- OPJ_INT32 l_tile_y0;
- // Image parameters - tile width, height and number of tiles
- OPJ_UINT32 l_tile_width;
- OPJ_UINT32 l_tile_height;
- OPJ_UINT32 l_nb_tiles_x;
- OPJ_UINT32 l_nb_tiles_y;
itkDebugMacro(<< "Trying to read header now...");
- bResult = opj_read_header(this->m_Internal->m_Dinfo,
- &l_image,
- &l_tile_x0,
- &l_tile_y0,
- &l_tile_width,
- &l_tile_height,
- &l_nb_tiles_x,
- &l_nb_tiles_y,
- cio);
+ bResult = opj_read_header(cio, this->m_Internal->m_Dinfo, &l_image);
if (!bResult)
{
@@ -283,14 +258,22 @@ JPEG2000ImageIO::ReadImageInformation()
<< "Reason: Error whle reading image header");
}
+ // Image parameters - first tile
+ OPJ_INT32 l_tile_x0=l_image->x0;
+ OPJ_INT32 l_tile_y0=l_image->y0;
+
+ // Image parameters - tile width, height and number of tiles
+ OPJ_UINT32 l_tile_width=l_image->x1;
+ OPJ_UINT32 l_tile_height=l_image->y1;
+ OPJ_UINT32 l_nb_tiles=l_image->numcomps;
+
this->m_Internal->m_TileStartX = l_tile_x0;
this->m_Internal->m_TileStartY = l_tile_y0;
this->m_Internal->m_TileWidth = l_tile_width;
this->m_Internal->m_TileHeight = l_tile_height;
- this->m_Internal->m_NumberOfTilesInX = l_nb_tiles_x;
- this->m_Internal->m_NumberOfTilesInY = l_nb_tiles_y;
+ this->m_Internal->m_NumberOfTiles = l_nb_tiles;
itkDebugMacro(<< "Number of Components = " << l_image->numcomps);
@@ -319,7 +302,7 @@ JPEG2000ImageIO::ReadImageInformation()
this->SetPixelType(IOPixelEnum::SCALAR);
break;
case 3:
- if (l_image->color_space != CLRSPC_SRGB)
+ if (l_image->color_space != OPJ_CLRSPC_SRGB)
{
itkWarningMacro(<< "file does not specify color space, assuming sRGB");
}
@@ -335,8 +318,7 @@ JPEG2000ImageIO::ReadImageInformation()
itkDebugMacro(<< "Tile Start Y = " << this->m_Internal->m_TileStartY);
itkDebugMacro(<< "Tile Width = " << this->m_Internal->m_TileWidth);
itkDebugMacro(<< "Tile Height = " << this->m_Internal->m_TileHeight);
- itkDebugMacro(<< "Number of Tiles X = " << this->m_Internal->m_NumberOfTilesInX);
- itkDebugMacro(<< "Number of Tiles Y = " << this->m_Internal->m_NumberOfTilesInY);
+ itkDebugMacro(<< "Number of Tiles = " << this->m_Internal->m_NumberOfTiles);
itkDebugMacro(<< "image->x1 = " << l_image->x1);
itkDebugMacro(<< "image->y1 = " << l_image->y1);
@@ -349,7 +331,6 @@ JPEG2000ImageIO::ReadImageInformation()
/* close the byte stream */
opj_stream_destroy(cio);
- fclose(l_file);
if (this->m_Internal->m_Dinfo)
{
@@ -368,16 +349,7 @@ JPEG2000ImageIO::Read(void * buffer)
{
itkDebugMacro(<< "JPEG2000ImageIO::Read() Begin");
- FILE * l_file = fopen(this->m_FileName.c_str(), "rb");
-
- if (!l_file)
- {
- itkExceptionMacro("JPEG2000ImageIO failed to open file for reading: " << this->GetFileName() << std::endl
- << "Reason: "
- << itksys::SystemTools::GetLastSystemError());
- }
-
- opj_stream_t * l_stream = opj_stream_create_default_file_stream(l_file, true);
+ opj_stream_t * l_stream = opj_stream_create_default_file_stream(this->m_FileName.c_str(), true);
if (!l_stream)
{
itkExceptionMacro("JPEG2000ImageIO failed to read file: "
@@ -397,12 +369,13 @@ JPEG2000ImageIO::Read(void * buffer)
{
/* JPEG-2000 codestream */
/* get a decoder handle */
- this->m_Internal->m_Dinfo = opj_create_decompress(CODEC_J2K);
+ this->m_Internal->m_Dinfo = opj_create_decompress(OPJ_CODEC_J2K);
if (!this->m_Internal->m_Dinfo)
{
+ opj_stream_destroy(l_stream);
itkExceptionMacro("JPEG2000ImageIO failed to read file: "
<< this->GetFileName() << std::endl
- << "Reason: opj_create_decompress(CODEC_J2K) returns nullptr");
+ << "Reason: opj_create_decompress(OPJ_CODEC_J2K) returns nullptr");
}
break;
}
@@ -410,12 +383,13 @@ JPEG2000ImageIO::Read(void * buffer)
{
/* JPEG 2000 compressed image data */
/* get a decoder handle */
- this->m_Internal->m_Dinfo = opj_create_decompress(CODEC_JP2);
+ this->m_Internal->m_Dinfo = opj_create_decompress(OPJ_CODEC_JP2);
if (!this->m_Internal->m_Dinfo)
{
+ opj_stream_destroy(l_stream);
itkExceptionMacro("JPEG2000ImageIO failed to read file: "
<< this->GetFileName() << std::endl
- << "Reason: opj_create_decompress(CODEC_JP2) returns nullptr");
+ << "Reason: opj_create_decompress(OPJ_CODEC_JP2) returns nullptr");
}
break;
}
@@ -423,17 +397,18 @@ JPEG2000ImageIO::Read(void * buffer)
{
/* JPEG 2000, JPIP */
/* get a decoder handle */
- this->m_Internal->m_Dinfo = opj_create_decompress(CODEC_JPT);
+ this->m_Internal->m_Dinfo = opj_create_decompress(OPJ_CODEC_JPT);
if (!this->m_Internal->m_Dinfo)
{
+ opj_stream_destroy(l_stream);
itkExceptionMacro("JPEG2000ImageIO failed to read file: "
<< this->GetFileName() << std::endl
- << "Reason: opj_create_decompress(CODEC_JPT) returns nullptr");
+ << "Reason: opj_create_decompress(OPJ_CODEC_JPT) returns nullptr");
}
break;
}
default:
- fclose(l_file);
+ opj_stream_destroy(l_stream);
itkExceptionMacro("JPEG2000ImageIO failed to read file: "
<< this->GetFileName() << std::endl
<< "Reason: "
@@ -448,29 +423,13 @@ JPEG2000ImageIO::Read(void * buffer)
<< "Reason: opj_setup_decoder returns false");
}
- OPJ_INT32 l_tile_x0, l_tile_y0;
-
- OPJ_UINT32 l_tile_width;
- OPJ_UINT32 l_tile_height;
- OPJ_UINT32 l_nb_tiles_x;
- OPJ_UINT32 l_nb_tiles_y;
-
- bool bResult = opj_read_header(this->m_Internal->m_Dinfo,
- &l_image,
- &l_tile_x0,
- &l_tile_y0,
- &l_tile_width,
- &l_tile_height,
- &l_nb_tiles_x,
- &l_nb_tiles_y,
- l_stream);
+ bool bResult = opj_read_header(l_stream, this->m_Internal->m_Dinfo,&l_image);
if (!bResult)
{
opj_destroy_codec(this->m_Internal->m_Dinfo);
this->m_Internal->m_Dinfo = nullptr;
opj_stream_destroy(l_stream);
- fclose(l_file);
itkExceptionMacro("JPEG2000ImageIO failed to read file: " << this->GetFileName() << std::endl
<< "Reason: opj_read_header returns false");
}
@@ -499,7 +458,7 @@ JPEG2000ImageIO::Read(void * buffer)
itkDebugMacro(<< "p_end_x = " << p_end_x);
itkDebugMacro(<< "p_end_y = " << p_end_y);
- bResult = opj_set_decode_area(this->m_Internal->m_Dinfo, p_start_x, p_start_y, p_end_x, p_end_y);
+ bResult = opj_set_decode_area(this->m_Internal->m_Dinfo, l_image, p_start_x, p_start_y, p_end_x, p_end_y);
itkDebugMacro(<< "opj_set_decode_area() after");
@@ -508,7 +467,6 @@ JPEG2000ImageIO::Read(void * buffer)
opj_destroy_codec(this->m_Internal->m_Dinfo);
this->m_Internal->m_Dinfo = nullptr;
opj_stream_destroy(l_stream);
- fclose(l_file);
itkExceptionMacro("JPEG2000ImageIO failed to read file: " << this->GetFileName() << std::endl
<< "Reason: opj_set_decode_area returns false");
}
@@ -525,13 +483,13 @@ JPEG2000ImageIO::Read(void * buffer)
OPJ_UINT32 l_max_data_size = 1000;
- bool l_go_on = true;
+ int l_go_on = true; // should be OBJ_BOOL
auto * l_data = (OPJ_BYTE *)malloc(1000);
while (l_go_on)
{
- bool tileHeaderRead = opj_read_tile_header(this->m_Internal->m_Dinfo,
+ bool tileHeaderRead = opj_read_tile_header(this->m_Internal->m_Dinfo, l_stream,
&l_tile_index,
&l_data_size,
&l_current_tile_x0,
@@ -539,14 +497,12 @@ JPEG2000ImageIO::Read(void * buffer)
&l_current_tile_x1,
&l_current_tile_y1,
&l_nb_comps,
- &l_go_on,
- l_stream);
+ &l_go_on);
if (!tileHeaderRead)
{
free(l_data);
opj_stream_destroy(l_stream);
- fclose(l_file);
opj_destroy_codec(this->m_Internal->m_Dinfo);
opj_image_destroy(l_image);
itkExceptionMacro("JPEG2000ImageIO failed to read file: " << this->GetFileName() << std::endl
@@ -571,7 +527,6 @@ JPEG2000ImageIO::Read(void * buffer)
if (!l_data)
{
opj_stream_destroy(l_stream);
- fclose(l_file);
opj_destroy_codec(this->m_Internal->m_Dinfo);
opj_image_destroy(l_image);
itkExceptionMacro("JPEG2000ImageIO failed to read file: " << this->GetFileName() << std::endl
@@ -590,7 +545,6 @@ JPEG2000ImageIO::Read(void * buffer)
{
free(l_data);
opj_stream_destroy(l_stream);
- fclose(l_file);
opj_destroy_codec(this->m_Internal->m_Dinfo);
opj_image_destroy(l_image);
itkExceptionMacro("JPEG2000ImageIO failed to read file: " << this->GetFileName() << std::endl
@@ -654,7 +608,6 @@ JPEG2000ImageIO::Read(void * buffer)
{
free(l_data);
opj_stream_destroy(l_stream);
- fclose(l_file);
opj_destroy_codec(this->m_Internal->m_Dinfo);
opj_image_destroy(l_image);
itkExceptionMacro("JPEG2000ImageIO failed to read file: " << this->GetFileName() << std::endl
@@ -666,14 +619,12 @@ JPEG2000ImageIO::Read(void * buffer)
opj_destroy_codec(this->m_Internal->m_Dinfo);
this->m_Internal->m_Dinfo = nullptr;
opj_stream_destroy(l_stream);
- fclose(l_file);
itkExceptionMacro("JPEG2000ImageIO failed to read file: " << this->GetFileName() << std::endl
<< "Reason: error whle reading image");
}
/* close the byte stream */
opj_stream_destroy(l_stream);
- fclose(l_file);
if (this->m_Internal->m_Dinfo)
{
@@ -840,13 +791,13 @@ JPEG2000ImageIO ::Write(const void * buffer)
parameters.numresolution = numberOfResolutions;
- OPJ_COLOR_SPACE color_space = CLRSPC_GRAY;
+ OPJ_COLOR_SPACE color_space = OPJ_CLRSPC_GRAY;
opj_image_cmptparm_t cmptparms[3];
if (this->GetNumberOfComponents() == 3)
{
- color_space = (this->GetPixelType() == IOPixelEnum::RGB) ? CLRSPC_SRGB : CLRSPC_UNSPECIFIED;
+ color_space = (this->GetPixelType() == IOPixelEnum::RGB) ? OPJ_CLRSPC_SRGB : OPJ_CLRSPC_UNSPECIFIED;
/* initialize image components */
memset(&cmptparms[0], 0, 3 * sizeof(opj_image_cmptparm_t));
@@ -864,7 +815,7 @@ JPEG2000ImageIO ::Write(const void * buffer)
if (this->GetNumberOfComponents() == 1)
{
- color_space = CLRSPC_GRAY;
+ color_space = OPJ_CLRSPC_GRAY;
/* initialize image components */
memset(&cmptparms[0], 0, sizeof(opj_image_cmptparm_t));
@@ -940,32 +891,32 @@ JPEG2000ImageIO ::Write(const void * buffer)
opj_codec_t * cinfo = nullptr;
if (extension == ".j2k")
{
- cinfo = opj_create_compress(CODEC_J2K);
+ cinfo = opj_create_compress(OPJ_CODEC_J2K);
if (!cinfo)
{
itkExceptionMacro("JPEG2000ImageIO failed to write file: "
<< this->GetFileName() << std::endl
- << "Reason: opj_create_compress(CODEC_J2K) returns nullptr");
+ << "Reason: opj_create_compress(OPJ_CODEC_J2K) returns nullptr");
}
}
else if (extension == ".jp2")
{
- cinfo = opj_create_compress(CODEC_JP2);
+ cinfo = opj_create_compress(OPJ_CODEC_JP2);
if (!cinfo)
{
itkExceptionMacro("JPEG2000ImageIO failed to write file: "
<< this->GetFileName() << std::endl
- << "Reason: opj_create_compress(CODEC_JP2) returns nullptr");
+ << "Reason: opj_create_compress(OPJ_CODEC_JP2) returns nullptr");
}
}
else if (extension == ".jpt")
{
- cinfo = opj_create_compress(CODEC_JPT);
+ cinfo = opj_create_compress(OPJ_CODEC_JPT);
if (!cinfo)
{
itkExceptionMacro("JPEG2000ImageIO failed to write file: "
<< this->GetFileName() << std::endl
- << "Reason: opj_create_compress(CODEC_JPT) returns nullptr");
+ << "Reason: opj_create_compress(OPJ_CODEC_JPT) returns nullptr");
}
}
else
@@ -989,17 +940,9 @@ JPEG2000ImageIO ::Write(const void * buffer)
<< "Reason: opj_setup_encoder returns false");
}
- FILE * l_file = fopen(parameters.outfile, "wb");
- if (!l_file)
- {
- itkExceptionMacro("JPEG2000ImageIO failed to open file for writing: " << this->GetFileName() << std::endl
- << "Reason: "
- << itksys::SystemTools::GetLastSystemError());
- }
-
/* open a byte stream for writing */
/* allocate memory for all tiles */
- opj_stream_t * cio = opj_stream_create_default_file_stream(l_file, false);
+ opj_stream_t * cio = opj_stream_create_default_file_stream(parameters.outfile, false);
if (!cio)
{
itkExceptionMacro("JPEG2000ImageIO failed to write file: "
@@ -1017,8 +960,7 @@ JPEG2000ImageIO ::Write(const void * buffer)
if (!bSuccess)
{
opj_stream_destroy(cio);
- fclose(l_file);
- itkExceptionMacro("JPEG2000ImageIO failed to write file: " << this->GetFileName() << std::endl
+ itkExceptionMacro("JPEG2000ImageIO failed to write file: " << this->GetFileName() << std::endl
<< "Reason: opj_start_compress returns false");
}
@@ -1026,7 +968,6 @@ JPEG2000ImageIO ::Write(const void * buffer)
if (!bSuccess)
{
opj_stream_destroy(cio);
- fclose(l_file);
itkExceptionMacro("JPEG2000ImageIO failed to write file: " << this->GetFileName() << std::endl
<< "Reason: opj_encode returns false");
}
@@ -1035,14 +976,12 @@ JPEG2000ImageIO ::Write(const void * buffer)
if (!bSuccess)
{
opj_stream_destroy(cio);
- fclose(l_file);
itkExceptionMacro("JPEG2000ImageIO failed to write file: " << this->GetFileName() << std::endl
<< "Reason: opj_end_compress returns false");
}
/* close and free the byte stream */
opj_stream_destroy(cio);
- fclose(l_file);
/* free remaining compression structures */
opj_destroy_codec(cinfo);
diff --git a/Modules/ThirdParty/OpenJPEG/CMakeLists.txt b/Modules/ThirdParty/OpenJPEG/CMakeLists.txt
index 103eaa9dd..eb8989135 100644
--- a/Modules/ThirdParty/OpenJPEG/CMakeLists.txt
+++ b/Modules/ThirdParty/OpenJPEG/CMakeLists.txt
@@ -1,12 +1,25 @@
project(ITKOpenJPEG)
set(ITKOpenJPEG_THIRD_PARTY 1)
-set(ITKOpenJPEG_INCLUDE_DIRS
- ${ITKOpenJPEG_BINARY_DIR}/src/openjpeg
- ${ITKOpenJPEG_SOURCE_DIR}/src/openjpeg
- )
-set(ITKOpenJPEG_LIBRARIES itkopenjpeg)
-set(ITK_LIBRARY_PROPERTIES WINDOWS_EXPORT_ALL_SYMBOLS FALSE)
+if(ITK_USE_SYSTEM_OpenJPEG)
+ find_package(OpenJPEG REQUIRED)
+ if(TARGET openjp2)
+ set(ITKOpenJPEG_LIBRARIES ${OPENJPEG_LIBRARIES})
+ else()
+ message(FATAL_ERROR "OpenJPEG target openjp2 missing!")
+ endif()
+ set(ITKOpenJPEG_INCLUDE_DIRS
+ ${ITKOpenJPEG_BINARY_DIR}/src/openjpeg
+ ${ITKOpenJPEG_SOURCE_DIR}/src/openjpeg
+ )
+else()
+ set(ITKOpenJPEG_INCLUDE_DIRS
+ ${ITKOpenJPEG_BINARY_DIR}/src/openjpeg
+ ${ITKOpenJPEG_SOURCE_DIR}/src/openjpeg
+ )
+ set(ITKOpenJPEG_LIBRARIES itkopenjpeg)
+ set(ITK_LIBRARY_PROPERTIES WINDOWS_EXPORT_ALL_SYMBOLS FALSE)
+endif()
itk_module_impl()

58
ports/itk/openjpeg2.patch Normal file
View File

@ -0,0 +1,58 @@
diff --git a/Modules/ThirdParty/GDCM/src/gdcm/Utilities/gdcmopenjpeg/CMakeLists.txt b/Modules/ThirdParty/GDCM/src/gdcm/Utilities/gdcmopenjpeg/CMakeLists.txt
index 565cc338b..c061f0721 100644
--- a/Modules/ThirdParty/GDCM/src/gdcm/Utilities/gdcmopenjpeg/CMakeLists.txt
+++ b/Modules/ThirdParty/GDCM/src/gdcm/Utilities/gdcmopenjpeg/CMakeLists.txt
@@ -194,7 +194,7 @@ mark_as_advanced(LIBRARY_OUTPUT_PATH EXECUTABLE_OUTPUT_PATH)
# configure name mangling to allow multiple libraries to coexist
# peacefully
if(EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/openjpeg_mangle.h.in)
-set(MANGLE_PREFIX ${OPENJPEG_LIBRARY_NAME})
+set(MANGLE_PREFIX)
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/openjpeg_mangle.h.in
${CMAKE_CURRENT_BINARY_DIR}/openjpeg_mangle.h
@ONLY)
diff --git a/Modules/ThirdParty/GDCM/src/gdcm/Utilities/gdcmopenjpeg/src/lib/openjp2/CMakeLists.txt b/Modules/ThirdParty/GDCM/src/gdcm/Utilities/gdcmopenjpeg/src/lib/openjp2/CMakeLists.txt
index c4adb91a2..89b731d88 100644
--- a/Modules/ThirdParty/GDCM/src/gdcm/Utilities/gdcmopenjpeg/src/lib/openjp2/CMakeLists.txt
+++ b/Modules/ThirdParty/GDCM/src/gdcm/Utilities/gdcmopenjpeg/src/lib/openjp2/CMakeLists.txt
@@ -3,7 +3,7 @@ include_regular_expression("^.*$")
# configure name mangling to allow multiple libraries to coexist
# peacefully
if(EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/openjpeg_mangle.h.in)
-set(MANGLE_PREFIX ${OPENJPEG_LIBRARY_NAME})
+set(MANGLE_PREFIX)
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/openjpeg_mangle.h.in
${CMAKE_CURRENT_BINARY_DIR}/openjpeg_mangle.h
@ONLY)
diff --git a/Modules/ThirdParty/OpenJPEG/CMakeLists.txt b/Modules/ThirdParty/OpenJPEG/CMakeLists.txt
index 3811e52f4..a41e9264e 100644
--- a/Modules/ThirdParty/OpenJPEG/CMakeLists.txt
+++ b/Modules/ThirdParty/OpenJPEG/CMakeLists.txt
@@ -8,10 +8,10 @@ if(ITK_USE_SYSTEM_OpenJPEG)
else()
message(FATAL_ERROR "OpenJPEG target openjp2 missing!")
endif()
- set(ITKOpenJPEG_INCLUDE_DIRS
- ${ITKOpenJPEG_BINARY_DIR}/src/openjpeg
- ${ITKOpenJPEG_SOURCE_DIR}/src/openjpeg
- )
+ # set(ITKOpenJPEG_INCLUDE_DIRS
+ # ${ITKOpenJPEG_BINARY_DIR}/src/openjpeg
+ # ${ITKOpenJPEG_SOURCE_DIR}/src/openjpeg
+ # )
else()
set(ITKOpenJPEG_INCLUDE_DIRS
${ITKOpenJPEG_BINARY_DIR}/src/openjpeg
diff --git a/Modules/ThirdParty/OpenJPEG/src/openjpeg/CMakeLists.txt b/Modules/ThirdParty/OpenJPEG/src/openjpeg/CMakeLists.txt
index e62e43eda..35dc89976 100644
--- a/Modules/ThirdParty/OpenJPEG/src/openjpeg/CMakeLists.txt
+++ b/Modules/ThirdParty/OpenJPEG/src/openjpeg/CMakeLists.txt
@@ -68,7 +68,7 @@ CONFIGURE_FILE(${ITK3P_OpenJPEG_SOURCE_DIR}/opj_configure.h.in
# configure name mangling to allow multiple libraries to coexist
# peacefully
if(EXISTS ${ITK3P_OpenJPEG_SOURCE_DIR}/openjpeg_mangle.h.in)
-set(MANGLE_PREFIX itk)
+#set(MANGLE_PREFIX itk)
configure_file(${ITK3P_OpenJPEG_SOURCE_DIR}/openjpeg_mangle.h.in
${ITK3P_OpenJPEG_BINARY_DIR}/openjpeg_mangle.h
@ONLY)

View File

@ -1,22 +1,129 @@
include(vcpkg_common_functions)
vcpkg_buildpath_length_warning(37) vcpkg_buildpath_length_warning(37)
vcpkg_from_github( vcpkg_from_github(
OUT_SOURCE_PATH SOURCE_PATH OUT_SOURCE_PATH SOURCE_PATH
REPO InsightSoftwareConsortium/ITK REPO InsightSoftwareConsortium/ITK
REF v5.0.1 REF d3286c9cc04ba16cc8f73de9a98fbcd7c02f3c7b
SHA512 242ce66cf83f82d26f20d2099108295e28c8875e7679126ba023834bf0e94454460ba86452a94c8ddaea93d2314befc399f2b151d7294370d4b47f0e9798e77f SHA512 c358449870d580aeb10e32f8be0ca39e8a76d8dc06fda973788fafb5971333e546611c399190be49d40f5f3c18a1105d9699eef271a560aff25ce168a396926e
HEAD_REF master HEAD_REF master
PATCHES PATCHES
fix_openjpeg_search.patch hdf5.patch
fix_libminc_config_path.patch double-conversion.patch
openjpeg.patch
openjpeg2.patch
var_libraries.patch
wrapping.patch
python_gpu_wrapping.patch
opencl.patch
cufftw.patch
) )
if ("vtk" IN_LIST FEATURES) vcpkg_check_features(OUT_FEATURE_OPTIONS FEATURE_OPTIONS
set(ITKVtkGlue ON) "vtk" Module_ITKVtkGlue
else() "cuda" Module_ITKCudaCommon # Requires RTK?
set(ITKVtkGlue OFF) #"cuda" CUDA_HAVE_GPU # Automatically set by FindCUDA?
"cufftw" ITK_USE_CUFFTW
"opencl" ITK_USE_GPU
"tbb" Module_ITKTBB
"rtk" Module_RTK
"tools" RTK_BUILD_APPLICATIONS
# There are a lot of more (remote) modules and options in ITK
# feel free to add those as a feature
)
if("cufftw" IN_LIST FEATURES)
# Alternativly set CUFFT_LIB and CUFFTW_LIB
if(WIN32)
file(TO_CMAKE_PATH "$ENV{CUDA_PATH}" CUDA_PATH)
set(CUDA_LIB_PATH "${CUDA_PATH}")
if(VCPKG_TARGET_ARCHITECTURE STREQUAL x64)
string(APPEND CUDA_LIB_PATH "/lib/x64")
elseif(VCPKG_TARGET_ARCHITECTURE STREQUAL x86)
string(APPEND CUDA_LIB_PATH "/lib/Win32")
message(FATAL_ERROR "CUFFTW is not supported on architecture ${VCPKG_TARGET_ARCHITECTURE}")
else()
message(FATAL_ERROR "Architecture ${VCPKG_TARGET_ARCHITECTURE} not supported !")
endif()
list(APPEND ADDITIONAL_OPTIONS
"-DFFTW_LIB_SEARCHPATH=${CUDA_LIB_PATH}"
"-DFFTW_INCLUDE_PATH=${CUDA_PATH}/include"
"-DCUFFTW_INCLUDE_PATH=${CUDA_PATH}/include"
)
endif()
endif()
if("rtk" IN_LIST FEATURES)
if(VCPKG_TARGET_ARCHITECTURE STREQUAL x86)
message(FATAL_ERROR "RTK is not supported on architecture ${VCPKG_TARGET_ARCHITECTURE}")
endif()
SET(BUILD_RTK ON)
list(APPEND ADDITIONAL_OPTIONS
"-DModule_RTK_GIT_TAG=8099212f715231d093f7d6a1114daecf45d871ed" # RTK latest versions (11.05.2020)
)
if("cuda" IN_LIST FEATURES)
list(APPEND ADDITIONAL_OPTIONS "-DRTK_USE_CUDA=ON")
#RTK + CUDA + PYTHON + dynamic library linkage will fail and needs upstream fixes.
endif()
endif()
file(REMOVE_RECURSE "${SOURCE_PATH}/Modules/Remote/RTK")
if("opencl" IN_LIST FEATURES)
list(APPEND ADDITIONAL_OPTIONS # Wrapping options required by OpenCL if build with Python Wrappers
-DITK_WRAP_unsigned_long_long=ON
-DITK_WRAP_signed_long_long=ON
)
endif()
if("tools" IN_LIST FEATURES)
if("rtk" IN_LIST FEATURES)
list(APPEND TOOL_NAMES rtkadmmtotalvariation rtkadmmwavelets rtkamsterdamshroud rtkbackprojections rtkbioscangeometry rtkcheckimagequality rtkconjugategradient
rtkdigisensgeometry rtkdrawgeometricphantom rtkdrawshepploganphantom rtkdualenergysimplexdecomposition rtkelektasynergygeometry rtkextractphasesignal
rtkextractshroudsignal rtkfdk rtkfdktwodweights rtkfieldofview rtkforwardprojections rtkfourdconjugategradient rtkfourdfdk rtkfourdrooster rtkfourdsart
rtkgaincorrection rtki0estimation rtkimagxgeometry rtkiterativefdk rtklagcorrection rtklastdimensionl0gradientdenoising rtklut rtkmaskcollimation rtkmcrooster
rtkmotioncompensatedfourdconjugategradient rtkorageometry rtkosem rtkoverlayphaseandshroud rtkparkershortscanweighting rtkprojectgeometricphantom
rtkprojectionmatrix rtkprojections rtkprojectshepploganphantom rtkramp rtkrayboxintersection rtkrayquadricintersection rtkregularizedconjugategradient
rtksart rtkscatterglarecorrection rtksimulatedgeometry rtkspectraldenoiseprojections rtkspectralforwardmodel rtkspectralonestep rtkspectralrooster rtkspectralsimplexdecomposition
rtksubselect rtktotalnuclearvariationdenoising rtktotalvariationdenoising rtktutorialapplication rtkvarianobigeometry rtkvarianprobeamgeometry rtkvectorconjugategradient
rtkwangdisplaceddetectorweighting rtkwarpedbackprojectsequence rtkwarpedforwardprojectsequence rtkwaveletsdenoising rtkxradgeometry)
endif()
endif()
if("vtk" IN_LIST FEATURES)
vcpkg_find_acquire_program(PYTHON3)
list(APPEND ADDITIONAL_OPTIONS
"-DPython3_EXECUTABLE:PATH=${PYTHON3}" # Required by mvtk if vtk[python] was build
)
endif()
if("python" IN_LIST FEATURES)
message(STATUS "${PORT} builds a long time (>1h) with python wrappers enabled!")
vcpkg_find_acquire_program(PYTHON3)
vcpkg_find_acquire_program(SWIG) # Swig is only required for wrapping!
get_filename_component(SWIG_DIR "${SWIG}" DIRECTORY)
list(APPEND ADDITIONAL_OPTIONS
-DITK_WRAP_PYTHON=ON
-DPython3_FIND_REGISTRY=NEVER
"-DPython3_EXECUTABLE:PATH=${PYTHON3}" # Required by more than one feature
"-DSWIG_EXECUTABLE=${SWIG}"
"-DSWIG_DIR=${SWIG_DIR}"
)
# Due to ITKs internal shenanigans with the variables ......
if(VCPKG_TARGET_IS_WINDOWS)
list(APPEND ADDITIONAL_OPTIONS "-DPython3_LIBRARY_RELEASE:PATH=${CURRENT_INSTALLED_DIR}/lib/python38.lib"
"-DPython3_LIBRARY_DEBUG:PATH=${CURRENT_INSTALLED_DIR}/debug/lib/python38_d.lib"
"-DPython3_INCLUDE_DIR:PATH=${CURRENT_INSTALLED_DIR}/include/python3.8")
list(APPEND OPTIONS_DEBUG "-DPython3_LIBRARY=${CURRENT_INSTALLED_DIR}/debug/lib/python38_d.lib")
list(APPEND OPTIONS_RELEASE "-DPython3_LIBRARY=${CURRENT_INSTALLED_DIR}/lib/python38.lib")
elseif(VCPKG_TARGET_IS_LINUX)
list(APPEND ADDITIONAL_OPTIONS "-DPython3_LIBRARY_RELEASE:PATH=${CURRENT_INSTALLED_DIR}/lib/libpython38m.a"
"-DPython3_LIBRARY_DEBUG:PATH=${CURRENT_INSTALLED_DIR}/debug/lib/libpython38md.a"
"-DPython3_INCLUDE_DIR:PATH=${CURRENT_INSTALLED_DIR}/include/python3.8m")
list(APPEND OPTIONS_DEBUG "-DPython3_LIBRARY=${CURRENT_INSTALLED_DIR}/debug/lib/libpython38md.a")
list(APPEND OPTIONS_RELEASE "-DPython3_LIBRARY=${CURRENT_INSTALLED_DIR}/lib/libpython38m.a")
elseif(VCPKG_TARGET_IS_OSX)
#Need Python3 information on OSX within VCPKG
endif()
#ITK_PYTHON_SITE_PACKAGES_SUFFIX should be set to the install dir of the site-packages within vcpkg
endif() endif()
set(USE_64BITS_IDS OFF) set(USE_64BITS_IDS OFF)
@ -24,6 +131,7 @@ if (VCPKG_TARGET_ARCHITECTURE STREQUAL x64 OR VCPKG_TARGET_ARCHITECTURE STREQUAL
set(USE_64BITS_IDS ON) set(USE_64BITS_IDS ON)
endif() endif()
file(REMOVE_RECURSE "${SOURCE_PATH}/CMake/FindOpenCL.cmake")
vcpkg_configure_cmake( vcpkg_configure_cmake(
SOURCE_PATH ${SOURCE_PATH} SOURCE_PATH ${SOURCE_PATH}
PREFER_NINJA PREFER_NINJA
@ -31,7 +139,10 @@ vcpkg_configure_cmake(
OPTIONS OPTIONS
-DBUILD_TESTING=OFF -DBUILD_TESTING=OFF
-DBUILD_EXAMPLES=OFF -DBUILD_EXAMPLES=OFF
-DBUILD_PKGCONFIG_FILES=OFF
-DITK_DOXYGEN_HTML=OFF
-DDO_NOT_INSTALL_ITK_TEST_DRIVER=ON -DDO_NOT_INSTALL_ITK_TEST_DRIVER=ON
-DITK_SKIP_PATH_LENGTH_CHECKS=ON
-DITK_INSTALL_DATA_DIR=share/itk/data -DITK_INSTALL_DATA_DIR=share/itk/data
-DITK_INSTALL_DOC_DIR=share/itk/doc -DITK_INSTALL_DOC_DIR=share/itk/doc
-DITK_INSTALL_PACKAGE_DIR=share/itk -DITK_INSTALL_PACKAGE_DIR=share/itk
@ -45,31 +156,58 @@ vcpkg_configure_cmake(
-DITK_USE_SYSTEM_TIFF=ON -DITK_USE_SYSTEM_TIFF=ON
-DITK_USE_SYSTEM_ZLIB=ON -DITK_USE_SYSTEM_ZLIB=ON
-DITK_USE_SYSTEM_EIGEN=ON -DITK_USE_SYSTEM_EIGEN=ON
# This should be turned on some day, however for now ITK does download specific versions so it shouldn't spontaneously break -DITK_USE_SYSTEM_FFTW=ON
-DITK_FORBID_DOWNLOADS=OFF -DITK_USE_SYSTEM_HDF5=ON # HDF5 was problematic in the past and still is. ITK still has not figured out how to do it correctly!
-DITK_USE_SYSTEM_GDCM=ON
-DITK_USE_SYSTEM_OpenJPEG=ON # Added by VCPKG
-DITK_USE_SYSTEM_DCMTK=ON
-DDCMTK_USE_ICU=ON
-DITK_USE_SYSTEM_ICU=ON
#-DITK_USE_SYSTEM_VXL=ON
#-DITK_USE_SYSTEM_CASTXML=ON # needs to be added to vcpkg_find_acquire_program https://data.kitware.com/api/v1/file/hashsum/sha512/b8b6f0aff11fe89ab2fcd1949cc75f2c2378a7bc408827a004396deb5ff5a9976bffe8a597f8db1b74c886ea39eb905e610dce8f5bd7586a4d6c196d7349da8d/download
-DITK_USE_SYSTEM_MINC=ON
-DITK_USE_SYSTEM_SWIG=ON
-DITK_FORBID_DOWNLOADS=OFF # This should be turned on some day, however for now ITK does download specific versions so it shouldn't spontaneously break. Remote Modules would probably break with this!
-DINSTALL_GTEST=OFF
-DITK_USE_SYSTEM_GOOGLETEST=ON
-DEXECUTABLE_OUTPUT_PATH=tools/${PORT}
# TODO
#-DVXL_USE_GEOTIFF=ON
-DVXL_USE_LFS=ON
-DITK_MINIMUM_COMPLIANCE_LEVEL:STRING=1 # To Display all remote modules within cmake-gui
#-DModule_IOSTL=ON # example how to turn on a non-default module
#-DModule_MorphologicalContourInterpolation=ON # example how to turn on a remote module
#-DModule_RLEImage=ON # example how to turn on a remote module
# Some additional wraping options
#-DITK_WRAP_double=ON
#-DITK_WRAP_complex_double=ON
#-DITK_WRAP_covariant_vector_double=ON
#-DITK_WRAP_vector_double=ON
-DITK_SKIP_PATH_LENGTH_CHECKS=ON ${FEATURE_OPTIONS}
# I haven't tried Python wrapping in vcpkg
#-DITK_WRAP_PYTHON=ON
#-DITK_PYTHON_VERSION=3
-DITK_USE_SYSTEM_HDF5=ON # HDF5 was problematic in the past
-DModule_ITKVtkGlue=${ITKVtkGlue} # optional feature
-DModule_IOSTL=ON # example how to turn on a non-default module
-DModule_MorphologicalContourInterpolation=ON # example how to turn on a remote module
-DModule_RLEImage=ON # example how to turn on a remote module
-DGDCM_USE_SYSTEM_OPENJPEG=ON #Use port openjpeg instead of own third-party
${ADDITIONAL_OPTIONS} ${ADDITIONAL_OPTIONS}
OPTIONS_DEBUG ${OPTIONS_DEBUG}
OPTIONS_RELEASE ${OPTIONS_RELEASE}
) )
if(BUILD_RTK) # Remote Modules are only downloaded on configure.
# TODO: In the future try to download via vcpkg_from_github and move the files. That way patching does not need this workaround
vcpkg_apply_patches(SOURCE_PATH "${SOURCE_PATH}/Modules/Remote/RTK" QUIET PATCHES rtk/already_defined.patch rtk/unresolved.patch)
endif()
vcpkg_install_cmake() vcpkg_install_cmake()
vcpkg_copy_pdbs() vcpkg_copy_pdbs()
vcpkg_fixup_cmake_targets() vcpkg_fixup_cmake_targets()
if(TOOL_NAMES)
vcpkg_copy_tools(TOOL_NAMES ${TOOL_NAMES} AUTO_CLEAN)
endif()
file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/share) file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/lib/cmake")
file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include) file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/lib/cmake")
file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/share")
file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/include")
file(INSTALL ${SOURCE_PATH}/LICENSE DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT} RENAME copyright) file(INSTALL ${SOURCE_PATH}/LICENSE DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT} RENAME copyright)

View File

@ -0,0 +1,178 @@
diff --git a/CMake/itkOpenCL.cmake b/CMake/itkOpenCL.cmake
index 0ccbe144d..fa381524f 100644
--- a/CMake/itkOpenCL.cmake
+++ b/CMake/itkOpenCL.cmake
@@ -48,7 +48,7 @@ if(ITK_USE_GPU)
)
set_source_files_properties(${CMAKE_CURRENT_BINARY_DIR}/${OUTPUT_FILE}
PROPERTIES GENERATED ON)
- set(${SRC_VAR} ${${SRC_VAR}} ${OUTPUT_FILE})
+ set(${SRC_VAR} ${${SRC_VAR}} ${CMAKE_CURRENT_BINARY_DIR}/${OUTPUT_FILE})
endmacro()
macro(write_gpu_kernels GPUKernels GPU_SRC)
diff --git a/Modules/Core/Common/include/itkMacro.h b/Modules/Core/Common/include/itkMacro.h
index 1816f722a..3a6a8aee5 100644
--- a/Modules/Core/Common/include/itkMacro.h
+++ b/Modules/Core/Common/include/itkMacro.h
@@ -1141,7 +1141,7 @@ compilers.
#define itkGetVectorMacro(name, type, count) \
virtual type * Get##name() const { return this->m_##name; }
-/**\def itkGPUKernelClassMacro
+/**\def class itkGPUKernelClassMacro
* Construct a non-templatized helper class that
* provides the GPU kernel source code as a const char*
*/
@@ -1150,7 +1150,7 @@ compilers.
* Workaround KWstyle bug \ \
* \ingroup ITKCommon \ \
*/ \
- class kernel \
+ kernel \
{ \
public: \
static const char * \
diff --git a/Modules/Core/GPUCommon/include/itkGPUImageOps.h b/Modules/Core/GPUCommon/include/itkGPUImageOps.h
index f4eb8f33b..fbdf3d757 100644
--- a/Modules/Core/GPUCommon/include/itkGPUImageOps.h
+++ b/Modules/Core/GPUCommon/include/itkGPUImageOps.h
@@ -23,7 +23,7 @@
namespace itk
{
/** Create a helper GPU Kernel class for GPUImageOps */
-itkGPUKernelClassMacro(GPUImageOpsKernel);
+class itkGPUKernelClassMacro(GPUImageOpsKernel);
/** \class GPUImageOps
*
diff --git a/Modules/Core/GPUCommon/include/itkGPUReduction.h b/Modules/Core/GPUCommon/include/itkGPUReduction.h
index 524a5cd01..1b3ce91e9 100644
--- a/Modules/Core/GPUCommon/include/itkGPUReduction.h
+++ b/Modules/Core/GPUCommon/include/itkGPUReduction.h
@@ -26,7 +26,7 @@
namespace itk
{
/** Create a helper GPU Kernel class for GPUReduction */
-itkGPUKernelClassMacro(GPUReductionKernel);
+class itkGPUKernelClassMacro(GPUReductionKernel);
/**
* \class GPUReduction
diff --git a/Modules/Core/GPUFiniteDifference/include/itkGPUDenseFiniteDifferenceImageFilter.h b/Modules/Core/GPUFiniteDifference/include/itkGPUDenseFiniteDifferenceImageFilter.h
index 853801cec..2fccf0bc5 100644
--- a/Modules/Core/GPUFiniteDifference/include/itkGPUDenseFiniteDifferenceImageFilter.h
+++ b/Modules/Core/GPUFiniteDifference/include/itkGPUDenseFiniteDifferenceImageFilter.h
@@ -24,7 +24,7 @@
namespace itk
{
/** Create a helper GPU Kernel class for GPUDenseFiniteDifferenceImageFilter */
-itkGPUKernelClassMacro(GPUDenseFiniteDifferenceImageFilterKernel);
+class ITKGPUFiniteDifference_EXPORT itkGPUKernelClassMacro(GPUDenseFiniteDifferenceImageFilterKernel);
/**
* \class GPUDenseFiniteDifferenceImageFilter
diff --git a/Modules/Filtering/GPUAnisotropicSmoothing/include/itkGPUGradientNDAnisotropicDiffusionFunction.h b/Modules/Filtering/GPUAnisotropicSmoothing/include/itkGPUGradientNDAnisotropicDiffusionFunction.h
index 4245ff914..1b21b709e 100644
--- a/Modules/Filtering/GPUAnisotropicSmoothing/include/itkGPUGradientNDAnisotropicDiffusionFunction.h
+++ b/Modules/Filtering/GPUAnisotropicSmoothing/include/itkGPUGradientNDAnisotropicDiffusionFunction.h
@@ -54,7 +54,7 @@ namespace itk
*/
/** Create a helper GPU Kernel class for GPUGradientNDAnisotropicDiffusionFunction */
-itkGPUKernelClassMacro(GPUGradientNDAnisotropicDiffusionFunctionKernel);
+class itkGPUKernelClassMacro(GPUGradientNDAnisotropicDiffusionFunctionKernel);
template <typename TImage>
class ITK_TEMPLATE_EXPORT GPUGradientNDAnisotropicDiffusionFunction
diff --git a/Modules/Filtering/GPUAnisotropicSmoothing/include/itkGPUScalarAnisotropicDiffusionFunction.h b/Modules/Filtering/GPUAnisotropicSmoothing/include/itkGPUScalarAnisotropicDiffusionFunction.h
index 305f6490e..d0d433080 100644
--- a/Modules/Filtering/GPUAnisotropicSmoothing/include/itkGPUScalarAnisotropicDiffusionFunction.h
+++ b/Modules/Filtering/GPUAnisotropicSmoothing/include/itkGPUScalarAnisotropicDiffusionFunction.h
@@ -32,7 +32,7 @@ namespace itk
* */
/** Create a helper GPU Kernel class for GPUScalarAnisotropicDiffusionFunction */
-itkGPUKernelClassMacro(GPUScalarAnisotropicDiffusionFunctionKernel);
+class itkGPUKernelClassMacro(GPUScalarAnisotropicDiffusionFunctionKernel);
template <typename TImage>
class ITK_TEMPLATE_EXPORT GPUScalarAnisotropicDiffusionFunction : public GPUAnisotropicDiffusionFunction<TImage>
diff --git a/Modules/Filtering/GPUImageFilterBase/include/itkGPUCastImageFilter.h b/Modules/Filtering/GPUImageFilterBase/include/itkGPUCastImageFilter.h
index 23530ac5c..e1b83f696 100644
--- a/Modules/Filtering/GPUImageFilterBase/include/itkGPUCastImageFilter.h
+++ b/Modules/Filtering/GPUImageFilterBase/include/itkGPUCastImageFilter.h
@@ -29,7 +29,7 @@ namespace itk
{
/** Create a helper GPU Kernel class for GPUCastImageFilter */
-itkGPUKernelClassMacro(GPUCastImageFilterKernel);
+class itkGPUKernelClassMacro(GPUCastImageFilterKernel);
/** \class GPUCastImageFilter
* \brief GPU version of CastImageFilter.
diff --git a/Modules/Filtering/GPUImageFilterBase/include/itkGPUNeighborhoodOperatorImageFilter.h b/Modules/Filtering/GPUImageFilterBase/include/itkGPUNeighborhoodOperatorImageFilter.h
index c4adc2967..69aeac6db 100644
--- a/Modules/Filtering/GPUImageFilterBase/include/itkGPUNeighborhoodOperatorImageFilter.h
+++ b/Modules/Filtering/GPUImageFilterBase/include/itkGPUNeighborhoodOperatorImageFilter.h
@@ -41,7 +41,7 @@ namespace itk
*/
/** Create a helper GPU Kernel class for GPUNeighborhoodOperatorImageFilter */
-itkGPUKernelClassMacro(GPUNeighborhoodOperatorImageFilterKernel);
+class itkGPUKernelClassMacro(GPUNeighborhoodOperatorImageFilterKernel);
template <typename TInputImage,
typename TOutputImage,
diff --git a/Modules/Filtering/GPUSmoothing/include/itkGPUMeanImageFilter.h b/Modules/Filtering/GPUSmoothing/include/itkGPUMeanImageFilter.h
index 57bc3ebb7..4ff98c665 100644
--- a/Modules/Filtering/GPUSmoothing/include/itkGPUMeanImageFilter.h
+++ b/Modules/Filtering/GPUSmoothing/include/itkGPUMeanImageFilter.h
@@ -37,7 +37,7 @@ namespace itk
*/
/** Create a helper GPU Kernel class for GPUMeanImageFilter */
-itkGPUKernelClassMacro(GPUMeanImageFilterKernel);
+class itkGPUKernelClassMacro(GPUMeanImageFilterKernel);
template <typename TInputImage, typename TOutputImage>
class ITK_TEMPLATE_EXPORT GPUMeanImageFilter
diff --git a/Modules/Filtering/GPUThresholding/include/itkGPUBinaryThresholdImageFilter.h b/Modules/Filtering/GPUThresholding/include/itkGPUBinaryThresholdImageFilter.h
index 8d26dcfc5..613bc623f 100644
--- a/Modules/Filtering/GPUThresholding/include/itkGPUBinaryThresholdImageFilter.h
+++ b/Modules/Filtering/GPUThresholding/include/itkGPUBinaryThresholdImageFilter.h
@@ -85,7 +85,7 @@ private:
} // end of namespace Functor
/** Create a helper GPU Kernel class for GPUBinaryThresholdImageFilter */
-itkGPUKernelClassMacro(GPUBinaryThresholdImageFilterKernel);
+class itkGPUKernelClassMacro(GPUBinaryThresholdImageFilterKernel);
/**
* \class GPUBinaryThresholdImageFilter
diff --git a/Modules/Registration/GPUPDEDeformable/include/itkGPUDemonsRegistrationFunction.h b/Modules/Registration/GPUPDEDeformable/include/itkGPUDemonsRegistrationFunction.h
index 28b21d592..0b46e27b8 100644
--- a/Modules/Registration/GPUPDEDeformable/include/itkGPUDemonsRegistrationFunction.h
+++ b/Modules/Registration/GPUPDEDeformable/include/itkGPUDemonsRegistrationFunction.h
@@ -51,7 +51,7 @@ namespace itk
* \ingroup ITKGPUPDEDeformableRegistration
*/
/** Create a helper GPU Kernel class for GPUDemonsRegistrationFunction */
-itkGPUKernelClassMacro(GPUDemonsRegistrationFunctionKernel);
+class itkGPUKernelClassMacro(GPUDemonsRegistrationFunctionKernel);
template <typename TFixedImage, typename TMovingImage, typename TDisplacementField>
class ITK_TEMPLATE_EXPORT GPUDemonsRegistrationFunction
diff --git a/Modules/Registration/GPUPDEDeformable/include/itkGPUPDEDeformableRegistrationFilter.h b/Modules/Registration/GPUPDEDeformable/include/itkGPUPDEDeformableRegistrationFilter.h
index 93ab975ec..0afd84871 100644
--- a/Modules/Registration/GPUPDEDeformable/include/itkGPUPDEDeformableRegistrationFilter.h
+++ b/Modules/Registration/GPUPDEDeformable/include/itkGPUPDEDeformableRegistrationFilter.h
@@ -73,7 +73,7 @@ namespace itk
*/
/** Create a helper GPU Kernel class for GPUPDEDeformableRegistrationFilter */
-itkGPUKernelClassMacro(GPUPDEDeformableRegistrationFilterKernel);
+class itkGPUKernelClassMacro(GPUPDEDeformableRegistrationFilterKernel);
template <typename TFixedImage,
typename TMovingImage,

View File

@ -0,0 +1,100 @@
diff --git a/include/rtkProjectionGeometry.h b/include/rtkProjectionGeometry.h
index e5831611f..73ed2b74f 100644
--- a/include/rtkProjectionGeometry.h
+++ b/include/rtkProjectionGeometry.h
@@ -23,6 +23,7 @@
#include <vector>
+#include "RTKExport.h"
#include "rtkMacro.h"
namespace rtk
@@ -67,25 +68,18 @@ public:
* with the i-th matrix provides the physical coordinate on
* the i-th projection.
*/
- const std::vector<MatrixType> &
- GetMatrices() const
- {
- return this->m_Matrices;
- }
+ itkGetConstReferenceMacro(Matrices,std::vector<MatrixType>)
/** Get the i-th projection matrix. */
MatrixType
- GetMatrix(const unsigned int i) const
- {
- return this->m_Matrices[i];
- }
+ GetMatrix(const unsigned int i) const;
/** Empty the geometry object. */
virtual void
Clear();
protected:
- ProjectionGeometry() = default;
+ ProjectionGeometry();
~ProjectionGeometry() override = default;
void
@@ -93,11 +87,7 @@ protected:
/** Add projection matrix */
virtual void
- AddMatrix(const MatrixType & m)
- {
- this->m_Matrices.push_back(m);
- this->Modified();
- }
+ AddMatrix(const MatrixType & m);
private:
/** Projection matrices */
@@ -105,6 +95,9 @@ private:
};
} // namespace rtk
-#include "rtkProjectionGeometry.hxx"
+#ifndef ITK_MANUAL_INSTANTIATION
+# include "rtkProjectionGeometry.hxx"
+#endif
+
#endif // rtkProjectionGeometry_h
diff --git a/include/rtkProjectionGeometry.hxx b/include/rtkProjectionGeometry.hxx
index 192265812..97dfe8c3a 100644
--- a/include/rtkProjectionGeometry.hxx
+++ b/include/rtkProjectionGeometry.hxx
@@ -23,6 +23,8 @@
namespace rtk
{
+template <unsigned int TDimension>
+ProjectionGeometry<TDimension>::ProjectionGeometry() = default;
template <unsigned int TDimension>
void
@@ -43,6 +45,21 @@ ProjectionGeometry<TDimension>::Clear()
this->Modified();
}
+template <unsigned int TDimension>
+typename ProjectionGeometry<TDimension>::MatrixType
+ProjectionGeometry<TDimension>::GetMatrix(const unsigned int i) const
+{
+ return this->m_Matrices[i];
+}
+
+template <unsigned int TDimension>
+void
+ProjectionGeometry<TDimension>::AddMatrix(const typename ProjectionGeometry<TDimension>::MatrixType & m)
+{
+ this->m_Matrices.push_back(m);
+ this->Modified();
+}
+
} // namespace rtk
#endif // rtkProjectionGeometry_hxx

View File

@ -0,0 +1,213 @@
diff --git a/include/rtkDCMImagXImageIO.h b/include/rtkDCMImagXImageIO.h
index 2a70ae046..69abb409e 100644
--- a/include/rtkDCMImagXImageIO.h
+++ b/include/rtkDCMImagXImageIO.h
@@ -18,7 +18,7 @@
#ifndef rtkDCMImagXImageIO_h
#define rtkDCMImagXImageIO_h
-
+#include "RTKExport.h"
#include <itkGDCMImageIO.h>
#include "rtkMacro.h"
@@ -32,7 +32,7 @@ namespace rtk
*
* \ingroup RTK
*/
-class DCMImagXImageIO : public itk::GDCMImageIO
+class RTK_EXPORT DCMImagXImageIO : public itk::GDCMImageIO
{
public:
ITK_DISALLOW_COPY_AND_ASSIGN(DCMImagXImageIO);
diff --git a/include/rtkEdfImageIO.h b/include/rtkEdfImageIO.h
index 66499c56b..7b16fbc5a 100644
--- a/include/rtkEdfImageIO.h
+++ b/include/rtkEdfImageIO.h
@@ -18,7 +18,7 @@
#ifndef rtkEdfImageIO_h
#define rtkEdfImageIO_h
-
+#include "RTKExport.h"
#include <itkImageIOBase.h>
#include <fstream>
#include <cstring>
@@ -36,7 +36,7 @@ namespace rtk
*
* \ingroup RTK IOFilters
*/
-class EdfImageIO : public itk::ImageIOBase
+class RTK_EXPORT EdfImageIO : public itk::ImageIOBase
{
public:
ITK_DISALLOW_COPY_AND_ASSIGN(EdfImageIO);
diff --git a/include/rtkHisImageIO.h b/include/rtkHisImageIO.h
index 2ef2005dd..95449b8a6 100644
--- a/include/rtkHisImageIO.h
+++ b/include/rtkHisImageIO.h
@@ -19,6 +19,8 @@
#ifndef rtkHisImageIO_h
#define rtkHisImageIO_h
+#include "RTKExport.h"
+
// itk include
#include <itkImageIOBase.h>
#include "rtkMacro.h"
@@ -35,7 +37,7 @@ namespace rtk
*
* \ingroup RTK IOFilters
*/
-class HisImageIO : public itk::ImageIOBase
+class RTK_EXPORT HisImageIO : public itk::ImageIOBase
{
public:
/** Standard class type alias. */
diff --git a/include/rtkHncImageIO.h b/include/rtkHncImageIO.h
index 7b9539bde..dc9dca759 100644
--- a/include/rtkHncImageIO.h
+++ b/include/rtkHncImageIO.h
@@ -19,9 +19,11 @@
#ifndef rtkHncImageIO_h
#define rtkHncImageIO_h
+#include "RTKExport.h"
+
// itk include
#include <itkImageIOBase.h>
-#include "itksys/SystemTools.hxx"
+//#include "itksys/SystemTools.hxx"
#if defined(_MSC_VER) && (_MSC_VER < 1600)
// SR: taken from
@@ -43,7 +45,7 @@ namespace rtk
*
* \ingroup RTK IOFilters
*/
-class HncImageIO : public itk::ImageIOBase
+class RTK_EXPORT HncImageIO : public itk::ImageIOBase
{
public:
/** Standard class type alias. */
diff --git a/include/rtkHncImageIOFactory.h b/include/rtkHncImageIOFactory.h
index 2bca8f77e..1d5a97938 100644
--- a/include/rtkHncImageIOFactory.h
+++ b/include/rtkHncImageIOFactory.h
@@ -38,7 +38,7 @@ namespace rtk
*
* \ingroup RTK IOFilters
*/
-class HncImageIOFactory : public itk::ObjectFactoryBase
+class RTK_EXPORT HncImageIOFactory : public itk::ObjectFactoryBase
{
public:
/** Standard class type alias. */
diff --git a/include/rtkHndImageIO.h b/include/rtkHndImageIO.h
index 5a07897cc..5f843362a 100644
--- a/include/rtkHndImageIO.h
+++ b/include/rtkHndImageIO.h
@@ -19,6 +19,8 @@
#ifndef rtkHndImageIO_h
#define rtkHndImageIO_h
+#include "RTKExport.h"
+
// itk include
#include <itkImageIOBase.h>
@@ -43,7 +45,7 @@ namespace rtk
*
* \ingroup RTK IOFilters
*/
-class HndImageIO : public itk::ImageIOBase
+class RTK_EXPORT HndImageIO : public itk::ImageIOBase
{
public:
/** Standard class type alias. */
diff --git a/include/rtkImagXImageIO.h b/include/rtkImagXImageIO.h
index d69e9a790..d6cc8388e 100644
--- a/include/rtkImagXImageIO.h
+++ b/include/rtkImagXImageIO.h
@@ -18,7 +18,7 @@
#ifndef rtkImagXImageIO_h
#define rtkImagXImageIO_h
-
+#include "RTKExport.h"
#include <itkImageIOBase.h>
#include <fstream>
#include <cstring>
@@ -34,7 +34,7 @@ namespace rtk
*
* \ingroup RTK
*/
-class ImagXImageIO : public itk::ImageIOBase
+class RTK_EXPORT ImagXImageIO : public itk::ImageIOBase
{
public:
/** Standard class type alias. */
diff --git a/include/rtkOraImageIO.h b/include/rtkOraImageIO.h
index ece525a42..2d5332872 100644
--- a/include/rtkOraImageIO.h
+++ b/include/rtkOraImageIO.h
@@ -19,6 +19,8 @@
#ifndef rtkOraImageIO_h
#define rtkOraImageIO_h
+#include "RTKExport.h"
+
// This is done to avoid any interference with zlib
#ifdef OF
# undef OF
@@ -41,7 +43,7 @@ namespace rtk
*
* \ingroup RTK IOFilters
*/
-class OraImageIO : public itk::MetaImageIO
+class RTK_EXPORT OraImageIO : public itk::MetaImageIO
{
public:
/** Standard class type alias. */
diff --git a/include/rtkXRadImageIO.h b/include/rtkXRadImageIO.h
index a72c934e4..0a92afa22 100644
--- a/include/rtkXRadImageIO.h
+++ b/include/rtkXRadImageIO.h
@@ -19,6 +19,7 @@
#ifndef rtkXRadImageIO_h
#define rtkXRadImageIO_h
+#include "RTKExport.h"
#include <itkImageIOBase.h>
#include <fstream>
#include <cstring>
@@ -37,7 +38,7 @@ namespace rtk
*
* \ingroup RTK IOFilters
*/
-class XRadImageIO : public itk::ImageIOBase
+class RTK_EXPORT XRadImageIO : public itk::ImageIOBase
{
public:
/** Standard class type alias. */
diff --git a/include/rtkXimImageIO.h b/include/rtkXimImageIO.h
index ae789dbf9..741f05183 100644
--- a/include/rtkXimImageIO.h
+++ b/include/rtkXimImageIO.h
@@ -19,6 +19,7 @@
#ifndef rtkXimImageIO_h
#define rtkXimImageIO_h
+#include "RTKExport.h"
#include "rtkMacro.h"
// itk include
@@ -43,7 +44,7 @@ namespace rtk
*
* \ingroup RTK IOFilters
*/
-class XimImageIO : public itk::ImageIOBase
+class RTK_EXPORT XimImageIO : public itk::ImageIOBase
{
public:
/** Standard class type alias. */

View File

@ -0,0 +1,27 @@
diff --git a/CMake/ITKModuleMacros.cmake b/CMake/ITKModuleMacros.cmake
index da9f3a902..60420bb0a 100644
--- a/CMake/ITKModuleMacros.cmake
+++ b/CMake/ITKModuleMacros.cmake
@@ -162,9 +162,6 @@ macro(itk_module_impl)
foreach(dep IN LISTS ITK_MODULE_${itk-module}_DEPENDS)
list(APPEND ${itk-module}_LIBRARIES "${${dep}_LIBRARIES}")
endforeach()
- if(${itk-module}_LIBRARIES)
- list(REMOVE_DUPLICATES ${itk-module}_LIBRARIES)
- endif()
endif()
if(EXISTS ${${itk-module}_SOURCE_DIR}/include)
diff --git a/CMake/ITKModuleAPI.cmake b/CMake/ITKModuleAPI.cmake
index af64d96dc..809335e6d 100644
--- a/CMake/ITKModuleAPI.cmake
+++ b/CMake/ITKModuleAPI.cmake
@@ -133,7 +133,7 @@ macro(itk_module_config ns)
endforeach()
unset(_${ns}_USED_MODULES)
- foreach(v ${ns}_LIBRARIES ${ns}_INCLUDE_DIRS ${ns}_LIBRARY_DIRS
+ foreach(v ${ns}_INCLUDE_DIRS ${ns}_LIBRARY_DIRS
${ns}_RUNTIME_LIBRARY_DIRS ${ns}_FACTORY_NAMES ${ns}_FACTORY_LIST)
if(${v})
list(REMOVE_DUPLICATES ${v})

19
ports/itk/wrapping.patch Normal file
View File

@ -0,0 +1,19 @@
diff --git a/Wrapping/TypedefMacros.cmake b/Wrapping/TypedefMacros.cmake
index e6f8d0bf3..6c000dba8 100644
--- a/Wrapping/TypedefMacros.cmake
+++ b/Wrapping/TypedefMacros.cmake
@@ -57,13 +57,12 @@ macro(itk_wrap_module library_name)
# WRAPPER_LIBRARY_DEPENDS. List of names of other wrapper libraries that
# define symbols used by this wrapper library.
INTERSECTION(WRAPPER_LIBRARY_DEPENDS "${ITK_MODULE_${library_name}_DEPENDS}" "${WRAP_ITK_MODULES}")
# set(WRAPPER_LIBRARY_DEPENDS ${ITK_MODULE_${library_name}_DEPENDS})
# WRAPPER_LIBRARY_LINK_LIBRARIES. List of other libraries that should
# be linked to the wrapper library.
- set(WRAPPER_LIBRARY_LINK_LIBRARIES ${ITK_LIBRARIES} ${${itk-module}_LIBRARIES})
-
+ set(WRAPPER_LIBRARY_LINK_LIBRARIES ${ITK_LIBRARIES} ${${library_name}_LIBRARIES})
# WRAPPER_SUBMODULE_ORDER. List of *.wrap submodules in the source dir
# that should be included/wrapped before the rest in the given order.
# Just the submodule group name is needed, not the full path or file name.

9
ports/minc/CONTROL Normal file
View File

@ -0,0 +1,9 @@
Source: minc
Version: 2.4.03
Description: MINC - Medical Image NetCDF or MINC isn't netCDF
Homepage: https://github.com/BIC-MNI/libminc
Build-Depends: nifticlib, hdf5[core], zlib
Feature: minc1
Description: Support minc1 file format, requires NETCDF
Build-Depends: netcdf[core]

67
ports/minc/build.patch Normal file
View File

@ -0,0 +1,67 @@
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 52cc81ace..d7a1f63f8 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -403,9 +404,11 @@ ENDIF(LIBMINC_MINC1_SUPPORT)
# Keep this variable for compatibility
SET(VOLUME_IO_LIBRARY ${LIBMINC_EXTERNAL_LIB_PREFIX}minc2)
SET(CMAKE_INSTALL_RPATH ${CMAKE_INSTALL_PREFIX}/lib${LIB_SUFFIX})
ADD_LIBRARY(${LIBMINC_LIBRARY} ${LIBRARY_TYPE} ${minc_LIB_SRCS} ${minc_HEADERS} ${volume_io_LIB_SRCS} ${volume_io_HEADERS} )
-
+if(WIN32)
+ target_link_libraries(${LIBMINC_LIBRARY} ws2_32)
+endif()
IF(NIFTI_FOUND AND NOT LIBMINC_USE_SYSTEM_NIFTI)
ADD_DEPENDENCIES(${LIBMINC_LIBRARY} NIFTI)
ENDIF()
@@ -453,7 +456,7 @@ IF( LIBMINC_INSTALL_LIB_DIR )
${LIBMINC_EXPORTED_TARGETS}
LIBRARY DESTINATION ${LIBMINC_INSTALL_LIB_DIR} COMPONENT libraries
ARCHIVE DESTINATION ${LIBMINC_INSTALL_LIB_DIR} COMPONENT libraries
- RUNTIME DESTINATION ${LIBMINC_INSTALL_LIB_DIR} COMPONENT libraries
+ RUNTIME DESTINATION ${LIBMINC_INSTALL_BIN_DIR} COMPONENT libraries
)
ENDIF( LIBMINC_INSTALL_LIB_DIR )
@@ -538,7 +541,7 @@ IF(LIBMINC_INSTALL_LIB_DIR AND NOT LIBMINC_INSTALL_NO_DEVELOPMENT)
${CMAKE_CURRENT_BINARY_DIR}/CMakeFiles/Use${LIBMINC_EXTERNAL_LIB_PREFIX}LIBMINC.cmake
${CMAKE_CURRENT_BINARY_DIR}/CMakeFiles/${LIBMINC_EXTERNAL_LIB_PREFIX}LIBMINCConfig.cmake
DESTINATION
- ${LIBMINC_INSTALL_LIB_DIR}
+ ${LIBMINC_INSTALL_LIB_DIR}/cmake
COMPONENT Development)
ENDIF(LIBMINC_INSTALL_LIB_DIR AND NOT LIBMINC_INSTALL_NO_DEVELOPMENT)
diff --git a/config.h.cmake b/config.h.cmake
index 9ceffa8fc..21c2f3baf 100644
--- a/config.h.cmake
+++ b/config.h.cmake
@@ -1,4 +1,8 @@
/* various defines */
+#ifdef _MSC_VER
+#define strcasecmp _stricmp
+#define strncasecmp _strnicmp
+#endif
#ifndef MINC2
#define MINC2 @MINC2@
diff --git a/libcommon/minc_config.c b/libcommon/minc_config.c
index 531ef108e..5472d9274 100644
--- a/libcommon/minc_config.c
+++ b/libcommon/minc_config.c
@@ -20,14 +20,6 @@
#include "minc_config.h"
-#ifdef _MSC_VER
-#define snprintf _snprintf
-#define vsnprintf _vsnprintf
-#define strcasecmp _stricmp
-#define strncasecmp _strnicmp
-#endif
-
-
static const char *_CONFIG_VAR[]=
{
"MINC_FORCE_V2",

15
ports/minc/config.patch Normal file
View File

@ -0,0 +1,15 @@
diff --git a/LIBMINCConfig.cmake.in b/LIBMINCConfig.cmake.in
index 7790597b2..c041b685a 100644
--- a/LIBMINCConfig.cmake.in
+++ b/LIBMINCConfig.cmake.in
@@ -1,3 +1,4 @@
+set(_IMPORT_PREFIX "${CMAKE_CURRENT_LIST_DIR}/../../")
# LIBMINC CMake configuration file
get_filename_component(LIBMINC_CMAKE_DIR "${CMAKE_CURRENT_LIST_FILE}" PATH )
@@ -37,3 +38,4 @@ set( LIBMINC_FOUND 1 )
# set( LIBMINC_TARGETS_IMPORTED 1 )
# include( "${LIBMINC_CMAKE_DIR}/@LIBMINC_EXPORTED_TARGETS@.cmake" )
#endif()
+unset(_IMPORT_PREFIX)
\ No newline at end of file

47
ports/minc/portfile.cmake Normal file
View File

@ -0,0 +1,47 @@
vcpkg_from_github(
OUT_SOURCE_PATH SOURCE_PATH
REPO BIC-MNI/libminc
REF e75a936c12a305b596d743c26a5437196ebce2a4
SHA512 744f879ac8f0594c310d1c1b7fe67543c5feeb3e5a0979035918dbb2bf1d0973fbd389e5357a75631e618cc614b648c21179f7467576bd68e3522e63f21451b0
HEAD_REF master
PATCHES build.patch
config.patch
)
vcpkg_check_features(OUT_FEATURE_OPTIONS FEATURE_OPTIONS
"minc1" LIBMINC_MINC1_SUPPORT
)
if(VCPKG_TARGET_IS_WINDOWS)
vcpkg_check_linkage(ONLY_STATIC_LIBRARY) # Symbols are not properly exported
endif()
set(OPTIONS)
if(VCPKG_LIBRARY_LINKAGE STREQUAL "dynamic")
list(APPEND OPTIONS "-DLIBMINC_BUILD_SHARED_LIBS=ON")
else()
list(APPEND OPTIONS "-DLIBMINC_BUILD_SHARED_LIBS=OFF")
endif()
vcpkg_configure_cmake(
SOURCE_PATH ${SOURCE_PATH}
PREFER_NINJA
DISABLE_PARALLEL_CONFIGURE
OPTIONS
"-DBUILD_TESTING=OFF"
"-DLIBMINC_USE_SYSTEM_NIFTI=ON"
${OPTIONS}
${FEATURE_OPTIONS}
)
vcpkg_install_cmake()
vcpkg_copy_pdbs()
vcpkg_fixup_cmake_targets(CONFIG_PATH lib/cmake TARGET_PATH share/libminc)
if(VCPKG_LIBRARY_LINKAGE STREQUAL "static")
file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/bin" "${CURRENT_PACKAGES_DIR}/debug/bin")
endif()
file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/share")
file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/include")
file(INSTALL ${SOURCE_PATH}/COPYING DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT} RENAME copyright)

25
ports/nifticlib/CONTROL Normal file
View File

@ -0,0 +1,25 @@
Source: nifticlib
Version: 2020-04-30
Description: Nifticlib is a C I/O library for reading and writing files in the nifti-1 data format.
Homepage: NIFTI-Imaging/nifti_clib
Build-Depends: zlib
Default-Features: nifti2, nifticdf
Supports: !uwp
Feature: cifti
Description: Build cifti libraries and tools
Feature: fsl
Description: Build fsl libraries and tools
Feature: nifti2
Description: Build nifti2 libraries and tools
Feature: nifticdf
Description: Build nifticdf libraries and tools
Feature: tools
Description: Build tools
Feature: tests
Description: Build tests

View File

@ -0,0 +1,48 @@
vcpkg_from_github(
OUT_SOURCE_PATH SOURCE_PATH
REPO NIFTI-Imaging/nifti_clib
REF 65f801b9c2f1f15f4de4a19d45e6595c25765632
SHA512 be03cdc6cf17fd9ff74c5ecc1f6b2132121bb4b7973a731da334af2a8428d1f0dbbf7b94b2511d1ff7e515b8cc4cf3316d62b189566fb6ffc88c6146eebd48ff
HEAD_REF master
PATCHES zlib_include.patch
)
if(VCPKG_TARGET_IS_WINDOWS)
vcpkg_check_linkage(ONLY_STATIC_LIBRARY)
endif()
vcpkg_check_features(OUT_FEATURE_OPTIONS FEATURE_OPTIONS
"cifti" USE_CIFTI_CODE
"fsl" USE_FSL_CODE
"nifti2" USE_NIFTI2_CODE
"nifticdf" USE_NIFTICDF_CODE
"tools" NIFTI_BUILD_APPLICATIONS
"tests" BUILD_TESTING
)
set(TOOL_NAMES)
if("tools" IN_LIST FEATURES)
list(APPEND TOOL_NAMES nifti_stats nifti_tool nifti1_tool)
endif()
if("tests" IN_LIST FEATURES)
list(APPEND TOOL_NAMES nifit_test)
endif()
vcpkg_configure_cmake(
SOURCE_PATH ${SOURCE_PATH}
PREFER_NINJA
OPTIONS
${FEATURE_OPTIONS}
)
vcpkg_install_cmake()
vcpkg_copy_pdbs()
vcpkg_fixup_cmake_targets(CONFIG_PATH share/cmake TARGET_PATH share)
if(TOOL_NAMES)
vcpkg_copy_tools(TOOL_NAMES ${TOOL_NAMES} AUTO_CLEAN)
endif()
file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/share")
file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/include")
file(INSTALL ${SOURCE_PATH}/LICENSE DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT} RENAME copyright)

View File

@ -0,0 +1,12 @@
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 54150d739..c3ca8fe50 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -77,6 +77,7 @@ set_if_not_defined(ZNZ_COMPILE_DEF "")
if(NOT NIFTI_ZLIB_LIBRARIES) # If using a custom zlib library, skip the find package
### USE AS STAND ALONE PACKAGE
find_package(ZLIB REQUIRED)
+ include_directories(${ZLIB_INCLUDE_DIRS})
set(NIFTI_ZLIB_LIBRARIES ${ZLIB_LIBRARIES})
endif()
#message(STATUS "---------------------ZLIB -${NIFTI_ZLIB_LIBRARIES}--")

View File

@ -1,5 +1,6 @@
Source: opencl Source: opencl
Version: 2.2-2-1 Version: 2.2
Port-Version: 3
Homepage: https://github.com/KhronosGroup/OpenCL-Headers Homepage: https://github.com/KhronosGroup/OpenCL-Headers
Description: C/C++ headers and ICD loader (Installable Client Driver) for OpenCL Description: C/C++ headers and ICD loader (Installable Client Driver) for OpenCL

View File

@ -4,6 +4,9 @@ if(NOT BUILD_SHARED_LIBS AND (NOT CMAKE_SYSTEM_NAME MATCHES "Darwin"))
set(OpenCL_Extra_Libs ${CMAKE_DL_LIBS} ${CMAKE_THREAD_LIBS_INIT}) set(OpenCL_Extra_Libs ${CMAKE_DL_LIBS} ${CMAKE_THREAD_LIBS_INIT})
if(CMAKE_SYSTEM_NAME MATCHES "Windows") if(CMAKE_SYSTEM_NAME MATCHES "Windows")
list(APPEND OpenCL_Extra_Libs cfgmgr32) list(APPEND OpenCL_Extra_Libs cfgmgr32)
if($ENV{WindowsSDKVersion} MATCHES "^10")
list(APPEND OpenCL_Extra_Libs OneCoreUAP)
endif()
endif(CMAKE_SYSTEM_NAME MATCHES "Windows") endif(CMAKE_SYSTEM_NAME MATCHES "Windows")
if(TARGET OpenCL::OpenCL) if(TARGET OpenCL::OpenCL)

View File

@ -1,4 +1,17 @@
Source: openjpeg Source: openjpeg
Version: 2.3.1-1 Version: 2.3.1
Port-Version: 2
Homepage: https://github.com/uclouvain/openjpeg Homepage: https://github.com/uclouvain/openjpeg
Description: JPEG 2000 image library Description: JPEG 2000 image library
Feature: jpwl
Description: Build optional component jpwl
Feature: mj2
Description: Build optional component mj2
Feature: jpip
Description: Build optional component jpip
Feature: jp3d
Description: Build optional component jp3d

View File

@ -0,0 +1,32 @@
diff --git a/src/lib/openjp3d/CMakeLists.txt b/src/lib/openjp3d/CMakeLists.txt
index b0469af1f..75048ef13 100644
--- a/src/lib/openjp3d/CMakeLists.txt
+++ b/src/lib/openjp3d/CMakeLists.txt
@@ -34,8 +34,9 @@ endif()
# Install library
install(TARGETS ${OPENJP3D_LIBRARY_NAME}
EXPORT OpenJP3DTargets
- DESTINATION ${OPENJPEG_INSTALL_LIB_DIR}
- COMPONENT Libraries
+ RUNTIME DESTINATION ${OPENJPEG_INSTALL_BIN_DIR} COMPONENT Applications
+ LIBRARY DESTINATION ${OPENJPEG_INSTALL_LIB_DIR} COMPONENT Libraries
+ ARCHIVE DESTINATION ${OPENJPEG_INSTALL_LIB_DIR} COMPONENT Libraries
)
# Install includes files
diff --git a/src/lib/openmj2/CMakeLists.txt b/src/lib/openmj2/CMakeLists.txt
index 25294b20e..e3acfe8e7 100644
--- a/src/lib/openmj2/CMakeLists.txt
+++ b/src/lib/openmj2/CMakeLists.txt
@@ -53,8 +53,9 @@ endif()
# Install library
install(TARGETS ${OPENMJ2_LIBRARY_NAME}
EXPORT OpenMJ2Targets
- DESTINATION ${OPENJPEG_INSTALL_LIB_DIR}
- COMPONENT Libraries
+ RUNTIME DESTINATION ${OPENJPEG_INSTALL_BIN_DIR} COMPONENT Applications
+ LIBRARY DESTINATION ${OPENJPEG_INSTALL_LIB_DIR} COMPONENT Libraries
+ ARCHIVE DESTINATION ${OPENJPEG_INSTALL_LIB_DIR} COMPONENT Libraries
)
# Install includes files

View File

@ -1,27 +1,65 @@
include(vcpkg_common_functions)
vcpkg_from_github( vcpkg_from_github(
OUT_SOURCE_PATH SOURCE_PATH OUT_SOURCE_PATH SOURCE_PATH
REPO uclouvain/openjpeg REPO uclouvain/openjpeg
REF v2.3.1 REF v2.3.1
SHA512 339fbc899bddf2393d214df71ed5d6070a3a76b933b1e75576c8a0ae9dfcc4adec40bdc544f599e4b8d0bc173e4e9e7352408497b5b3c9356985605830c26c03 SHA512 339fbc899bddf2393d214df71ed5d6070a3a76b933b1e75576c8a0ae9dfcc4adec40bdc544f599e4b8d0bc173e4e9e7352408497b5b3c9356985605830c26c03
HEAD_REF master HEAD_REF master
PATCHES dll.location.patch
) )
if(VCPKG_LIBRARY_LINKAGE STREQUAL "static")
list(APPEND OPTIONS "-DBUILD_SHARED_LIBS=OFF"
"-DBUILD_STATIC_LIBS=ON")
else()
list(APPEND OPTIONS "-DBUILD_SHARED_LIBS=ON"
"-DBUILD_STATIC_LIBS=OFF")
endif()
vcpkg_check_features(OUT_FEATURE_OPTIONS FEATURE_OPTIONS
"jpwl" BUILD_JPWL
"mj2" BUILD_MJ2
"jpip" BUILD_JPIP
"jp3d" BUILD_JP3D
)
vcpkg_configure_cmake( vcpkg_configure_cmake(
SOURCE_PATH ${SOURCE_PATH} SOURCE_PATH ${SOURCE_PATH}
PREFER_NINJA PREFER_NINJA
OPTIONS -DBUILD_CODEC:BOOL=OFF OPTIONS -DBUILD_CODEC:BOOL=OFF
-DBUILD_DOC:BOOL=OFF
-DOPENJPEG_INSTALL_PACKAGE_DIR=share/openjpeg -DOPENJPEG_INSTALL_PACKAGE_DIR=share/openjpeg
-DOPENJPEG_INSTALL_INCLUDE_DIR=include -DOPENJPEG_INSTALL_INCLUDE_DIR=include
-DEXECUTABLE_OUTPUT_PATH=tools/${PORT}
-DBUILD_PKGCONFIG_FILES=ON
${FEATURE_OPTIONS}
${OPTIONS}
) )
vcpkg_install_cmake() vcpkg_install_cmake()
vcpkg_fixup_cmake_targets()
if(VCPKG_TARGET_IS_WINDOWS)
# TODO: remove -lm from *.pc files
endif()
vcpkg_fixup_pkgconfig(SYSTEM_LIBRARIES m)
file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include) file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include)
vcpkg_fixup_cmake_targets() set(TOOL_NAMES)
if("jpwl" IN_LIST FEATURES)
list(APPEND TOOL_NAMES opj_dec_server opj_jpwl_compress opj_jpwl_decompress)
endif()
if("mj2" IN_LIST FEATURES)
list(APPEND TOOL_NAMES opj_compress opj_decompress opj_dump opj_mj2_compress opj_mj2_decompress opj_mj2_extract opj_mj2_wrap)
endif()
if("jpip" IN_LIST FEATURES)
list(APPEND TOOL_NAMES opj_jpip_addxml opj_jpip_test opj_jpip_transcode)
endif()
if("jp3d" IN_LIST FEATURES)
list(APPEND TOOL_NAMES opj_jp3d_compress opj_jp3d_decompress)
endif()
if(TOOL_NAMES)
vcpkg_copy_tools(TOOL_NAMES ${TOOL_NAMES} AUTO_CLEAN)
endif()
file(READ ${CURRENT_PACKAGES_DIR}/include/openjpeg.h OPENJPEG_H) file(READ ${CURRENT_PACKAGES_DIR}/include/openjpeg.h OPENJPEG_H)
if(VCPKG_LIBRARY_LINKAGE STREQUAL "static") if(VCPKG_LIBRARY_LINKAGE STREQUAL "static")
string(REPLACE "defined(OPJ_STATIC)" "1" OPENJPEG_H "${OPENJPEG_H}") string(REPLACE "defined(OPJ_STATIC)" "1" OPENJPEG_H "${OPENJPEG_H}")
@ -32,7 +70,6 @@ string(REPLACE "defined(DLL_EXPORT)" "0" OPENJPEG_H "${OPENJPEG_H}")
file(WRITE ${CURRENT_PACKAGES_DIR}/include/openjpeg.h "${OPENJPEG_H}") file(WRITE ${CURRENT_PACKAGES_DIR}/include/openjpeg.h "${OPENJPEG_H}")
# Handle copyright # Handle copyright
file(COPY ${SOURCE_PATH}/LICENSE DESTINATION ${CURRENT_PACKAGES_DIR}/share/openjpeg) file(INSTALL "${SOURCE_PATH}/LICENSE" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}" RENAME copyright)
file(RENAME ${CURRENT_PACKAGES_DIR}/share/openjpeg/LICENSE ${CURRENT_PACKAGES_DIR}/share/openjpeg/copyright)
vcpkg_copy_pdbs() vcpkg_copy_pdbs()

View File

@ -614,9 +614,6 @@ isal:x64-uwp=fail
isal:x64-windows=fail isal:x64-windows=fail
isal:x64-windows-static=fail isal:x64-windows-static=fail
isal:x86-windows=fail isal:x86-windows=fail
itk:x64-windows=fail
itk:x64-windows-static=fail
itk:x86-windows=fail
jack2:arm-uwp=fail jack2:arm-uwp=fail
jack2:x64-uwp=fail jack2:x64-uwp=fail
jaeger-client-cpp:arm64-windows=fail jaeger-client-cpp:arm64-windows=fail

View File

@ -33,6 +33,7 @@
## - NINJA ## - NINJA
## - NUGET ## - NUGET
## - SCONS ## - SCONS
## - SWIG
## - YASM ## - YASM
## ##
## Note that msys2 has a dedicated helper function: [`vcpkg_acquire_msys`](vcpkg_acquire_msys.md). ## Note that msys2 has a dedicated helper function: [`vcpkg_acquire_msys`](vcpkg_acquire_msys.md).
@ -309,7 +310,32 @@ function(vcpkg_find_acquire_program VAR)
set(PATHS ${DOWNLOADS}/tools/scons) set(PATHS ${DOWNLOADS}/tools/scons)
set(URL "https://sourceforge.net/projects/scons/files/scons-local-3.0.1.zip/download") set(URL "https://sourceforge.net/projects/scons/files/scons-local-3.0.1.zip/download")
set(ARCHIVE "scons-local-3.0.1.zip") set(ARCHIVE "scons-local-3.0.1.zip")
set(HASH fe121b67b979a4e9580c7f62cfdbe0c243eba62a05b560d6d513ac7f35816d439b26d92fc2d7b7d7241c9ce2a49ea7949455a17587ef53c04a5f5125ac635727) set(HASH fe121b67b979a4e9580c7f62cfdbe0c243eba62a05b560d6d513ac7f35816d439b26d92fc2d7b7d7241c9ce2a49ea7949455a17587ef53c04a5f5125ac635727)
elseif(VAR MATCHES "SWIG")
set(VERSION 4.0.2)
set(PROGNAME swig)
if(CMAKE_HOST_WIN32)
set(URL "https://sourceforge.net/projects/swig/files/swigwin/swigwin-${VERSION}/swigwin-${VERSION}.zip/download")
set(ARCHIVE "swigwin-${VERSION}.zip")
set(HASH b8f105f9b9db6acc1f6e3741990915b533cd1bc206eb9645fd6836457fd30789b7229d2e3219d8e35f2390605ade0fbca493ae162ec3b4bc4e428b57155db03d)
set(SUBDIR "swigwin-${VERSION}")
set(PATHS "${DOWNLOADS}/tools/swig/${SUBDIR}/${SUBDIR}")
else()
#Not used
set(_vfa_SUPPORTED TRUE)
set(URL https://sourceforge.net/projects/swig/files/swig/swig-${VERSION}/swig-${VERSION}.tar.gz/download)
set(ARCHIVE "swig-${VERSION}.tar.gz")
set(HASH 05e7da70ce6d9a733b96c0bcfa3c1b82765bd859f48c74759bbf4bb1467acb1809caa310cba5e2b3280cd704fca249eaa0624821dffae1d2a75097c7f55d14ed)
set(SUBDIR "swig-${VERSION}")
set(PATHS "${DOWNLOADS}/tools/swig/${SUBDIR}")
endif()
set(SOURCEFORGE_ARGS
REPO swig
FILENAME "${ARCHIVE}"
SHA512 "${HASH}"
NO_REMOVE_ONE_LEVEL
WORKING_DIRECTORY "${DOWNLOADS}/tools/swig"
)
elseif(VAR MATCHES "DOXYGEN") elseif(VAR MATCHES "DOXYGEN")
set(PROGNAME doxygen) set(PROGNAME doxygen)
set(DOXYGEN_VERSION 1.8.17) set(DOXYGEN_VERSION 1.8.17)