Skip to content

Commit

Permalink
Merge pull request ANTsX#535 from ANTsX/ITKv5
Browse files Browse the repository at this point in the history
ITKv5 preparation
  • Loading branch information
hjmjohnson authored Feb 13, 2018
2 parents c95e77a + 477cf4c commit 30eabeb
Show file tree
Hide file tree
Showing 75 changed files with 226 additions and 215 deletions.
16 changes: 8 additions & 8 deletions ANTS.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ if(USE_VTK)
vtkImagingGeneral
vtkRenderingAnnotation
)
else(VTK_VERSION_MAJOR GREATER 6)
else()
find_package(VTK COMPONENTS vtkRenderingVolumeOpenGL
vtkCommonCore
vtkCommonDataModel
Expand All @@ -80,16 +80,16 @@ if(USE_VTK)
vtkImagingStencil
vtkImagingGeneral
vtkRenderingAnnotation)
endif(VTK_VERSION_MAJOR GREATER 6)
endif()

if(VTK_FOUND)
include(${VTK_USE_FILE})
include_directories(${VTK_INCLUDE_DIRS})
set(INIT_VTK_LIBRARIES ${VTK_LIBRARIES})
else(VTK_FOUND)
else()
message("Cannot build some programs without VTK. Please set VTK_DIR if you need these programs.")
endif(VTK_FOUND)
endif(USE_VTK)
endif()
endif()

# With MS compilers on Win64, we need the /bigobj switch, else generated
# code results in objects with number of sections exceeding object file
Expand All @@ -106,11 +106,11 @@ if (ITK_USE_FFTWD OR ITK_USE_FFTWF)
if(ITK_USE_SYSTEM_FFTW)
find_package( FFTW )
link_directories(${FFTW_LIBDIR})
else(ITK_USE_SYSTEM_FFTW)
else()
link_directories(${ITK_DIR}/fftw/lib)
include_directories(${ITK_DIR}/fftw/include)
endif(ITK_USE_SYSTEM_FFTW)
endif(ITK_USE_FFTWD OR ITK_USE_FFTWF)
endif()
endif()

# These are configure time options that specify which
# subset of tests should be run
Expand Down
2 changes: 1 addition & 1 deletion CMake/ProjectSourceVersion.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ if(_GIT_VERSION VERSION_EQUAL _${CMAKE_PROJECT_NAME}_VERSION)
else()
# The first commit after a tag should increase the project version
# number in Version.cmake and be "dev1"
MATH(EXPR _GIT_VERSION_COUNT "${_GIT_VERSION_COUNT}+1")
math(EXPR _GIT_VERSION_COUNT "${_GIT_VERSION_COUNT}+1")
set(_GIT_VERSION_DEV "${_GIT_VERSION_COUNT}")
endif()

Expand Down
21 changes: 16 additions & 5 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,16 +1,27 @@
cmake_minimum_required(VERSION 2.8.9)
cmake_policy(VERSION 2.8.9)
if(CMAKE_CXX_STANDARD)
#if CMAKE_CXX_STANDARD is requested, then require
#new version of cmake to force C++11 that can
#improve support of C++11 features.
cmake_minimum_required(VERSION 3.8.2 FATAL_ERROR)
else()
cmake_minimum_required(VERSION 2.8.9)
cmake_policy(VERSION 2.8.9)
endif()

find_program(CCACHE_PROGRAM ccache)
if(CCACHE_PROGRAM)
option(ANTS_BUILD_WITH_CCACHE "Build ${LOCAL_PROJECT_NAME} using ccache if available." ON)
mark_as_advanced(ANTS_BUILD_WITH_CCACHE)
if(ANTS_BUILD_WITH_CCACHE)
find_program(CCACHE_PROGRAM ccache)
if(CCACHE_PROGRAM)
set_property(GLOBAL PROPERTY RULE_LAUNCH_COMPILE "${CCACHE_PROGRAM}")
endif()
endif()

set(LIBRARY_SOVERSION_INFO 2)
set(LIBRARY_VERSION_INFO 2.2.0)

