From 55c953ec997a66d21b8df3b5c8625d63b8de0d7f Mon Sep 17 00:00:00 2001 From: Niels Dekker Date: Tue, 8 Sep 2020 17:00:26 +0200 Subject: [PATCH] ENH: Switch to latest version of SuperElastix/elastix (using ITK 5.1.1) Removed obsolete `elastix::BaseComponent::InitializeElastixLibrary()` calls, as Elastix is now initialized as a library by default: "ENH: Replace InitializeElastixLibrary() by InitializeElastixExecutable()" https://github.com/SuperElastix/elastix/pull/248 https://github.com/SuperElastix/elastix/commit/ef64fb26abcb23a21f7010b5b58f0d732431f8a8 Adjusted CMake `Elastix_LIBRARIES`, as the Elastix library CMake targets are now named elastix_lib and transformix_lib: "ENH: Allow building exe and lib of elastix and transformix together" https://github.com/SuperElastix/elastix/pull/232 https://github.com/SuperElastix/elastix/commit/3944a13d8dcbe9fcc33cf348f25a1d4f59d79cd7 --- CMakeLists.txt | 7 ++++--- include/itkElastixRegistrationMethod.hxx | 1 - include/itkTransformixFilter.hxx | 2 -- 3 files changed, 4 insertions(+), 6 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index d6a25551..6cbde688 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -6,7 +6,7 @@ if(DEFINED ENV{ELASTIX_USE_OPENCL}) set(ELASTIX_USE_OPENCL ON CACHE BOOL "Enable OpenCL support in Elastix") endif() -set(Elastix_LIBRARIES elastix transformix) +set(Elastix_LIBRARIES elastix_lib transformix_lib) if(ELASTIX_USE_OPENCL) list(APPEND Elastix_LIBRARIES elxOpenCL) endif() @@ -39,8 +39,9 @@ set(_itk_build_testing ${BUILD_TESTING}) #set(BUILD_TESTING OFF) set(_itk_build_shared ${BUILD_SHARED_LIBS}) set(BUILD_SHARED_LIBS OFF) -set(elastix_GIT_REPOSITORY "https://github.com/thewtex/elastix.git") -set(elastix_GIT_TAG "a13be5c2daa1d2b8454609366aef3cba194be8c2") +set(elastix_GIT_REPOSITORY "https://github.com/SuperElastix/elastix.git") +# Tag of commit "COMP: Fix vnl_matrix_fixed "Implicit cast conversion" warnings" +set(elastix_GIT_TAG "69bfa5ac64f05c54fcda14865713a3ad05185db3") FetchContent_Declare( elx GIT_REPOSITORY ${elastix_GIT_REPOSITORY} diff --git a/include/itkElastixRegistrationMethod.hxx b/include/itkElastixRegistrationMethod.hxx index d894de31..379e9362 100644 --- a/include/itkElastixRegistrationMethod.hxx +++ b/include/itkElastixRegistrationMethod.hxx @@ -44,7 +44,6 @@ namespace itk template ElastixRegistrationMethod::ElastixRegistrationMethod() { - elastix::BaseComponent::InitializeElastixLibrary(); this->SetPrimaryInputName("FixedImage"); this->SetNumberOfIndexedOutputs(2); diff --git a/include/itkTransformixFilter.hxx b/include/itkTransformixFilter.hxx index b268c875..263c7a33 100644 --- a/include/itkTransformixFilter.hxx +++ b/include/itkTransformixFilter.hxx @@ -44,8 +44,6 @@ namespace itk template TransformixFilter::TransformixFilter() { - elastix::BaseComponent::InitializeElastixLibrary(); - this->SetPrimaryInputName("TransformParameterObject"); this->SetPrimaryOutputName("ResultImage"); this->SetOutput("ResultDeformationField", this->MakeOutput("ResultDeformationField"));