INCLUDE(${CMAKE_SOURCE_DIR}/PCMIJMacros.txt) PROJECT(PCM) ENABLE_TESTING() INCLUDE(Dart) FIND_PROGRAM(IMAGE_COMPARE ImageCompare) SET(Required_Packages ITK3.2.0 ) FOREACH(Package ${Required_Packages}) LOADPACKAGE(${Package}) ENDFOREACH(Package) # we must be sure we have the right ITK version; PCM can't build with # an old version of ITK because some classes will not be there. # newer version should only cause some warnings SET(ITK_REQUIRED_VERSION "3.2.0") SET(ITK_VERSION "${ITK_VERSION_MAJOR}.${ITK_VERSION_MINOR}.${ITK_VERSION_PATCH}") IF("${ITK_VERSION}" STRLESS "${ITK_REQUIRED_VERSION}") MESSAGE(FATAL_ERROR "ITK ${ITK_REQUIRED_VERSION} is required to build this version of PCM, and you are trying to use version ${ITK_VERSION}. Set ITK_DIR to point to the directory of ITK ${ITK_REQUIRED_VERSION}.") ENDIF("${ITK_VERSION}" STRLESS "${ITK_REQUIRED_VERSION}") SET(Libraries ITKCommon ITKBasicFilters ITKIO ITKAlgorithms ) #build example executable SET(CurrentExe "PhaseCorrelationImageRegistrationMethodExample") ADD_EXECUTABLE(${CurrentExe} PhaseCorrelationImageRegistrationMethodExample.cxx itkPhaseCorrelationImageRegistrationMethod.h itkPhaseCorrelationImageRegistrationMethod.txx itkPhaseCorrelationOperator.h itkPhaseCorrelationOperator.txx itkPhaseCorrelationOptimizer.h itkPhaseCorrelationOptimizer.txx itkMaxPhaseCorrelationOptimizer.h itkMaxPhaseCorrelationOptimizer.txx ) TARGET_LINK_LIBRARIES(${CurrentExe} ${Libraries}) #build test driver executable SET(CurrentExe "itkPhaseCorrelationTests") ADD_EXECUTABLE(${CurrentExe} itkPhaseCorrelationTests.cxx itkPhaseCorrelationImageRegistrationMethodImageSource.h itkPhaseCorrelationImageRegistrationMethodTest_1.h itkPhaseCorrelationImageRegistrationMethodTest_1.cxx itkPhaseCorrelationImageRegistrationMethod.h itkPhaseCorrelationImageRegistrationMethod.txx itkPhaseCorrelationOperator.h itkPhaseCorrelationOperator.txx itkPhaseCorrelationOptimizer.h itkPhaseCorrelationOptimizer.txx itkMaxPhaseCorrelationOptimizer.h itkMaxPhaseCorrelationOptimizer.txx ) TARGET_LINK_LIBRARIES(${CurrentExe} ${Libraries}) #add tests - PCM tests for different types of simulated data ADD_TEST(PCM_PrintTest itkPhaseCorrelationTests itkPhaseCorrelationImageRegistrationMethodPrintTest) ADD_TEST(PCM_Test_2cc itkPhaseCorrelationTests itkPhaseCorrelationImageRegistrationMethodTest_2cc) ADD_TEST(PCM_Test_2ff itkPhaseCorrelationTests itkPhaseCorrelationImageRegistrationMethodTest_2ff) ADD_TEST(PCM_Test_2dd itkPhaseCorrelationTests itkPhaseCorrelationImageRegistrationMethodTest_2dd) ADD_TEST(PCM_Test_2cf itkPhaseCorrelationTests itkPhaseCorrelationImageRegistrationMethodTest_2cf) ADD_TEST(PCM_Test_2fd itkPhaseCorrelationTests itkPhaseCorrelationImageRegistrationMethodTest_2fd) ADD_TEST(PCM_Test_3cc itkPhaseCorrelationTests itkPhaseCorrelationImageRegistrationMethodTest_3cc) ADD_TEST(PCM_Test_3ff itkPhaseCorrelationTests itkPhaseCorrelationImageRegistrationMethodTest_3ff) ADD_TEST(PCM_Test_3dd itkPhaseCorrelationTests itkPhaseCorrelationImageRegistrationMethodTest_3dd) ADD_TEST(PCM_Test_3cf itkPhaseCorrelationTests itkPhaseCorrelationImageRegistrationMethodTest_3cf) ADD_TEST(PCM_Test_3fd itkPhaseCorrelationTests itkPhaseCorrelationImageRegistrationMethodTest_3fd) #add tests - PCM example for test on real image pair ADD_TEST(PCM_Example PhaseCorrelationImageRegistrationMethodExample ${CMAKE_SOURCE_DIR}/BrainProtonDensitySliceBorder20.png ${CMAKE_SOURCE_DIR}/BrainProtonDensitySliceShifted13x17y.png ${CMAKE_SOURCE_DIR}/BrainProtonDensitySliceShifted13x17y.registered.png ) ADD_TEST(PCM_Example_Compare ${IMAGE_COMPARE} ${CMAKE_SOURCE_DIR}/BrainProtonDensitySliceBorder20.png ${CMAKE_SOURCE_DIR}/BrainProtonDensitySliceShifted13x17y.registered.png)