set(LOCAL_PROJECT_NAME ANTS)
INCLUDE(InstallRequiredSystemLibraries)
include(InstallRequiredSystemLibraries)
## NOTE THERE SHOULD BE NO PROJECT STATEMENT HERE!
## This file acts as a simple switch to initiate
## two completely independant CMake build environments.
Expand Down
16 changes: 8 additions & 8 deletions Common.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -25,14 +25,14 @@ set(ANTS_BUILD_SHARED_LIBS ${BUILD_SHARED_LIBS})

######################################################################################################
# BA - add this stuff to help installation of ANTsR
# SET(CMAKE_SKIP_BUILD_RPATH FALSE)
# SET(CMAKE_BUILD_WITH_INSTALL_RPATH FALSE)
# SET(CMAKE_INSTALL_RPATH "${CMAKE_INSTALL_PREFIX}/lib")
# SET(CMAKE_INSTALL_RPATH_USE_LINK_PATH TRUE)
# LIST(FIND CMAKE_PLATFORM_IMPLICIT_LINK_DIRECTORIES "${CMAKE_INSTALL_PREFIX}/lib" isSystemDir)
# IF("${isSystemDir}" STREQUAL "-1")
# SET(CMAKE_INSTALL_RPATH "${CMAKE_INSTALL_PREFIX}/lib")
# ENDIF("${isSystemDir}" STREQUAL "-1")
# set(CMAKE_SKIP_BUILD_RPATH FALSE)
# set(CMAKE_BUILD_WITH_INSTALL_RPATH FALSE)
# set(CMAKE_INSTALL_RPATH "${CMAKE_INSTALL_PREFIX}/lib")
# set(CMAKE_INSTALL_RPATH_USE_LINK_PATH TRUE)
# list(FIND CMAKE_PLATFORM_IMPLICIT_LINK_DIRECTORIES "${CMAKE_INSTALL_PREFIX}/lib" isSystemDir)
# if("${isSystemDir}" STREQUAL "-1")
# set(CMAKE_INSTALL_RPATH "${CMAKE_INSTALL_PREFIX}/lib")
# endif("${isSystemDir}" STREQUAL "-1")
#####################################################################################################

set(USE_ITKv4 ON)
Expand Down
20 changes: 10 additions & 10 deletions Examples/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ macro(STANDARD_ANTS_BUILD ANTS_FUNCTION_NAME EXTRA_LIBS)
set( ANTS_FUNCTION_NAME ${ANTS_FUNCTION_NAME} )

add_library(l_${ANTS_FUNCTION_NAME} ${ANTS_FUNCTION_NAME}.cxx)
SET_TARGET_PROPERTIES(l_${ANTS_FUNCTION_NAME} PROPERTIES
set_target_properties(l_${ANTS_FUNCTION_NAME} PROPERTIES
SOVERSION ${LIBRARY_SOVERSION_INFO} VERSION ${LIBRARY_VERSION_INFO})
message(STATUS "${ANTS_FUNCTION_NAME} ${EXTRA_LIBS}")
target_link_libraries(l_${ANTS_FUNCTION_NAME} antsUtilities ${EXTRA_LIBS} )
Expand Down Expand Up @@ -160,13 +160,13 @@ if (BUILD_ALL_ANTS_APPS)
foreach(ANTS_APP ${MORE_ANTS_APPS})
STANDARD_ANTS_BUILD(${ANTS_APP} "")
endforeach()
else(BUILD_ALL_ANTS_APPS)
else()
foreach(ANTS_APP ${MORE_ANTS_APPS})
if(ANTS_BUILD_${ANTS_APP})
STANDARD_ANTS_BUILD(${ANTS_APP} "")
endif()
endforeach()
endif(BUILD_ALL_ANTS_APPS)
endif()


if(USE_VTK)
Expand All @@ -185,7 +185,7 @@ set(VTK_ANTS_APPS
foreach(ANTS_APP ${VTK_ANTS_APPS})
STANDARD_ANTS_BUILD(${ANTS_APP} "${VTK_LIBRARIES}")
endforeach()
endif(USE_VTK)
endif()

install(PROGRAMS ../Scripts/ANTSpexec.sh
../Scripts/antsASLProcessing.sh
Expand Down Expand Up @@ -220,18 +220,18 @@ if( COPY_SCRIPT_FILES_TO_BIN_DIR )
file( GLOB PSCRIPT_FILES "../Scripts/*.pl" )
foreach( SCRIPT_FILE ${SCRIPT_FILES} )
message( " Copying ${SCRIPT_FILE} to ${CMAKE_CURRENT_BINARY_DIR}/../../bin/" )
CONFIGURE_FILE( ${SCRIPT_FILE} ${CMAKE_CURRENT_BINARY_DIR}/../../bin/ COPYONLY )
endforeach( SCRIPT_FILE )
configure_file( ${SCRIPT_FILE} ${CMAKE_CURRENT_BINARY_DIR}/../../bin/ COPYONLY )
endforeach()
foreach( SCRIPT_FILE ${PSCRIPT_FILES} )
message( " Copying ${SCRIPT_FILE} to ${CMAKE_CURRENT_BINARY_DIR}/../../bin/" )
CONFIGURE_FILE( ${SCRIPT_FILE} ${CMAKE_CURRENT_BINARY_DIR}/../../bin/ COPYONLY )
endforeach( SCRIPT_FILE )
endif( COPY_SCRIPT_FILES_TO_BIN_DIR )
configure_file( ${SCRIPT_FILE} ${CMAKE_CURRENT_BINARY_DIR}/../../bin/ COPYONLY )
endforeach()
endif()

## Build test option
if(BUILD_TESTING)
add_subdirectory(TestSuite)
endif(BUILD_TESTING)
endif()

set(CPACK_PACKAGE_NAME "ANTs")
set(CPACK_PACKAGE_VENDOR "CMake.org")
Expand Down
8 changes: 4 additions & 4 deletions Examples/TestSuite/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ macro(MakeTestDriverFromANTSbinary ANTSbinaryName ANTSbinaryTestSourceName ANTS_
LIBRARY_OUTPUT_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}"
ARCHIVE_OUTPUT_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}"
)
endmacro(MakeTestDriverFromANTSbinary ANTSbinaryName)
endmacro()

#-----------------------------------------------------------------------
# Setup locations to find externally maintained test data.
Expand Down Expand Up @@ -949,7 +949,7 @@ endif()

############ End of CompositeTransformUtil tests#################

endif(RUN_LONG_TESTS)
endif()

##############################################################
##############################################################
Expand Down Expand Up @@ -1075,11 +1075,11 @@ ExternalData_expand_arguments(${PROJECT_NAME}FetchData C_IMAGE DATA{${SMALL_DATA

include(ANTS_SYN_WITH_TIME_test.cmake)
include(APOC_OTSU_INIT_test.cmake)
endif(RUN_LONG_TESTS)
endif()

include(ANTS_PSE_MSQ_TXT_test.cmake)
include(ANTS_PSE_MSQ_VTK_test.cmake)

endif(RUN_SHORT_TESTS)
endif()

ExternalData_add_target( ${PROJECT_NAME}FetchData ) # Name of data management target
2 changes: 1 addition & 1 deletion Examples/itkantsRegistrationHelper.h
Original file line number Diff line number Diff line change
Expand Up @@ -792,7 +792,7 @@ class RegistrationHelper : public itk::Object

protected:
RegistrationHelper();
virtual ~RegistrationHelper();
virtual ~RegistrationHelper() ITK_OVERRIDE;
private:

typename itk::ImageBase<VImageDimension>::Pointer GetShrinkImageOutputInformation(const itk::ImageBase<VImageDimension> * inputImageInformation,
Expand Down
10 changes: 5 additions & 5 deletions ImageRegistration/itkANTSAffine3DTransform.h
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ class ANTSAffine3DTransform :
itkGetConstReferenceMacro( K3, TScalarType );

/** Set the parameters to the IdentityTransform */
virtual void SetIdentity() ITK_OVERRIDE;
void SetIdentity() ITK_OVERRIDE;

/** Set the transformation from a container of parameters.
* This is typically used by optimizers.
Expand All @@ -126,20 +126,20 @@ class ANTSAffine3DTransform :
* Get local Jacobian for the given point
* \c j will sized properly as needed.
*/
virtual void ComputeJacobianWithRespectToParameters(const InputPointType & p, JacobianType & j) const ITK_OVERRIDE;
void ComputeJacobianWithRespectToParameters(const InputPointType & p, JacobianType & j) const ITK_OVERRIDE;

protected:
/* ANTSAffine3DTransform(const MatrixType &matrix, */
/* const OutputVectorType &offset); */
ANTSAffine3DTransform(unsigned int outputDims, unsigned int paramDims);
ANTSAffine3DTransform();
~ANTSAffine3DTransform()
virtual ~ANTSAffine3DTransform() ITK_OVERRIDE
{
};

virtual void ComputeMatrix() ITK_OVERRIDE;
void ComputeMatrix() ITK_OVERRIDE;

virtual void ComputeMatrixParameters() ITK_OVERRIDE;
void ComputeMatrixParameters() ITK_OVERRIDE;

void SetVarRotation(const VnlQuaternionType & rotation)
{
Expand Down
10 changes: 5 additions & 5 deletions ImageRegistration/itkANTSCenteredAffine2DTransform.h
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,7 @@ class ANTSCenteredAffine2DTransform :
* Get local Jacobian for the given point
* \c j will sized properly as needed.
*/
virtual void ComputeJacobianWithRespectToParameters(const InputPointType & p, JacobianType & j) const ITK_OVERRIDE;
void ComputeJacobianWithRespectToParameters(const InputPointType & p, JacobianType & j) const ITK_OVERRIDE;

/**
* This method creates and returns a new ANTSCenteredAffine2DTransform object
Expand All @@ -189,7 +189,7 @@ class ANTSCenteredAffine2DTransform :
void CloneTo( Pointer & clone ) const;

/** Reset the parameters to create and identity transform. */
virtual void SetIdentity() ITK_OVERRIDE;
void SetIdentity() ITK_OVERRIDE;

protected:
// Rigid2DTransform();
Expand All @@ -200,7 +200,7 @@ class ANTSCenteredAffine2DTransform :
ANTSCenteredAffine2DTransform( unsigned int outputSpaceDimension, unsigned int parametersDimension);

// ~Rigid2DTransform();
~ANTSCenteredAffine2DTransform();
virtual ~ANTSCenteredAffine2DTransform() ITK_OVERRIDE;

/**
* Print contents of an ANTSCenteredAffine2DTransform
Expand All @@ -210,13 +210,13 @@ class ANTSCenteredAffine2DTransform :
/** Compute the matrix from angle. This is used in Set methods
* to update the underlying matrix whenever a transform parameter
* is changed. */
virtual void ComputeMatrix() ITK_OVERRIDE;
void ComputeMatrix() ITK_OVERRIDE;

/** Compute the angle from the matrix. This is used to compute
* transform parameters from a given matrix. This is used in
* MatrixOffsetTransformBase::Compose() and
* MatrixOffsetTransformBase::GetInverse(). */
virtual void ComputeMatrixParameters() ITK_OVERRIDE;
void ComputeMatrixParameters() ITK_OVERRIDE;

/** Update angle without recomputation of other internal variables. */
void SetVarAngle( TScalarType angle )
Expand Down
2 changes: 1 addition & 1 deletion ImageRegistration/itkANTSImageRegistrationOptimizer.h
Original file line number Diff line number Diff line change
Expand Up @@ -2091,7 +2091,7 @@ class ANTSImageRegistrationOptimizer
}

ANTSImageRegistrationOptimizer();
virtual ~ANTSImageRegistrationOptimizer()
virtual ~ANTSImageRegistrationOptimizer() ITK_OVERRIDE
{
}

Expand Down
2 changes: 1 addition & 1 deletion ImageRegistration/itkANTSImageTransformation.h
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,7 @@ class ANTSImageTransformation
itkBooleanMacro( WriteComponentImages );
protected:
ANTSImageTransformation();
virtual ~ANTSImageTransformation()
virtual ~ANTSImageTransformation() ITK_OVERRIDE
{
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -194,14 +194,14 @@ class AvantsMutualInformationRegistrationFunction :
}

/** This class uses a constant timestep of 1. */
virtual TimeStepType ComputeGlobalTimeStep(void *itkNotUsed(GlobalData) ) const ITK_OVERRIDE
TimeStepType ComputeGlobalTimeStep(void *itkNotUsed(GlobalData) ) const ITK_OVERRIDE
{
return 1;
}

/** Return a pointer to a global data structure that is passed to
* this object from the solver at each calculation. */
virtual void * GetGlobalDataPointer() const ITK_OVERRIDE
void * GetGlobalDataPointer() const ITK_OVERRIDE
{
GlobalDataStruct *global = new GlobalDataStruct();

Expand All @@ -212,13 +212,13 @@ class AvantsMutualInformationRegistrationFunction :
}

/** Release memory for global data structure. */
virtual void ReleaseGlobalDataPointer( void *GlobalData ) const ITK_OVERRIDE
void ReleaseGlobalDataPointer( void *GlobalData ) const ITK_OVERRIDE
{
delete (GlobalDataStruct *) GlobalData;
}

/** Set the object's state before each iteration. */
virtual void InitializeIteration() ITK_OVERRIDE;
void InitializeIteration() ITK_OVERRIDE;

typedef double CoordinateRepresentationType;

Expand Down Expand Up @@ -494,7 +494,7 @@ class AvantsMutualInformationRegistrationFunction :
return this->m_Energy;
}

virtual VectorType ComputeUpdateInv(const NeighborhoodType & neighborhood,
VectorType ComputeUpdateInv(const NeighborhoodType & neighborhood,
void * /* globalData */,
const FloatOffsetType & /* offset */ = FloatOffsetType(0.0) ) ITK_OVERRIDE
{
Expand Down Expand Up @@ -584,7 +584,7 @@ class AvantsMutualInformationRegistrationFunction :
return (double) this->m_Padding + windowTerm * (float)(this->m_NumberOfHistogramBins - this->m_Padding);
}

virtual VectorType ComputeUpdate(const NeighborhoodType & neighborhood,
VectorType ComputeUpdate(const NeighborhoodType & neighborhood,
void * /* globalData */,
const FloatOffsetType & /* offset */ = FloatOffsetType(0.0) ) ITK_OVERRIDE
{
Expand Down Expand Up @@ -688,7 +688,7 @@ class AvantsMutualInformationRegistrationFunction :
protected:

AvantsMutualInformationRegistrationFunction();
virtual ~AvantsMutualInformationRegistrationFunction()
virtual ~AvantsMutualInformationRegistrationFunction() ITK_OVERRIDE
{
};
void PrintSelf(std::ostream& os, Indent indent) const ITK_OVERRIDE;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -224,7 +224,7 @@ class AvantsPDEDeformableRegistrationFunction :
return update * this->m_GradientStep;
}

virtual VectorType ComputeUpdate(const NeighborhoodType & neighborhood,
VectorType ComputeUpdate(const NeighborhoodType & neighborhood,
void * /* globalData */,
const FloatOffsetType & /* offset */ = FloatOffsetType(0.0) ) ITK_OVERRIDE
{
Expand Down Expand Up @@ -318,7 +318,7 @@ class AvantsPDEDeformableRegistrationFunction :
this->m_RobustnessParameter = -1.e12;
}

~AvantsPDEDeformableRegistrationFunction()
virtual ~AvantsPDEDeformableRegistrationFunction() ITK_OVERRIDE
{
}

Expand Down
Loading

0 comments on commit 30eabeb

Please sign in to comment.