From 22a225c21f866089812996cae207b3aead593fcc Mon Sep 17 00:00:00 2001 From: Hans Johnson Date: Fri, 19 Aug 2022 09:13:32 -0500 Subject: [PATCH] COMP: Updating to find_package(Python3) Now that cmake FindPython3 can be universally used, prefer to only use that set of variable names for identifying the python executables. Intial procesing with manual cleanup by: ITK/Utilities/Maintenance/FindPython3_ModernizeCMake.sh Finding the correct python version should always respect the Python3_ROOT_DIR variable provided during building. --- CMake/FindNumPy.cmake | 11 +- CMake/FindPythonInterp.cmake | 120 ------------------ CMake/FindSphinx.cmake | 6 +- CMake/ITKDoxygenTAG.cmake | 4 +- CMakeLists.txt | 80 +++--------- Superbuild/External-Python.cmake | 13 +- Superbuild/External-VTK.cmake | 8 +- Superbuild/Superbuild.cmake | 4 +- .../CMakeLists.txt | 4 +- .../CMakeLists.txt | 2 +- src/CMakeLists.txt | 13 +- .../Common/AddOffsetToIndex/CMakeLists.txt | 2 +- .../CMakeLists.txt | 2 +- .../BoundingBoxOfAPointSet/CMakeLists.txt | 2 +- .../BuildAHelloWorldProgram/CMakeLists.txt | 2 +- .../ComputeTimeBetweenPoints/CMakeLists.txt | 2 +- .../CreateACovariantVector/CMakeLists.txt | 2 +- .../Common/CreateAFixedArray/CMakeLists.txt | 2 +- src/Core/Common/CreateAIndex/CMakeLists.txt | 2 +- .../Common/CreateAPointSet/CMakeLists.txt | 2 +- src/Core/Common/CreateASize/CMakeLists.txt | 2 +- src/Core/Common/CreateAVector/CMakeLists.txt | 2 +- src/Core/Common/CreateAnImage/CMakeLists.txt | 4 +- .../CreateAnImageOfVectors/CMakeLists.txt | 4 +- .../Common/CreateAnImageRegion/CMakeLists.txt | 2 +- .../Common/CreateAnRGBImage/CMakeLists.txt | 2 +- .../CreateDerivativeKernel/CMakeLists.txt | 2 +- .../CMakeLists.txt | 2 +- .../CMakeLists.txt | 2 +- .../CreateGaussianKernel/CMakeLists.txt | 2 +- .../CreateLaplacianKernel/CMakeLists.txt | 2 +- .../Common/CreateSobelKernel/CMakeLists.txt | 2 +- .../Common/DuplicateAnImage/CMakeLists.txt | 2 +- .../EagerModuleLoadingPython/CMakeLists.txt | 2 +- src/Core/Common/GetImageSize/CMakeLists.txt | 2 +- .../GetTypeBasicInformation/CMakeLists.txt | 2 +- .../Common/IsPixelInsideRegion/CMakeLists.txt | 2 +- src/Core/Common/ObserveAnEvent/CMakeLists.txt | 2 +- .../PrintModuleLoadingPython/CMakeLists.txt | 2 +- .../ReadWriteVectorImage/CMakeLists.txt | 4 +- .../SetDefaultNumberOfThreads/CMakeLists.txt | 4 +- .../SetPixelValueInOneImage/CMakeLists.txt | 2 +- .../Common/StreamAPipeline/CMakeLists.txt | 2 +- .../Common/VectorDotProduct/CMakeLists.txt | 2 +- .../ResampleSegmentedImage/CMakeLists.txt | 2 +- .../Mesh/AccessDataInCells/CMakeLists.txt | 2 +- .../Transform/ScaleAnImage/CMakeLists.txt | 2 +- .../CMakeLists.txt | 2 +- .../ComputeCurvatureFlow/CMakeLists.txt | 2 +- .../CMakeLists.txt | 2 +- .../CMakeLists.txt | 2 +- .../CMakeLists.txt | 2 +- .../DilateABinaryImage/CMakeLists.txt | 2 +- .../ErodeABinaryImage/CMakeLists.txt | 2 +- .../ThinImage/CMakeLists.txt | 2 +- .../ApplyAColormapToAnImage/CMakeLists.txt | 2 +- .../CreateACustomColormap/CMakeLists.txt | 2 +- .../ComputeInverseFFTOfImage/CMakeLists.txt | 2 +- .../CMakeLists.txt | 2 +- .../CMakeLists.txt | 4 +- .../ComputeLaplacian/CMakeLists.txt | 2 +- .../CMakeLists.txt | 2 +- .../CMakeLists.txt | 2 +- .../SegmentBloodVessels/CMakeLists.txt | 2 +- .../CMakeLists.txt | 2 +- .../ApplyKernelToEveryPixel/CMakeLists.txt | 2 +- .../CastAnImageToAnotherType/CMakeLists.txt | 2 +- .../CMakeLists.txt | 2 +- .../CMakeLists.txt | 2 +- .../CMakeLists.txt | 2 +- .../CMakeLists.txt | 2 +- .../ImageGrid/Create3DVolume/CMakeLists.txt | 2 +- .../CMakeLists.txt | 2 +- .../ProcessA2DSliceOfA3DImage/CMakeLists.txt | 4 +- .../ResampleAScalarImage/CMakeLists.txt | 2 +- .../ResampleAVectorImage/CMakeLists.txt | 2 +- .../ImageGrid/ResampleAnImage/CMakeLists.txt | 2 +- .../CMakeLists.txt | 4 +- .../CMakeLists.txt | 2 +- .../ComputeSigmoid/CMakeLists.txt | 2 +- .../CMakeLists.txt | 4 +- .../RescaleIntensity/CMakeLists.txt | 2 +- .../CMakeLists.txt | 12 +- .../CalculateImageMoments/CMakeLists.txt | 4 +- .../CMakeLists.txt | 2 +- .../DilateAGrayscaleImage/CMakeLists.txt | 2 +- .../ErodeAGrayscaleImage/CMakeLists.txt | 2 +- .../CMakeLists.txt | 4 +- .../CMakeLists.txt | 2 +- .../MeanFilteringOfAnImage/CMakeLists.txt | 2 +- .../MedianFilteringOfAnImage/CMakeLists.txt | 2 +- .../ThresholdAnImage/CMakeLists.txt | 2 +- .../CMakeLists.txt | 2 +- .../ThresholdAnImageUsingOtsu/CMakeLists.txt | 2 +- .../GDCM/ReadAndPrintDICOMTags/CMakeLists.txt | 4 +- .../CMakeLists.txt | 2 +- .../CreateAListOfFileNames/CMakeLists.txt | 2 +- .../GenerateSlicesFromVolume/CMakeLists.txt | 2 +- .../ProcessImageChunks/CMakeLists.txt | 2 +- src/IO/ImageBase/ReadAnImage/CMakeLists.txt | 2 +- src/IO/ImageBase/WriteAnImage/CMakeLists.txt | 2 +- .../CMakeLists.txt | 2 +- .../ExhaustiveOptimizer/CMakeLists.txt | 2 +- .../CMakeLists.txt | 4 +- .../CMakeLists.txt | 2 +- .../CMakeLists.txt | 2 +- .../CMakeLists.txt | 2 +- .../CMakeLists.txt | 2 +- .../RegisterTwoPointSets/CMakeLists.txt | 4 +- .../CMakeLists.txt | 8 +- .../CMakeLists.txt | 10 +- 111 files changed, 172 insertions(+), 343 deletions(-) delete mode 100644 CMake/FindPythonInterp.cmake diff --git a/CMake/FindNumPy.cmake b/CMake/FindNumPy.cmake index c911d7909..1fa7e9edc 100644 --- a/CMake/FindNumPy.cmake +++ b/CMake/FindNumPy.cmake @@ -17,11 +17,10 @@ # all listed variables are TRUE if(NOT NUMPY_FOUND) - find_package(PythonInterp) - find_package(PythonLibs) + find_package(Python3 COMPONENTS Interpreter Development) - if(PYTHON_EXECUTABLE) - execute_process(COMMAND "${PYTHON_EXECUTABLE}" + if(Python3_EXECUTABLE) + execute_process(COMMAND "${Python3_EXECUTABLE}" -c "import numpy; print(numpy.get_include())" OUTPUT_VARIABLE _numpy_include_dir OUTPUT_STRIP_TRAILING_WHITESPACE @@ -30,9 +29,11 @@ if(NOT NUMPY_FOUND) endif() endif() +set(_numpy_search_paths ${Python3_INCLUDE_DIRS}) +list(prepend _numpy_search_paths "${_numpy_include_dir}") find_path(NUMPY_INCLUDE_DIR numpy/arrayobject.h - PATHS "${_numpy_include_dir}" "${PYTHON_INCLUDE_DIR}" + PATHS ${_numpy_search_paths} PATH_SUFFIXES numpy/core/include ) diff --git a/CMake/FindPythonInterp.cmake b/CMake/FindPythonInterp.cmake deleted file mode 100644 index 38f7b71ee..000000000 --- a/CMake/FindPythonInterp.cmake +++ /dev/null @@ -1,120 +0,0 @@ -# - Find python interpreter -# This module finds if Python interpreter is installed and determines where the -# executables are. This code sets the following variables: -# -# PYTHONINTERP_FOUND - Was the Python executable found -# PYTHON_EXECUTABLE - path to the Python interpreter -# -# PYTHON_VERSION_STRING - Python version found e.g. 2.5.2 -# PYTHON_VERSION_MAJOR - Python major version found e.g. 2 -# PYTHON_VERSION_MINOR - Python minor version found e.g. 5 -# PYTHON_VERSION_PATCH - Python patch version found e.g. 2 -# -# Python_ADDITIONAL_VERSIONS - list of additional Python versions to search for - -#============================================================================= -# Copyright 2005-2010 Kitware, Inc. -# Copyright 2011 Bjoern Ricks -# -# Distributed under the OSI-approved BSD License (the "License"); -# see accompanying file Copyright.txt for details. -# -# This software is distributed WITHOUT ANY WARRANTY; without even the -# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. -# See the License for more information. -#============================================================================= -# (To distribute this file outside of CMake, substitute the full -# License text for the above reference.) - -unset(_Python_NAMES) - -set(_PYTHON1_VERSIONS 1.6 1.5) -set(_PYTHON2_VERSIONS 2.7 2.6 2.5 2.4 2.3 2.2 2.1 2.0) -set(_PYTHON3_VERSIONS 3.3 3.2 3.1 3.0) - -if(PythonInterp_FIND_VERSION) - if(PythonInterp_FIND_VERSION MATCHES "^[0-9]+\\.[0-9]+(\\.[0-9]+.*)?$") - string(REGEX REPLACE "^([0-9]+\\.[0-9]+).*" "\\1" _PYTHON_FIND_MAJ_MIN "${PythonInterp_FIND_VERSION}") - string(REGEX REPLACE "^([0-9]+).*" "\\1" _PYTHON_FIND_MAJ "${_PYTHON_FIND_MAJ_MIN}") - list(APPEND _Python_NAMES python${_PYTHON_FIND_MAJ_MIN} python${_PYTHON_FIND_MAJ}) - unset(_PYTHON_FIND_OTHER_VERSIONS) - if(NOT PythonInterp_FIND_VERSION_EXACT) - foreach(_PYTHON_V ${_PYTHON${_PYTHON_FIND_MAJ}_VERSIONS}) - if(NOT _PYTHON_V VERSION_LESS _PYTHON_FIND_MAJ_MIN) - list(APPEND _PYTHON_FIND_OTHER_VERSIONS ${_PYTHON_V}) - endif() - endforeach() - endif() - unset(_PYTHON_FIND_MAJ_MIN) - unset(_PYTHON_FIND_MAJ) - else() - list(APPEND _Python_NAMES python${PythonInterp_FIND_VERSION}) - set(_PYTHON_FIND_OTHER_VERSIONS ${_PYTHON${PythonInterp_FIND_VERSION}_VERSIONS}) - endif() -else() - set(_PYTHON_FIND_OTHER_VERSIONS ${_PYTHON3_VERSIONS} ${_PYTHON2_VERSIONS} ${_PYTHON1_VERSIONS}) -endif() - -list(APPEND _Python_NAMES python) - -# Search for the current active python version first -find_program(PYTHON_EXECUTABLE NAMES ${_Python_NAMES}) - -# Set up the versions we know about, in the order we will search. Always add -# the user supplied additional versions to the front. -set(_Python_VERSIONS - ${Python_ADDITIONAL_VERSIONS} - ${_PYTHON_FIND_OTHER_VERSIONS} - ) - -unset(_PYTHON_FIND_OTHER_VERSIONS) -unset(_PYTHON1_VERSIONS) -unset(_PYTHON2_VERSIONS) -unset(_PYTHON3_VERSIONS) - -# Search for newest python version if python executable isn't found -if(NOT PYTHON_EXECUTABLE) - foreach(_CURRENT_VERSION ${_Python_VERSIONS}) - set(_Python_NAMES python${_CURRENT_VERSION}) - if(WIN32) - list(APPEND _Python_NAMES python) - endif() - find_program(PYTHON_EXECUTABLE - NAMES ${_Python_NAMES} - PATHS [HKEY_LOCAL_MACHINE\\SOFTWARE\\Python\\PythonCore\\${_CURRENT_VERSION}\\InstallPath] - ) - endforeach() -endif() - -# determine python version string -if(PYTHON_EXECUTABLE) - execute_process(COMMAND "${PYTHON_EXECUTABLE}" --version - ERROR_VARIABLE _VERSION - RESULT_VARIABLE _PYTHON_VERSION_RESULT - OUTPUT_QUIET - ERROR_STRIP_TRAILING_WHITESPACE) - if(_PYTHON_VERSION_RESULT) - execute_process(COMMAND "${PYTHON_EXECUTABLE}" -V - ERROR_VARIABLE _VERSION - RESULT_VARIABLE _PYTHON_VERSION_RESULT - OUTPUT_QUIET - ERROR_STRIP_TRAILING_WHITESPACE) - endif() - if(NOT _PYTHON_VERSION_RESULT AND _VERSION MATCHES "^Python [0-9]+\\.[0-9]+.*") - string(REPLACE "Python " "" PYTHON_VERSION_STRING "${_VERSION}") - string(REGEX REPLACE "^([0-9]+)\\.[0-9]+.*" "\\1" PYTHON_VERSION_MAJOR "${PYTHON_VERSION_STRING}") - string(REGEX REPLACE "^[0-9]+\\.([0-9])+.*" "\\1" PYTHON_VERSION_MINOR "${PYTHON_VERSION_STRING}") - if(PYTHON_VERSION_STRING MATCHES "^[0-9]+\\.[0-9]+\\.[0-9]+.*") - string(REGEX REPLACE "^[0-9]+\\.[0-9]+\\.([0-9]+).*" "\\1" PYTHON_VERSION_PATCH "${PYTHON_VERSION_STRING}") - endif() - endif() - unset(_PYTHON_VERSION_RESULT) - unset(_VERSION) -endif() - -# handle the QUIETLY and REQUIRED arguments and set PYTHONINTERP_FOUND to TRUE if -# all listed variables are TRUE -include(FindPackageHandleStandardArgs) -FIND_PACKAGE_HANDLE_STANDARD_ARGS(PythonInterp REQUIRED_VARS PYTHON_EXECUTABLE VERSION_VAR PYTHON_VERSION_STRING) - -mark_as_advanced(PYTHON_EXECUTABLE) diff --git a/CMake/FindSphinx.cmake b/CMake/FindSphinx.cmake index f67d0ac90..f8633a392 100644 --- a/CMake/FindSphinx.cmake +++ b/CMake/FindSphinx.cmake @@ -6,9 +6,9 @@ # SPHINX_FOUND set(_python_paths ) -find_package(PythonInterp) -if(PYTHON_EXECUTABLE) - get_filename_component(_python_dir "${PYTHON_EXECUTABLE}" DIRECTORY) +find_package(Python3 COMPONENTS Interpreter) +if(Python3_EXECUTABLE) + get_filename_component(_python_dir "${Python3_EXECUTABLE}" DIRECTORY) list(APPEND _python_paths "${_python_dir}" "${_python_dir}/bin" diff --git a/CMake/ITKDoxygenTAG.cmake b/CMake/ITKDoxygenTAG.cmake index f94938c60..a4304c0e9 100644 --- a/CMake/ITKDoxygenTAG.cmake +++ b/CMake/ITKDoxygenTAG.cmake @@ -1,11 +1,11 @@ set( ITKDoxygenTAG_DIR ${CMAKE_BINARY_DIR}/ITKDoxygenTAG ) set( ITKDoxygenTAG_TEMP_DIR ${CMAKE_BINARY_DIR}/ITKDoxygenTAG-TEMP ) -find_package(PythonInterp REQUIRED) +find_package(Python3 COMPONENTS Interpreter REQUIRED) add_custom_command( OUTPUT ${ITKDoxygenTAG_DIR}/InsightDoxygen.tag COMMAND ${CMAKE_COMMAND} -DITKDoxygenTAG_TEMP_DIR="${ITKDoxygenTAG_TEMP_DIR}" -P ${CMAKE_CURRENT_SOURCE_DIR}/CMake/DownloadDoxygenTAG.cmake - COMMAND ${PYTHON_EXECUTABLE} "${ITKSphinxExamples_SOURCE_DIR}/Utilities/GUnzip.py" "${ITKDoxygenTAG_TEMP_DIR}/InsightDoxygen.tag.gz" + COMMAND ${Python3_EXECUTABLE} "${ITKSphinxExamples_SOURCE_DIR}/Utilities/GUnzip.py" "${ITKDoxygenTAG_TEMP_DIR}/InsightDoxygen.tag.gz" COMMAND ${CMAKE_COMMAND} -E remove_directory "${ITKDoxygenTAG_DIR}" COMMAND ${CMAKE_COMMAND} -E rename "${ITKDoxygenTAG_TEMP_DIR}" "${ITKDoxygenTAG_DIR}" diff --git a/CMakeLists.txt b/CMakeLists.txt index bad72f548..e2f16f7bb 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -138,14 +138,21 @@ foreach(link ${content_links}) endforeach() ExternalData_Add_Target(ITKSphinxExamplesData) -if(${ITK_WRAP_PYTHON}) - # Use the same Python interpreter as ITK to run the tests. - find_package(PythonInterp ${ITK_WRAP_PYTHON_VERSION} REQUIRED) - mark_as_advanced(PYTHON_EXECUTABLE) +set(PYTHON_REQUIRED_VERSION 3.7) +set(Python_ADDITIONAL_VERSIONS 3.12 3.11 3.10 3.9 3.8 3.7) +if(BUILD_TESTING OR ITK_BUILD_DOCUMENTATION OR ITK_WRAP_PYTHON) + if(ITK_WRAP_PYTHON) + # Use the same Python interpreter as ITK to run the tests. + find_package(Python3 ${ITK_WRAP_PYTHON_VERSION} EXACT COMPONENTS Interpreter REQUIRED) + mark_as_advanced(Python3_EXECUTABLE) + else() + find_package(Python3 ${PYTHON_REQUIRED_VERSION} COMPONENTS Interpreter) + endif() endif() -find_package(PythonInterp) -if(PYTHON_EXECUTABLE AND NOT ITK_WRAP_PYTHON) - execute_process(COMMAND ${PYTHON_EXECUTABLE} -c "import itk" + +if(Python3_EXECUTABLE AND NOT ITK_WRAP_PYTHON) + # See if external ITK python packages are installed for this python environment + execute_process(COMMAND ${Python3_EXECUTABLE} -c "import itk" RESULT_VARIABLE _have_itk_return_code OUTPUT_QUIET ERROR_QUIET @@ -154,62 +161,6 @@ if(PYTHON_EXECUTABLE AND NOT ITK_WRAP_PYTHON) set(ITK_WRAP_PYTHON 1) endif() endif() -if(BUILD_TESTING OR ITK_BUILD_DOCUMENTATION OR ITK_WRAP_PYTHON) - # Prefer to use more robust FindPython3 module if greater than cmake 3.12.0 - if("${CMAKE_VERSION}" VERSION_LESS_EQUAL "3.12.0") - # Use of PythonInterp and PythonLibs is deprecated since cmake version 3.12.0 - # Only use deprecated mechanisms for older versions of cmake - set(Python_ADDITIONAL_VERSIONS 3.9 3.8 3.7 3.6 3.5) - find_package(PythonInterp) - if(ITK_WRAP_PYTHON) - find_package(PythonLibs REQUIRED) - # check for version mismatch. - if(PYTHONLIBS_FOUND AND PYTHONINTERP_FOUND - AND NOT(PYTHON_VERSION_STRING VERSION_EQUAL PYTHONLIBS_VERSION_STRING)) - message(FATAL_ERROR "Python executable (\"${PYTHON_VERSION_STRING}\") and library (\"${PYTHONLIBS_VERSION_STRING}\") version mismatch.") - endif() - endif() - if(PYTHON_VERSION_STRING VERSION_LESS 3.5) - # if python version is less than 3.5, unset so that it appears that no python version is found. - # to emulate the same behavior as find(Python3 ..) from cmake 3.12.0+ - unset(PYTHON_EXECUTABLE) - unset(PYTHONINTERP_FOUND) - unset(PYTHON_VERSION_STRING) - unset(PYTHON_INCLUDE_DIRS) - else() - ## For forward compatibility with cmake 3.12.0 or greater, emulate variable names from FindPython3.cmake - set(Python3_EXECUTABLE ${PYTHON_EXECUTABLE}) - set(Python3_Interpreter_FOUND ${PYTHONINTERP_FOUND}) - set(Python3_VERSION ${PYTHON_VERSION_STRING}) - - set(Python3_Development_FOUND ${PYTHONLIBS_FOUND}) - set(Python3_INCLUDE_DIRS ${PYTHON_INCLUDE_DIRS}) - set(Python3_LIBRARIES ${PYTHON_LIBRARIES}) - endif() - else() - if(ITK_WRAP_PYTHON) - if(DEFINED Python3_EXECUTABLE) - set(_specified_Python3_EXECUTABLE ${Python3_EXECUTABLE}) - endif() - find_package(Python3 COMPONENTS Interpreter Development) - set(Python3_EXECUTABLE ${_specified_Python3_EXECUTABLE} CACHE INTERNAL - "Path to the Python interpreter" FORCE) - else() - find_package(Python3 COMPONENTS Interpreter) - endif() - if(NOT Python3_EXECUTABLE AND _Python3_EXECUTABLE) - set(Python3_EXECUTABLE ${_Python3_EXECUTABLE} CACHE INTERNAL - "Path to the Python interpreter" FORCE) - endif() - endif() - - if(ITK_WRAP_PYTHON AND Python3_VERSION VERSION_LESS 3.5) - message(FATAL_ERROR "Python versions less than 3.5 are not supported for wrapping. Python version: \"${Python3_VERSION}\".") - endif() - if(ITK_WRAP_PYTHON AND NOT Python3_INCLUDE_DIRS) - message(FATAL_ERROR "Python version ${Python3_VERSION} development environment not found for wrapping.") - endif() -endif() # Build the documentation? option(BUILD_DOCUMENTATION "Build the examples documentation." OFF) @@ -265,7 +216,6 @@ if(BUILD_DOCUMENTATION) endif() # Builds the documentation. - find_package(PythonInterp REQUIRED) find_package(Sphinx REQUIRED) find_program(PANDOC_BIN pandoc REQUIRED) @@ -288,7 +238,7 @@ if(BUILD_DOCUMENTATION) ) add_custom_command(TARGET ${sphinx_target_base_name}_html POST_BUILD - COMMAND ${PYTHON_EXECUTABLE} + COMMAND ${Python3_EXECUTABLE} ${ITKSphinxExamples_SOURCE_DIR}/Utilities/DocumentationTarball.py ${SPHINX_DESTINATION}/html ${ITKSphinxExamples_BINARY_DIR}/ITKSphinxExamples-${ITKSphinxExamples_RELEASE_VERSION}-html diff --git a/Superbuild/External-Python.cmake b/Superbuild/External-Python.cmake index e065c07d7..b93f88e07 100644 --- a/Superbuild/External-Python.cmake +++ b/Superbuild/External-Python.cmake @@ -1,12 +1,13 @@ -find_package(PythonInterp 3 REQUIRED) +set(MIN_PYTHON_VERSION 3.7) +find_package(Python3 ${MIN_PYTHON_VERSION} COMPONENTS Interpreter REQUIRED) set(_itk_venv "${CMAKE_CURRENT_BINARY_DIR}/itkpython") if(WIN32) - set(ITKPYTHON_EXECUTABLE "${_itk_venv}/python.exe" CACHE FILEPATH "Python executable with the ITK package installed" FORCE) + set(ITKPython3_EXECUTABLE "${_itk_venv}/python.exe" CACHE FILEPATH "Python executable with the ITK package installed" FORCE) set(SPHINX_EXECUTABLE "${_itk_venv}/Scripts/sphinx-build.exe" CACHE FILEPATH "Sphinx executable" FORCE) set(BLACK_EXECUTABLE "${_itk_venv}/Scripts/black.exe" CACHE FILEPATH "black executable" FORCE) else() - set(ITKPYTHON_EXECUTABLE "${_itk_venv}/bin/python" CACHE FILEPATH "Python executable with the ITK package installed" FORCE) + set(ITKPython3_EXECUTABLE "${_itk_venv}/bin/python" CACHE FILEPATH "Python executable with the ITK package installed" FORCE) set(SPHINX_EXECUTABLE "${_itk_venv}/bin/sphinx-build" CACHE FILEPATH "Sphinx executable" FORCE) set(BLACK_EXECUTABLE "${_itk_venv}/bin/black" CACHE FILEPATH "black executable" FORCE) endif() @@ -15,8 +16,8 @@ configure_file("${CMAKE_CURRENT_SOURCE_DIR}/ITKBlackConfig.cmake.in" ExternalProject_Add(ITKPython DOWNLOAD_COMMAND "" - CONFIGURE_COMMAND ${PYTHON_EXECUTABLE} -m venv "${_itk_venv}" - BUILD_COMMAND ${ITKPYTHON_EXECUTABLE} -m pip install --upgrade pip - INSTALL_COMMAND ${ITKPYTHON_EXECUTABLE} -m pip install --ignore-installed itk>=5.4rc1 sphinx==4.4.0 docutils<0.18 traitlets==5.6.0 six black nbsphinx ipywidgets sphinx-contributors ipykernel matplotlib itkwidgets[lab,notebook]>=1.0a21 pydata-sphinx-theme + CONFIGURE_COMMAND ${Python3_EXECUTABLE} -m venv "${_itk_venv}" + BUILD_COMMAND ${ITKPython3_EXECUTABLE} -m pip install --upgrade pip + INSTALL_COMMAND ${ITKPython3_EXECUTABLE} -m pip install --ignore-installed itk>=5.4rc1 sphinx==4.4.0 docutils<0.18 traitlets==5.6.0 six black nbsphinx ipywidgets sphinx-contributors ipykernel matplotlib itkwidgets[lab,notebook]>=1.0a21 pydata-sphinx-theme COMMAND ${CMAKE_COMMAND} -P ${CMAKE_CURRENT_BINARY_DIR}/ITKBlackConfig.cmake ) diff --git a/Superbuild/External-VTK.cmake b/Superbuild/External-VTK.cmake index 4e7123c78..e8acad9d6 100644 --- a/Superbuild/External-VTK.cmake +++ b/Superbuild/External-VTK.cmake @@ -5,7 +5,7 @@ if(NOT VTK_TAG) set(VTK_TAG "v9.0.1") endif() -set(PYTHON_EXECUTABLE "${ITKPYTHON_EXECUTABLE}") +set(Python3_EXECUTABLE "${ITKPython3_EXECUTABLE}") ExternalProject_Add(VTK GIT_REPOSITORY "https://gitlab.kitware.com/VTK/VTK.git" @@ -23,7 +23,11 @@ ExternalProject_Add(VTK -DModule_vtkImagingMath:BOOL=ON -DVTK_WRAP_PYTHON:BOOL=ON -DExternalData_OBJECT_STORES:STRING=${ExternalData_OBJECT_STORES} - "-DPython3_EXECUTABLE:FILEPATH=${PYTHON_EXECUTABLE}" + "-DPython3_EXECUTABLE:FILEPATH=${Python3_EXECUTABLE}" + -DVTK_USE_SYSTEM_ZLIB:BOOL=ON + "-DZLIB_ROOT:PATH=${ZLIB_ROOT}" + "-DZLIB_INCLUDE_DIR:PATH=${ZLIB_INCLUDE_DIR}" + "-DZLIB_LIBRARY:FILEPATH=${ZLIB_LIBRARY}" INSTALL_COMMAND "" LOG_DOWNLOAD 0 LOG_UPDATE 0 diff --git a/Superbuild/Superbuild.cmake b/Superbuild/Superbuild.cmake index 0cf250ba4..e2c213d56 100644 --- a/Superbuild/Superbuild.cmake +++ b/Superbuild/Superbuild.cmake @@ -46,10 +46,10 @@ if(WIN32) set(_use_python_default OFF) endif() option(ITKSphinxExamples_USE_WRAP_PYTHON "Enable downloads of the ITK Python wrapping to the superbuild" ${_use_python_default}) -if(NOT EXISTS PYTHON_EXECUTABLE AND ITKSphinxExamples_USE_WRAP_PYTHON OR ITKSphinxExamples_USE_VTK) +if(NOT EXISTS Python3_EXECUTABLE AND ITKSphinxExamples_USE_WRAP_PYTHON OR ITKSphinxExamples_USE_VTK) include(${CMAKE_SOURCE_DIR}/External-Python.cmake) list(APPEND ITKSphinxExamples_DEPENDENCIES ITKPython) - set(_python_args "-DPYTHON_EXECUTABLE:FILEPATH=${ITKPYTHON_EXECUTABLE}") + set(_python_args "-DPython3_EXECUTABLE:FILEPATH=${ITKPython3_EXECUTABLE}") endif() if(NOT VTK_DIR AND ITKSphinxExamples_USE_VTK) diff --git a/Utilities/CookieCutter/{{cookiecutter.example_name}}/CMakeLists.txt b/Utilities/CookieCutter/{{cookiecutter.example_name}}/CMakeLists.txt index 39cc3222a..304def59e 100644 --- a/Utilities/CookieCutter/{{cookiecutter.example_name}}/CMakeLists.txt +++ b/Utilities/CookieCutter/{{cookiecutter.example_name}}/CMakeLists.txt @@ -33,10 +33,10 @@ add_test(NAME {{ cookiecutter.example_name }}Test ) if(ITK_WRAP_PYTHON) - find_package(PythonInterp REQUIRED) + find_package(Python3 COMPONENTS Interpreter REQUIRED) string(REPLACE . "Python." output_image "${output_image}") add_test(NAME {{ cookiecutter.example_name }}TestPython - COMMAND ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/Code.py + COMMAND ${Python3_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/Code.py ${input_image} ${output_image} ${test_options} diff --git a/src/Bridge/NumPy/ConvertNumPyArrayToitkImage/CMakeLists.txt b/src/Bridge/NumPy/ConvertNumPyArrayToitkImage/CMakeLists.txt index 6bf5ae034..77ba4e736 100644 --- a/src/Bridge/NumPy/ConvertNumPyArrayToitkImage/CMakeLists.txt +++ b/src/Bridge/NumPy/ConvertNumPyArrayToitkImage/CMakeLists.txt @@ -11,7 +11,7 @@ set(input_image ${CMAKE_CURRENT_BINARY_DIR}/Slicer.png) if(ITK_WRAP_PYTHON) add_test(NAME ConvertNumPyArrayToitkImageTestPython - COMMAND ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/Code.py + COMMAND ${Python3_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/Code.py ${input_image} SliceRevised.png ) diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 96cd3f78d..c634efa3b 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -20,17 +20,10 @@ if(Module_ITKVtkGlue OR ITKVtkGlue_LOADED) endif() if(BUILD_DOCUMENTATION) - if(NOT PYTHON_EXECUTABLE) - find_package(PythonInterp 3.6 REQUIRED) - if(NOT PYTHONINTERP_FOUND) + if(NOT Python3_EXECUTABLE) + find_package(Python3 ${PYTHON_REQUIRED_VERSION} COMPONENTS Interpreter REQUIRED) + if(NOT Python3_Interpreter_FOUND) message(SEND_ERROR "Building the documentation requires Python") - else() - # Set here the proper version of Python required to be able to build - # tarballs for each example - set(PYTHON_REQUIRED_VERSION 3.6) - if("${PYTHON_VERSION_STRING}" VERSION_LESS ${PYTHON_REQUIRED_VERSION}) - message(SEND_ERROR "Building the documentation requires Python >= ${PYTHON_REQUIRED_VERSION}: ${PYTHON_VERSION_STRING} found at ${PYTHON_EXECUTABLE}") - endif() endif() endif() endif() diff --git a/src/Core/Common/AddOffsetToIndex/CMakeLists.txt b/src/Core/Common/AddOffsetToIndex/CMakeLists.txt index f5418f84a..320a109fe 100644 --- a/src/Core/Common/AddOffsetToIndex/CMakeLists.txt +++ b/src/Core/Common/AddOffsetToIndex/CMakeLists.txt @@ -25,6 +25,6 @@ add_test(NAME AddOffsetToIndexTest if(ITK_WRAP_PYTHON) add_test(NAME AddOffsetToIndexTestPython - COMMAND ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/Code.py + COMMAND ${Python3_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/Code.py ) endif() diff --git a/src/Core/Common/ApplyAFilterOnlyToASpecifiedRegionOfAnImage/CMakeLists.txt b/src/Core/Common/ApplyAFilterOnlyToASpecifiedRegionOfAnImage/CMakeLists.txt index dc6cda28a..b63545629 100644 --- a/src/Core/Common/ApplyAFilterOnlyToASpecifiedRegionOfAnImage/CMakeLists.txt +++ b/src/Core/Common/ApplyAFilterOnlyToASpecifiedRegionOfAnImage/CMakeLists.txt @@ -24,6 +24,6 @@ add_test(NAME ApplyAFilterOnlyToASpecifiedRegionOfAnImageTest if(ITK_WRAP_PYTHON) add_test(NAME ApplyAFilterOnlyToASpecifiedRegionOfAnImageTestPython - COMMAND ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/Code.py + COMMAND ${Python3_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/Code.py ) endif() diff --git a/src/Core/Common/BoundingBoxOfAPointSet/CMakeLists.txt b/src/Core/Common/BoundingBoxOfAPointSet/CMakeLists.txt index e4c57d892..e3ffe0246 100644 --- a/src/Core/Common/BoundingBoxOfAPointSet/CMakeLists.txt +++ b/src/Core/Common/BoundingBoxOfAPointSet/CMakeLists.txt @@ -24,6 +24,6 @@ add_test(NAME BoundingBoxOfAPointSetTest if(ITK_WRAP_PYTHON) add_test(NAME BoundingBoxOfAPointSetTestPython - COMMAND ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/Code.py + COMMAND ${Python3_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/Code.py ) endif() diff --git a/src/Core/Common/BuildAHelloWorldProgram/CMakeLists.txt b/src/Core/Common/BuildAHelloWorldProgram/CMakeLists.txt index 28eae5202..4044d33e5 100644 --- a/src/Core/Common/BuildAHelloWorldProgram/CMakeLists.txt +++ b/src/Core/Common/BuildAHelloWorldProgram/CMakeLists.txt @@ -24,6 +24,6 @@ add_test(NAME BuildAHelloWorldProgramTest if(ITK_WRAP_PYTHON) add_test(NAME BuildAHelloWorldProgramTestPython - COMMAND ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/Code.py + COMMAND ${Python3_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/Code.py ) endif() diff --git a/src/Core/Common/ComputeTimeBetweenPoints/CMakeLists.txt b/src/Core/Common/ComputeTimeBetweenPoints/CMakeLists.txt index f286720aa..e1d5e9110 100644 --- a/src/Core/Common/ComputeTimeBetweenPoints/CMakeLists.txt +++ b/src/Core/Common/ComputeTimeBetweenPoints/CMakeLists.txt @@ -24,5 +24,5 @@ add_test(NAME ComputeTimeBetweenPointsTest if(ITK_WRAP_PYTHON) add_test(NAME ComputeTimeBetweenPointsTestPython - COMMAND ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/Code.py) + COMMAND ${Python3_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/Code.py) endif() diff --git a/src/Core/Common/CreateACovariantVector/CMakeLists.txt b/src/Core/Common/CreateACovariantVector/CMakeLists.txt index 289dfedbe..cd55849fe 100644 --- a/src/Core/Common/CreateACovariantVector/CMakeLists.txt +++ b/src/Core/Common/CreateACovariantVector/CMakeLists.txt @@ -24,6 +24,6 @@ add_test(NAME CreateACovariantVectorTest if(ITK_WRAP_PYTHON) add_test(NAME CreateACovariantVectorTestPython - COMMAND ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/Code.py + COMMAND ${Python3_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/Code.py ) endif() diff --git a/src/Core/Common/CreateAFixedArray/CMakeLists.txt b/src/Core/Common/CreateAFixedArray/CMakeLists.txt index 8b38e4d8c..fdf51a251 100644 --- a/src/Core/Common/CreateAFixedArray/CMakeLists.txt +++ b/src/Core/Common/CreateAFixedArray/CMakeLists.txt @@ -24,6 +24,6 @@ add_test(NAME CreateAFixedArrayTest if(ITK_WRAP_PYTHON) add_test(NAME CreateAFixedArrayTestPython - COMMAND ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/Code.py + COMMAND ${Python3_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/Code.py ) endif() diff --git a/src/Core/Common/CreateAIndex/CMakeLists.txt b/src/Core/Common/CreateAIndex/CMakeLists.txt index bcdd7870f..77ca368ff 100644 --- a/src/Core/Common/CreateAIndex/CMakeLists.txt +++ b/src/Core/Common/CreateAIndex/CMakeLists.txt @@ -24,6 +24,6 @@ add_test(NAME CreateAIndexTest if(ITK_WRAP_PYTHON) add_test(NAME CreateAIndexTestPython - COMMAND ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/Code.py + COMMAND ${Python3_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/Code.py ) endif() diff --git a/src/Core/Common/CreateAPointSet/CMakeLists.txt b/src/Core/Common/CreateAPointSet/CMakeLists.txt index ee4bdaa0b..351e13861 100644 --- a/src/Core/Common/CreateAPointSet/CMakeLists.txt +++ b/src/Core/Common/CreateAPointSet/CMakeLists.txt @@ -25,6 +25,6 @@ add_test(NAME CreateAPointSetTest if(ITK_WRAP_PYTHON) add_test(NAME CreateAPointSetTestPython - COMMAND ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/Code.py + COMMAND ${Python3_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/Code.py ) endif() diff --git a/src/Core/Common/CreateASize/CMakeLists.txt b/src/Core/Common/CreateASize/CMakeLists.txt index 115a4088a..764d8b2c8 100644 --- a/src/Core/Common/CreateASize/CMakeLists.txt +++ b/src/Core/Common/CreateASize/CMakeLists.txt @@ -24,6 +24,6 @@ add_test(NAME CreateASizeTest if(ITK_WRAP_PYTHON) add_test(NAME CreateASizeTestPython - COMMAND ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/Code.py + COMMAND ${Python3_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/Code.py ) endif() diff --git a/src/Core/Common/CreateAVector/CMakeLists.txt b/src/Core/Common/CreateAVector/CMakeLists.txt index 9bbdd5832..011177943 100644 --- a/src/Core/Common/CreateAVector/CMakeLists.txt +++ b/src/Core/Common/CreateAVector/CMakeLists.txt @@ -24,6 +24,6 @@ add_test(NAME CreateAVectorTest if(ITK_WRAP_PYTHON) add_test(NAME CreateAVectorTestPython - COMMAND ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/Code.py + COMMAND ${Python3_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/Code.py ) endif() diff --git a/src/Core/Common/CreateAnImage/CMakeLists.txt b/src/Core/Common/CreateAnImage/CMakeLists.txt index 7d65b1a90..9ff985155 100644 --- a/src/Core/Common/CreateAnImage/CMakeLists.txt +++ b/src/Core/Common/CreateAnImage/CMakeLists.txt @@ -27,8 +27,8 @@ add_test(NAME CreateAnImageTest ) if(ITK_WRAP_PYTHON) - find_package(PythonInterp REQUIRED) + find_package(Python3 COMPONENTS Interpreter REQUIRED) add_test(NAME CreateAnImageTestPython - COMMAND ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/Code.py + COMMAND ${Python3_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/Code.py ) endif() diff --git a/src/Core/Common/CreateAnImageOfVectors/CMakeLists.txt b/src/Core/Common/CreateAnImageOfVectors/CMakeLists.txt index 5c35de9e6..1dcefe8c0 100644 --- a/src/Core/Common/CreateAnImageOfVectors/CMakeLists.txt +++ b/src/Core/Common/CreateAnImageOfVectors/CMakeLists.txt @@ -27,9 +27,9 @@ add_test(NAME CreateAnImageOfVectorsTest ) if(ITK_WRAP_PYTHON) - find_package(PythonInterp REQUIRED) + find_package(Python3 COMPONENTS Interpreter REQUIRED) string(REPLACE . "Python." output_image "${output_image}") add_test(NAME CreateAnImageOfVectorsTestPython - COMMAND ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/Code.py + COMMAND ${Python3_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/Code.py ) endif() diff --git a/src/Core/Common/CreateAnImageRegion/CMakeLists.txt b/src/Core/Common/CreateAnImageRegion/CMakeLists.txt index e2abab205..3587de57c 100644 --- a/src/Core/Common/CreateAnImageRegion/CMakeLists.txt +++ b/src/Core/Common/CreateAnImageRegion/CMakeLists.txt @@ -27,7 +27,7 @@ set_tests_properties(CreateAnImageRegionTest PROPERTIES if(ITK_WRAP_PYTHON) add_test(NAME CreateAnImageRegionTestPython - COMMAND ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/Code.py + COMMAND ${Python3_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/Code.py ) set_tests_properties(CreateAnImageRegionTestPython PROPERTIES PASS_REGULAR_EXPRESSION "${testOutputRegex}") diff --git a/src/Core/Common/CreateAnRGBImage/CMakeLists.txt b/src/Core/Common/CreateAnRGBImage/CMakeLists.txt index fb1e1f9a7..2f9fc870b 100644 --- a/src/Core/Common/CreateAnRGBImage/CMakeLists.txt +++ b/src/Core/Common/CreateAnRGBImage/CMakeLists.txt @@ -23,6 +23,6 @@ add_test(NAME CreateAnRGBImageTest if(ITK_WRAP_PYTHON) add_test(NAME CreateAnRGBImageTestPython - COMMAND ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/Code.py + COMMAND ${Python3_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/Code.py ) endif() diff --git a/src/Core/Common/CreateDerivativeKernel/CMakeLists.txt b/src/Core/Common/CreateDerivativeKernel/CMakeLists.txt index fc53d94a9..946f24423 100644 --- a/src/Core/Common/CreateDerivativeKernel/CMakeLists.txt +++ b/src/Core/Common/CreateDerivativeKernel/CMakeLists.txt @@ -26,6 +26,6 @@ add_test(NAME CreateDerivativeKernelTest if(ITK_WRAP_PYTHON) add_test(NAME CreateDerivativeKernelTestPython - COMMAND ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/Code.py + COMMAND ${Python3_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/Code.py ) endif() diff --git a/src/Core/Common/CreateForwardDifferenceKernel/CMakeLists.txt b/src/Core/Common/CreateForwardDifferenceKernel/CMakeLists.txt index fdc4ccdad..c37df2f96 100644 --- a/src/Core/Common/CreateForwardDifferenceKernel/CMakeLists.txt +++ b/src/Core/Common/CreateForwardDifferenceKernel/CMakeLists.txt @@ -26,6 +26,6 @@ add_test(NAME CreateForwardDifferenceKernelTest if(ITK_WRAP_PYTHON) add_test(NAME CreateForwardDifferenceKernelTestPython - COMMAND ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/Code.py + COMMAND ${Python3_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/Code.py ) endif() diff --git a/src/Core/Common/CreateGaussianDerivativeKernel/CMakeLists.txt b/src/Core/Common/CreateGaussianDerivativeKernel/CMakeLists.txt index 5d6735ee8..993a2002a 100644 --- a/src/Core/Common/CreateGaussianDerivativeKernel/CMakeLists.txt +++ b/src/Core/Common/CreateGaussianDerivativeKernel/CMakeLists.txt @@ -26,6 +26,6 @@ add_test(NAME CreateGaussianDerivativeKernelTest if(ITK_WRAP_PYTHON) add_test(NAME CreateGaussianDerivativeKernelTestPython - COMMAND ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/Code.py + COMMAND ${Python3_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/Code.py ) endif() diff --git a/src/Core/Common/CreateGaussianKernel/CMakeLists.txt b/src/Core/Common/CreateGaussianKernel/CMakeLists.txt index c2962bec7..6ea1770dd 100644 --- a/src/Core/Common/CreateGaussianKernel/CMakeLists.txt +++ b/src/Core/Common/CreateGaussianKernel/CMakeLists.txt @@ -26,6 +26,6 @@ add_test(NAME CreateGaussianKernelTest if(ITK_WRAP_PYTHON) add_test(NAME CreateGaussianKernelTestPython - COMMAND ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/Code.py + COMMAND ${Python3_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/Code.py ) endif() diff --git a/src/Core/Common/CreateLaplacianKernel/CMakeLists.txt b/src/Core/Common/CreateLaplacianKernel/CMakeLists.txt index 32f836054..7a2365397 100644 --- a/src/Core/Common/CreateLaplacianKernel/CMakeLists.txt +++ b/src/Core/Common/CreateLaplacianKernel/CMakeLists.txt @@ -26,6 +26,6 @@ add_test(NAME CreateLaplacianKernelTest if(ITK_WRAP_PYTHON) add_test(NAME CreateLaplacianKernelTestPython - COMMAND ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/Code.py + COMMAND ${Python3_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/Code.py ) endif() diff --git a/src/Core/Common/CreateSobelKernel/CMakeLists.txt b/src/Core/Common/CreateSobelKernel/CMakeLists.txt index 14d6f8397..b197105d3 100644 --- a/src/Core/Common/CreateSobelKernel/CMakeLists.txt +++ b/src/Core/Common/CreateSobelKernel/CMakeLists.txt @@ -26,7 +26,7 @@ add_test(NAME CreateSobelKernelTest if(ITK_WRAP_PYTHON) add_test(NAME CreateSobelKernelTestPython - COMMAND ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/Code.py + COMMAND ${Python3_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/Code.py ) endif() diff --git a/src/Core/Common/DuplicateAnImage/CMakeLists.txt b/src/Core/Common/DuplicateAnImage/CMakeLists.txt index af68257b7..532eb1c1a 100644 --- a/src/Core/Common/DuplicateAnImage/CMakeLists.txt +++ b/src/Core/Common/DuplicateAnImage/CMakeLists.txt @@ -24,6 +24,6 @@ add_test(NAME DuplicateAnImageTest if(ITK_WRAP_PYTHON) add_test(NAME DuplicateAnImageTestPython - COMMAND ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/Code.py + COMMAND ${Python3_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/Code.py ) endif() diff --git a/src/Core/Common/EagerModuleLoadingPython/CMakeLists.txt b/src/Core/Common/EagerModuleLoadingPython/CMakeLists.txt index 96ee44b33..11cc84807 100644 --- a/src/Core/Common/EagerModuleLoadingPython/CMakeLists.txt +++ b/src/Core/Common/EagerModuleLoadingPython/CMakeLists.txt @@ -13,5 +13,5 @@ install(FILES Code.py CMakeLists.txt enable_testing() if(ITK_WRAP_PYTHON) add_test(NAME EagerModuleLoadingPythonTest - COMMAND ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/Code.py) + COMMAND ${Python3_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/Code.py) endif() \ No newline at end of file diff --git a/src/Core/Common/GetImageSize/CMakeLists.txt b/src/Core/Common/GetImageSize/CMakeLists.txt index de1844740..8a5ed1772 100644 --- a/src/Core/Common/GetImageSize/CMakeLists.txt +++ b/src/Core/Common/GetImageSize/CMakeLists.txt @@ -26,7 +26,7 @@ add_test(NAME GetImageSizeTest if(ITK_WRAP_PYTHON) add_test(NAME GetImageSizeTestPython - COMMAND ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/Code.py + COMMAND ${Python3_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/Code.py ${CMAKE_CURRENT_BINARY_DIR}/Yinyang.png ) endif() diff --git a/src/Core/Common/GetTypeBasicInformation/CMakeLists.txt b/src/Core/Common/GetTypeBasicInformation/CMakeLists.txt index 8448f002c..9ce900d32 100644 --- a/src/Core/Common/GetTypeBasicInformation/CMakeLists.txt +++ b/src/Core/Common/GetTypeBasicInformation/CMakeLists.txt @@ -24,6 +24,6 @@ add_test(NAME GetTypeBasicInformationTest if(ITK_WRAP_PYTHON) add_test(NAME GetTypeBasicInformationTestPython - COMMAND ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/Code.py + COMMAND ${Python3_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/Code.py ) endif() diff --git a/src/Core/Common/IsPixelInsideRegion/CMakeLists.txt b/src/Core/Common/IsPixelInsideRegion/CMakeLists.txt index 719401bf7..72d2a3c02 100644 --- a/src/Core/Common/IsPixelInsideRegion/CMakeLists.txt +++ b/src/Core/Common/IsPixelInsideRegion/CMakeLists.txt @@ -24,6 +24,6 @@ add_test(NAME IsPixelInsideRegionTest if(ITK_WRAP_PYTHON) add_test(NAME IsPixelInsideRegionPython - COMMAND ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/Code.py + COMMAND ${Python3_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/Code.py ) endif() diff --git a/src/Core/Common/ObserveAnEvent/CMakeLists.txt b/src/Core/Common/ObserveAnEvent/CMakeLists.txt index 0b091d3dc..519e4db22 100644 --- a/src/Core/Common/ObserveAnEvent/CMakeLists.txt +++ b/src/Core/Common/ObserveAnEvent/CMakeLists.txt @@ -24,6 +24,6 @@ add_test(NAME ObserveAnEventTest if(ITK_WRAP_PYTHON) add_test(NAME ObserveAnEventTestPython - COMMAND ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/Code.py + COMMAND ${Python3_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/Code.py ) endif() diff --git a/src/Core/Common/PrintModuleLoadingPython/CMakeLists.txt b/src/Core/Common/PrintModuleLoadingPython/CMakeLists.txt index 79d0c33b7..f63c5e018 100644 --- a/src/Core/Common/PrintModuleLoadingPython/CMakeLists.txt +++ b/src/Core/Common/PrintModuleLoadingPython/CMakeLists.txt @@ -13,5 +13,5 @@ install(FILES Code.py CMakeLists.txt enable_testing() if(ITK_WRAP_PYTHON) add_test(NAME PrintModuleLoadingPythonTest - COMMAND ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/Code.py) + COMMAND ${Python3_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/Code.py) endif() \ No newline at end of file diff --git a/src/Core/Common/ReadWriteVectorImage/CMakeLists.txt b/src/Core/Common/ReadWriteVectorImage/CMakeLists.txt index 9794dd59f..7e859344b 100644 --- a/src/Core/Common/ReadWriteVectorImage/CMakeLists.txt +++ b/src/Core/Common/ReadWriteVectorImage/CMakeLists.txt @@ -31,10 +31,10 @@ add_test(NAME ReadWriteVectorImageTest ) if(ITK_WRAP_PYTHON) - find_package(PythonInterp REQUIRED) + find_package(Python3 COMPONENTS Interpreter REQUIRED) string(REPLACE . "Python." output_image "${output_image}") add_test(NAME ReadWriteVectorImageTestPython - COMMAND ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/Code.py + COMMAND ${Python3_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/Code.py ${input_image} ${output_image} ) diff --git a/src/Core/Common/SetDefaultNumberOfThreads/CMakeLists.txt b/src/Core/Common/SetDefaultNumberOfThreads/CMakeLists.txt index 3aac69e58..82951b74b 100644 --- a/src/Core/Common/SetDefaultNumberOfThreads/CMakeLists.txt +++ b/src/Core/Common/SetDefaultNumberOfThreads/CMakeLists.txt @@ -28,9 +28,9 @@ add_test(NAME SetDefaultNumberOfThreadsTest ) if(ITK_WRAP_PYTHON) - find_package(PythonInterp REQUIRED) + find_package(Python3 COMPONENTS Interpreter REQUIRED) add_test(NAME SetDefaultNumberOfThreadsTestPython - COMMAND ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/Code.py + COMMAND ${Python3_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/Code.py ${test_options} ) endif() diff --git a/src/Core/Common/SetPixelValueInOneImage/CMakeLists.txt b/src/Core/Common/SetPixelValueInOneImage/CMakeLists.txt index 9762141cb..031ddc0ef 100644 --- a/src/Core/Common/SetPixelValueInOneImage/CMakeLists.txt +++ b/src/Core/Common/SetPixelValueInOneImage/CMakeLists.txt @@ -26,7 +26,7 @@ add_test(NAME SetPixelValueInOneImageTest if(ITK_WRAP_PYTHON) add_test(NAME SetPixelValueInOneImageTestPython - COMMAND ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/Code.py + COMMAND ${Python3_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/Code.py ${CMAKE_CURRENT_BINARY_DIR}/OutputPython.png ) endif() diff --git a/src/Core/Common/StreamAPipeline/CMakeLists.txt b/src/Core/Common/StreamAPipeline/CMakeLists.txt index cfd39c1cc..ed82e993c 100644 --- a/src/Core/Common/StreamAPipeline/CMakeLists.txt +++ b/src/Core/Common/StreamAPipeline/CMakeLists.txt @@ -26,7 +26,7 @@ add_test(NAME StreamAPipelineTest if(ITK_WRAP_PYTHON) add_test(NAME StreamAPipelineTestPython - COMMAND ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/Code.py + COMMAND ${Python3_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/Code.py 3 ) endif() diff --git a/src/Core/Common/VectorDotProduct/CMakeLists.txt b/src/Core/Common/VectorDotProduct/CMakeLists.txt index 657d12ebe..d2c65cafe 100644 --- a/src/Core/Common/VectorDotProduct/CMakeLists.txt +++ b/src/Core/Common/VectorDotProduct/CMakeLists.txt @@ -24,6 +24,6 @@ add_test(NAME VectorDotProductTest if(ITK_WRAP_PYTHON) add_test(NAME VectorDotProductTestPython - COMMAND ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/Code.py + COMMAND ${Python3_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/Code.py ) endif() diff --git a/src/Core/ImageFunction/ResampleSegmentedImage/CMakeLists.txt b/src/Core/ImageFunction/ResampleSegmentedImage/CMakeLists.txt index 198f00652..53e15d016 100644 --- a/src/Core/ImageFunction/ResampleSegmentedImage/CMakeLists.txt +++ b/src/Core/ImageFunction/ResampleSegmentedImage/CMakeLists.txt @@ -30,7 +30,7 @@ add_test(NAME ResampleSegmentedImageTest if(ITK_WRAP_PYTHON) add_test(NAME ResampleSegmentedImageTestPython - COMMAND ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/Code.py + COMMAND ${Python3_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/Code.py ${CMAKE_CURRENT_BINARY_DIR}/2th_cthead1.png 0.75 0.6 diff --git a/src/Core/Mesh/AccessDataInCells/CMakeLists.txt b/src/Core/Mesh/AccessDataInCells/CMakeLists.txt index c3cad6e04..b0e8a4397 100644 --- a/src/Core/Mesh/AccessDataInCells/CMakeLists.txt +++ b/src/Core/Mesh/AccessDataInCells/CMakeLists.txt @@ -25,5 +25,5 @@ add_test(NAME AccessDataInCellsTest if(ITK_WRAP_PYTHON) add_test(NAME AccessDataInCellsTestPython - COMMAND ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/Code.py) + COMMAND ${Python3_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/Code.py) endif() diff --git a/src/Core/Transform/ScaleAnImage/CMakeLists.txt b/src/Core/Transform/ScaleAnImage/CMakeLists.txt index e9632ebb4..97f1b492c 100644 --- a/src/Core/Transform/ScaleAnImage/CMakeLists.txt +++ b/src/Core/Transform/ScaleAnImage/CMakeLists.txt @@ -30,7 +30,7 @@ add_test(NAME ScaleAnImageTest if(ITK_WRAP_PYTHON) add_test(NAME ScaleAnImageTestPython -COMMAND ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/Code.py +COMMAND ${Python3_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/Code.py ${CMAKE_CURRENT_BINARY_DIR}/ScaleAnImageInput.png ${CMAKE_CURRENT_BINARY_DIR}/ScaleAnImageOutputPython.png) endif() diff --git a/src/Filtering/AnisotropicSmoothing/ComputeCurvatureAnisotropicDiffusion/CMakeLists.txt b/src/Filtering/AnisotropicSmoothing/ComputeCurvatureAnisotropicDiffusion/CMakeLists.txt index ce4e02d8d..6c53ca962 100644 --- a/src/Filtering/AnisotropicSmoothing/ComputeCurvatureAnisotropicDiffusion/CMakeLists.txt +++ b/src/Filtering/AnisotropicSmoothing/ComputeCurvatureAnisotropicDiffusion/CMakeLists.txt @@ -33,7 +33,7 @@ add_test(NAME ComputeCurvatureAnisotropicDiffusionTest if(ITK_WRAP_PYTHON) string(REPLACE . "Python." output_image "${output_image}") add_test(NAME ComputeCurvatureAnisotropicDiffusionTestPython - COMMAND ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/Code.py + COMMAND ${Python3_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/Code.py ${input_image} ${output_image} ${test_options} diff --git a/src/Filtering/AnisotropicSmoothing/ComputeCurvatureFlow/CMakeLists.txt b/src/Filtering/AnisotropicSmoothing/ComputeCurvatureFlow/CMakeLists.txt index 31a831b7c..d5aaa714c 100644 --- a/src/Filtering/AnisotropicSmoothing/ComputeCurvatureFlow/CMakeLists.txt +++ b/src/Filtering/AnisotropicSmoothing/ComputeCurvatureFlow/CMakeLists.txt @@ -33,7 +33,7 @@ add_test(NAME ComputeCurvatureFlowTest if(ITK_WRAP_PYTHON) string(REPLACE . "Python." output_image "${output_image}") add_test(NAME ComputeCurvatureFlowTestPython - COMMAND ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/Code.py + COMMAND ${Python3_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/Code.py ${input_image} ${output_image} ${test_options} diff --git a/src/Filtering/AnisotropicSmoothing/ComputeGradientAnisotropicDiffusion/CMakeLists.txt b/src/Filtering/AnisotropicSmoothing/ComputeGradientAnisotropicDiffusion/CMakeLists.txt index 5f1a46448..6ff9cfca3 100644 --- a/src/Filtering/AnisotropicSmoothing/ComputeGradientAnisotropicDiffusion/CMakeLists.txt +++ b/src/Filtering/AnisotropicSmoothing/ComputeGradientAnisotropicDiffusion/CMakeLists.txt @@ -33,7 +33,7 @@ add_test(NAME ComputeGradientAnisotropicDiffusionTest if(ITK_WRAP_PYTHON) string(REPLACE . "Python." output_image "${output_image}") add_test(NAME ComputeGradientAnisotropicDiffusionTestPython - COMMAND ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/Code.py + COMMAND ${Python3_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/Code.py ${input_image} ${output_image} ${test_options} diff --git a/src/Filtering/AnisotropicSmoothing/ComputePeronaMalikAnisotropicDiffusion/CMakeLists.txt b/src/Filtering/AnisotropicSmoothing/ComputePeronaMalikAnisotropicDiffusion/CMakeLists.txt index c18c3c43b..c7e3f41c7 100644 --- a/src/Filtering/AnisotropicSmoothing/ComputePeronaMalikAnisotropicDiffusion/CMakeLists.txt +++ b/src/Filtering/AnisotropicSmoothing/ComputePeronaMalikAnisotropicDiffusion/CMakeLists.txt @@ -41,7 +41,7 @@ add_test(NAME ComputePeronaMalikAnisotropicDiffusionTest if(ITK_WRAP_PYTHON) string(REPLACE . "Python." output_image "${output_image}") add_test(NAME ComputePeronaMalikAnisotropicDiffusionTestPython - COMMAND ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/Code.py + COMMAND ${Python3_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/Code.py ${input_image} ${output_image} ${test_options} diff --git a/src/Filtering/AntiAlias/SmoothBinaryImageBeforeSurfaceExtraction/CMakeLists.txt b/src/Filtering/AntiAlias/SmoothBinaryImageBeforeSurfaceExtraction/CMakeLists.txt index 2e9294a90..686df579a 100644 --- a/src/Filtering/AntiAlias/SmoothBinaryImageBeforeSurfaceExtraction/CMakeLists.txt +++ b/src/Filtering/AntiAlias/SmoothBinaryImageBeforeSurfaceExtraction/CMakeLists.txt @@ -33,7 +33,7 @@ add_test(NAME SmoothBinaryImageBeforeSurfaceExtractionTest if(ITK_WRAP_PYTHON) string(REPLACE . "Python." output_image "${output_image}") add_test(NAME SmoothBinaryImageBeforeSurfaceExtractionTestPython - COMMAND ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/Code.py + COMMAND ${Python3_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/Code.py ${input_image} ${output_image} ${test_options} diff --git a/src/Filtering/BinaryMathematicalMorphology/DilateABinaryImage/CMakeLists.txt b/src/Filtering/BinaryMathematicalMorphology/DilateABinaryImage/CMakeLists.txt index 82a2104bf..355b8f0ed 100644 --- a/src/Filtering/BinaryMathematicalMorphology/DilateABinaryImage/CMakeLists.txt +++ b/src/Filtering/BinaryMathematicalMorphology/DilateABinaryImage/CMakeLists.txt @@ -43,7 +43,7 @@ add_test(NAME DilateABinaryImageTest if(ITK_WRAP_PYTHON) string(REPLACE . "Python." output_image "${output_image}") add_test(NAME DilateABinaryImageTestPython - COMMAND ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/Code.py + COMMAND ${Python3_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/Code.py ${input_image} ${output_image} ${test_options} diff --git a/src/Filtering/BinaryMathematicalMorphology/ErodeABinaryImage/CMakeLists.txt b/src/Filtering/BinaryMathematicalMorphology/ErodeABinaryImage/CMakeLists.txt index 709322d2f..34df1727f 100644 --- a/src/Filtering/BinaryMathematicalMorphology/ErodeABinaryImage/CMakeLists.txt +++ b/src/Filtering/BinaryMathematicalMorphology/ErodeABinaryImage/CMakeLists.txt @@ -41,7 +41,7 @@ add_test(NAME ErodeABinaryImageTest if(ITK_WRAP_PYTHON) string(REPLACE . "Python." output_image "${output_image}") add_test(NAME ErodeABinaryImageTestPython - COMMAND ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/Code.py + COMMAND ${Python3_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/Code.py ${input_image} ${output_image} ${test_options} diff --git a/src/Filtering/BinaryMathematicalMorphology/ThinImage/CMakeLists.txt b/src/Filtering/BinaryMathematicalMorphology/ThinImage/CMakeLists.txt index 71e15dc32..5544370db 100644 --- a/src/Filtering/BinaryMathematicalMorphology/ThinImage/CMakeLists.txt +++ b/src/Filtering/BinaryMathematicalMorphology/ThinImage/CMakeLists.txt @@ -26,5 +26,5 @@ add_test(NAME ThinImageTest if(ITK_WRAP_PYTHON) add_test(NAME ThinImageTestPython - COMMAND ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/Code.py) + COMMAND ${Python3_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/Code.py) endif() diff --git a/src/Filtering/Colormap/ApplyAColormapToAnImage/CMakeLists.txt b/src/Filtering/Colormap/ApplyAColormapToAnImage/CMakeLists.txt index 478aa89bf..a067e228b 100644 --- a/src/Filtering/Colormap/ApplyAColormapToAnImage/CMakeLists.txt +++ b/src/Filtering/Colormap/ApplyAColormapToAnImage/CMakeLists.txt @@ -33,7 +33,7 @@ add_test(NAME ApplyAColormapToAnImageTest if(ITK_WRAP_PYTHON) string(REPLACE . "Python." output_image "${output_image}") add_test(NAME ApplyAColormapToAnImageTestPython - COMMAND ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/Code.py + COMMAND ${Python3_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/Code.py ${input_image} ${output_image} ${test_options} diff --git a/src/Filtering/Colormap/CreateACustomColormap/CMakeLists.txt b/src/Filtering/Colormap/CreateACustomColormap/CMakeLists.txt index 4628b5214..b970425f3 100644 --- a/src/Filtering/Colormap/CreateACustomColormap/CMakeLists.txt +++ b/src/Filtering/Colormap/CreateACustomColormap/CMakeLists.txt @@ -33,7 +33,7 @@ add_test(NAME CreateACustomColormapTest if(ITK_WRAP_PYTHON) string(REPLACE . "Python." output_image "${output_image}") add_test(NAME CreateACustomColormapTestPython - COMMAND ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/Code.py + COMMAND ${Python3_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/Code.py ${input_image} ${output_image} ${test_options} diff --git a/src/Filtering/FFT/ComputeInverseFFTOfImage/CMakeLists.txt b/src/Filtering/FFT/ComputeInverseFFTOfImage/CMakeLists.txt index c3694e01a..9c07940a5 100644 --- a/src/Filtering/FFT/ComputeInverseFFTOfImage/CMakeLists.txt +++ b/src/Filtering/FFT/ComputeInverseFFTOfImage/CMakeLists.txt @@ -26,5 +26,5 @@ add_test(NAME ComputeInverseFFTOfImageTest if(ITK_WRAP_PYTHON) add_test(NAME ComputeInverseFFTOfImageTestPython - COMMAND ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/Code.py) + COMMAND ${Python3_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/Code.py) endif() diff --git a/src/Filtering/ImageCompare/CombineTwoImagesWithCheckerBoardPattern/CMakeLists.txt b/src/Filtering/ImageCompare/CombineTwoImagesWithCheckerBoardPattern/CMakeLists.txt index d0ba0bfd9..ecbfda6f8 100644 --- a/src/Filtering/ImageCompare/CombineTwoImagesWithCheckerBoardPattern/CMakeLists.txt +++ b/src/Filtering/ImageCompare/CombineTwoImagesWithCheckerBoardPattern/CMakeLists.txt @@ -30,7 +30,7 @@ add_test(NAME CombineTwoImagesWithCheckerBoardPatternTest if(ITK_WRAP_PYTHON) string(REPLACE . "Python." output_image "${output_image}") add_test(NAME CombineTwoImagesWithCheckerBoardPatternTestPython - COMMAND ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/Code.py + COMMAND ${Python3_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/Code.py ${output_image} ) endif() diff --git a/src/Filtering/ImageFeature/AdditiveGaussianNoiseImageFilter/CMakeLists.txt b/src/Filtering/ImageFeature/AdditiveGaussianNoiseImageFilter/CMakeLists.txt index bff1bb593..04b73cd35 100644 --- a/src/Filtering/ImageFeature/AdditiveGaussianNoiseImageFilter/CMakeLists.txt +++ b/src/Filtering/ImageFeature/AdditiveGaussianNoiseImageFilter/CMakeLists.txt @@ -28,9 +28,9 @@ add_test(NAME AdditiveGaussianNoiseImageFilterTest ) if(ITK_WRAP_PYTHON) - find_package(PythonInterp REQUIRED) + find_package(Python3 COMPONENTS Interpreter REQUIRED) add_test(NAME AdditiveGaussianNoiseImageFilterTestPython - COMMAND ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/Code.py + COMMAND ${Python3_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/Code.py ${CMAKE_CURRENT_BINARY_DIR}/Gourds.png OutputPython.png 20 diff --git a/src/Filtering/ImageFeature/ComputeLaplacian/CMakeLists.txt b/src/Filtering/ImageFeature/ComputeLaplacian/CMakeLists.txt index 1064623ac..957eeb04e 100644 --- a/src/Filtering/ImageFeature/ComputeLaplacian/CMakeLists.txt +++ b/src/Filtering/ImageFeature/ComputeLaplacian/CMakeLists.txt @@ -27,7 +27,7 @@ add_test(NAME ComputeLaplacianTest if(ITK_WRAP_PYTHON) add_test(NAME ComputeLaplacianTestPython - COMMAND ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/Code.py + COMMAND ${Python3_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/Code.py ${CMAKE_CURRENT_BINARY_DIR}/cthead1.png OutputPython.png ) diff --git a/src/Filtering/ImageFeature/DetectEdgesWithCannyEdgeDetectionFilter/CMakeLists.txt b/src/Filtering/ImageFeature/DetectEdgesWithCannyEdgeDetectionFilter/CMakeLists.txt index 1599163d3..9e3036afa 100644 --- a/src/Filtering/ImageFeature/DetectEdgesWithCannyEdgeDetectionFilter/CMakeLists.txt +++ b/src/Filtering/ImageFeature/DetectEdgesWithCannyEdgeDetectionFilter/CMakeLists.txt @@ -30,7 +30,7 @@ add_test(NAME DetectEdgesWithCannyEdgeDetectionFilterTest if(ITK_WRAP_PYTHON) add_test(NAME DetectEdgesWithCannyEdgeDetectionFilterTestPython - COMMAND ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/Code.py + COMMAND ${Python3_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/Code.py ${CMAKE_CURRENT_BINARY_DIR}/cthead1.png OutputPython.png 1 diff --git a/src/Filtering/ImageFeature/LaplacianRecursiveGaussianImageFilter/CMakeLists.txt b/src/Filtering/ImageFeature/LaplacianRecursiveGaussianImageFilter/CMakeLists.txt index 8276fc6ce..ef4018b12 100644 --- a/src/Filtering/ImageFeature/LaplacianRecursiveGaussianImageFilter/CMakeLists.txt +++ b/src/Filtering/ImageFeature/LaplacianRecursiveGaussianImageFilter/CMakeLists.txt @@ -32,7 +32,7 @@ add_test(NAME LaplacianRecursiveGaussianImageFilterTest if(ITK_WRAP_PYTHON) string(REPLACE . "Python." output_image "${output_image}") add_test(NAME LaplacianRecursiveGaussianImageFilterTestPython - COMMAND ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/Code.py + COMMAND ${Python3_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/Code.py ${input_image} ${output_image} ) diff --git a/src/Filtering/ImageFeature/SegmentBloodVessels/CMakeLists.txt b/src/Filtering/ImageFeature/SegmentBloodVessels/CMakeLists.txt index 92a1f68eb..f612cc715 100644 --- a/src/Filtering/ImageFeature/SegmentBloodVessels/CMakeLists.txt +++ b/src/Filtering/ImageFeature/SegmentBloodVessels/CMakeLists.txt @@ -37,7 +37,7 @@ set_tests_properties(SegmentBloodVesselsTest PROPERTIES LABELS RUNS_LONG) if(ITK_WRAP_PYTHON) string(REPLACE . "Python." output_image "${output_image}") add_test(NAME SegmentBloodVesselsTestPython - COMMAND ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/Code.py + COMMAND ${Python3_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/Code.py ${input_image} ${output_image} --sigma ${sigma} diff --git a/src/Filtering/ImageFeature/SobelEdgeDetectionImageFilter/CMakeLists.txt b/src/Filtering/ImageFeature/SobelEdgeDetectionImageFilter/CMakeLists.txt index ce41d5a51..b3148ffb4 100644 --- a/src/Filtering/ImageFeature/SobelEdgeDetectionImageFilter/CMakeLists.txt +++ b/src/Filtering/ImageFeature/SobelEdgeDetectionImageFilter/CMakeLists.txt @@ -32,7 +32,7 @@ add_test(NAME SobelEdgeDetectionImageFilterTest if(ITK_WRAP_PYTHON) string(REPLACE . "Python." output_image "${output_image}") add_test(NAME SobelEdgeDetectionImageFilterTestPython - COMMAND ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/Code.py + COMMAND ${Python3_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/Code.py ${input_image} ${output_image} ) diff --git a/src/Filtering/ImageFilterBase/ApplyKernelToEveryPixel/CMakeLists.txt b/src/Filtering/ImageFilterBase/ApplyKernelToEveryPixel/CMakeLists.txt index 5c34bddd9..67818c4f5 100644 --- a/src/Filtering/ImageFilterBase/ApplyKernelToEveryPixel/CMakeLists.txt +++ b/src/Filtering/ImageFilterBase/ApplyKernelToEveryPixel/CMakeLists.txt @@ -26,5 +26,5 @@ add_test(NAME ApplyKernelToEveryPixelTest if(ITK_WRAP_PYTHON) add_test(NAME ApplyKernelToEveryPixelTestPython - COMMAND ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/Code.py) + COMMAND ${Python3_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/Code.py) endif() diff --git a/src/Filtering/ImageFilterBase/CastAnImageToAnotherType/CMakeLists.txt b/src/Filtering/ImageFilterBase/CastAnImageToAnotherType/CMakeLists.txt index 0dba9e5a4..fc6eec072 100644 --- a/src/Filtering/ImageFilterBase/CastAnImageToAnotherType/CMakeLists.txt +++ b/src/Filtering/ImageFilterBase/CastAnImageToAnotherType/CMakeLists.txt @@ -27,7 +27,7 @@ add_test(NAME CastAnImageToAnotherTypeTest if(ITK_WRAP_PYTHON) add_test(NAME CastAnImageToAnotherTypeTestPython - COMMAND ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/Code.py + COMMAND ${Python3_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/Code.py ${CMAKE_CURRENT_BINARY_DIR}/CorpusCallosumMeanShape.mha OutputPython.png ) diff --git a/src/Filtering/ImageFusion/OverlayLabelMapOnTopOfAnImage/CMakeLists.txt b/src/Filtering/ImageFusion/OverlayLabelMapOnTopOfAnImage/CMakeLists.txt index c4ad12c8a..50af29706 100644 --- a/src/Filtering/ImageFusion/OverlayLabelMapOnTopOfAnImage/CMakeLists.txt +++ b/src/Filtering/ImageFusion/OverlayLabelMapOnTopOfAnImage/CMakeLists.txt @@ -35,7 +35,7 @@ add_test(NAME OverlayLabelMapOnTopOfAnImageTest if(ITK_WRAP_PYTHON) string(REPLACE . "Python." output_image "${output_image}") add_test(NAME OverlayLabelMapOnTopOfAnImageTestPython - COMMAND ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/Code.py + COMMAND ${Python3_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/Code.py ${input_images} ${output_image} ) diff --git a/src/Filtering/ImageGradient/ApplyGradientRecursiveGaussian/CMakeLists.txt b/src/Filtering/ImageGradient/ApplyGradientRecursiveGaussian/CMakeLists.txt index 02beabfe0..8ab6e8652 100644 --- a/src/Filtering/ImageGradient/ApplyGradientRecursiveGaussian/CMakeLists.txt +++ b/src/Filtering/ImageGradient/ApplyGradientRecursiveGaussian/CMakeLists.txt @@ -33,7 +33,7 @@ add_test(NAME ApplyGradientRecursiveGaussianTest if(ITK_WRAP_PYTHON) string(REPLACE . "Python." output_image "${output_image}") add_test(NAME ApplyGradientRecursiveGaussianTestPython - COMMAND ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/Code.py + COMMAND ${Python3_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/Code.py ${input_image} ${output_image} ) diff --git a/src/Filtering/ImageGradient/ApplyGradientRecursiveGaussianWithVectorInput/CMakeLists.txt b/src/Filtering/ImageGradient/ApplyGradientRecursiveGaussianWithVectorInput/CMakeLists.txt index e3aeddbe3..abd0fb6ff 100644 --- a/src/Filtering/ImageGradient/ApplyGradientRecursiveGaussianWithVectorInput/CMakeLists.txt +++ b/src/Filtering/ImageGradient/ApplyGradientRecursiveGaussianWithVectorInput/CMakeLists.txt @@ -32,7 +32,7 @@ add_test(NAME ApplyGradientRecursiveGaussianWithVectorInputTest if(ITK_WRAP_PYTHON) string(REPLACE . "Python." output_image "${output_image}") add_test(NAME ApplyGradientRecursiveGaussianWithVectorInputTestPython - COMMAND ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/Code.py + COMMAND ${Python3_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/Code.py ${input_image} ${output_image} ) diff --git a/src/Filtering/ImageGradient/ComputeGradientMagnitudeRecursiveGaussian/CMakeLists.txt b/src/Filtering/ImageGradient/ComputeGradientMagnitudeRecursiveGaussian/CMakeLists.txt index 447d4e9a6..9c6935b08 100644 --- a/src/Filtering/ImageGradient/ComputeGradientMagnitudeRecursiveGaussian/CMakeLists.txt +++ b/src/Filtering/ImageGradient/ComputeGradientMagnitudeRecursiveGaussian/CMakeLists.txt @@ -28,7 +28,7 @@ add_test(NAME ComputeGradientMagnitudeRecursiveGaussianTest if(ITK_WRAP_PYTHON) add_test(NAME ComputeGradientMagnitudeRecursiveGaussianTestPython - COMMAND ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/Code.py + COMMAND ${Python3_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/Code.py ${CMAKE_CURRENT_BINARY_DIR}/Gourds.png ComputeGradientMagnitudeRecursiveGaussianTestOutputPython.mha 2. diff --git a/src/Filtering/ImageGrid/Create3DVolume/CMakeLists.txt b/src/Filtering/ImageGrid/Create3DVolume/CMakeLists.txt index 77dc5f987..dc36bc2b1 100644 --- a/src/Filtering/ImageGrid/Create3DVolume/CMakeLists.txt +++ b/src/Filtering/ImageGrid/Create3DVolume/CMakeLists.txt @@ -30,7 +30,7 @@ add_test(NAME Create3DVolumeTest if(ITK_WRAP_PYTHON) add_test(NAME Create3DVolumeTestPython - COMMAND ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/Code.py + COMMAND ${Python3_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/Code.py ${CMAKE_CURRENT_BINARY_DIR}/mri3D_0.mha ${CMAKE_CURRENT_BINARY_DIR}/mri3D_1.mha ${CMAKE_CURRENT_BINARY_DIR}/mri3D_2.mha diff --git a/src/Filtering/ImageGrid/FlipAnImageOverSpecifiedAxes/CMakeLists.txt b/src/Filtering/ImageGrid/FlipAnImageOverSpecifiedAxes/CMakeLists.txt index e632e7e49..2e65b826a 100644 --- a/src/Filtering/ImageGrid/FlipAnImageOverSpecifiedAxes/CMakeLists.txt +++ b/src/Filtering/ImageGrid/FlipAnImageOverSpecifiedAxes/CMakeLists.txt @@ -33,7 +33,7 @@ add_test(NAME FlipAnImageOverSpecifiedAxesTest if(ITK_WRAP_PYTHON) string(REPLACE . "Python." output_image "${output_image}") add_test(NAME FlipAnImageOverSpecifiedAxesTestPython - COMMAND ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/Code.py + COMMAND ${Python3_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/Code.py ${input_image} ${output_image} 0 diff --git a/src/Filtering/ImageGrid/ProcessA2DSliceOfA3DImage/CMakeLists.txt b/src/Filtering/ImageGrid/ProcessA2DSliceOfA3DImage/CMakeLists.txt index 884b8388d..f718e33e5 100644 --- a/src/Filtering/ImageGrid/ProcessA2DSliceOfA3DImage/CMakeLists.txt +++ b/src/Filtering/ImageGrid/ProcessA2DSliceOfA3DImage/CMakeLists.txt @@ -33,10 +33,10 @@ add_test(NAME ProcessA2DSliceOfA3DImageTest ) if(ITK_WRAP_PYTHON) - find_package(PythonInterp REQUIRED) + find_package(Python3 COMPONENTS Interpreter REQUIRED) string(REPLACE . "Python." output_image "${output_image}") add_test(NAME ProcessA2DSliceOfA3DImageTestPython - COMMAND ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/Code.py + COMMAND ${Python3_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/Code.py ${input_image} ${output_image} ${test_options} diff --git a/src/Filtering/ImageGrid/ResampleAScalarImage/CMakeLists.txt b/src/Filtering/ImageGrid/ResampleAScalarImage/CMakeLists.txt index 431b4986d..ca9b93da6 100644 --- a/src/Filtering/ImageGrid/ResampleAScalarImage/CMakeLists.txt +++ b/src/Filtering/ImageGrid/ResampleAScalarImage/CMakeLists.txt @@ -29,7 +29,7 @@ add_test(NAME ResampleAScalarImageTest if(ITK_WRAP_PYTHON) add_test(NAME ResampleAScalarImageTestPython - COMMAND ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/Code.py + COMMAND ${Python3_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/Code.py ${CMAKE_CURRENT_BINARY_DIR}/Gourds.png OutputPython.png 160 diff --git a/src/Filtering/ImageGrid/ResampleAVectorImage/CMakeLists.txt b/src/Filtering/ImageGrid/ResampleAVectorImage/CMakeLists.txt index 5fd4535bd..d28612b06 100644 --- a/src/Filtering/ImageGrid/ResampleAVectorImage/CMakeLists.txt +++ b/src/Filtering/ImageGrid/ResampleAVectorImage/CMakeLists.txt @@ -32,7 +32,7 @@ add_test(NAME ResampleAVectorImageTest if(ITK_WRAP_PYTHON) string(REPLACE . "Python." output_image "${output_image}") add_test(NAME ResampleAVectorImageTestPython - COMMAND ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/Code.py + COMMAND ${Python3_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/Code.py ${input_image} ${output_image} ) diff --git a/src/Filtering/ImageGrid/ResampleAnImage/CMakeLists.txt b/src/Filtering/ImageGrid/ResampleAnImage/CMakeLists.txt index 1df40d238..c06c4cd2c 100644 --- a/src/Filtering/ImageGrid/ResampleAnImage/CMakeLists.txt +++ b/src/Filtering/ImageGrid/ResampleAnImage/CMakeLists.txt @@ -28,7 +28,7 @@ add_test(NAME ResampleAnImageTest if(ITK_WRAP_PYTHON) add_test(NAME ResampleAnImageTestPython - COMMAND ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/Code.py + COMMAND ${Python3_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/Code.py ${CMAKE_CURRENT_BINARY_DIR}/BrainProtonDensitySlice.png OutputPython.png 2 diff --git a/src/Filtering/ImageGrid/WarpAnImageUsingADeformationField/CMakeLists.txt b/src/Filtering/ImageGrid/WarpAnImageUsingADeformationField/CMakeLists.txt index ef676f701..b1059e6b6 100644 --- a/src/Filtering/ImageGrid/WarpAnImageUsingADeformationField/CMakeLists.txt +++ b/src/Filtering/ImageGrid/WarpAnImageUsingADeformationField/CMakeLists.txt @@ -35,10 +35,10 @@ add_test(NAME WarpAnImageUsingADeformationFieldTest ) if(ITK_WRAP_PYTHON) - find_package(PythonInterp REQUIRED) + find_package(Python3 COMPONENTS Interpreter REQUIRED) string(REPLACE . "Python." output_image "${output_image}") add_test(NAME WarpAnImageUsingADeformationFieldTestPython - COMMAND ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/Code.py + COMMAND ${Python3_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/Code.py ${input_image} ${displacement_field_image} ${output_image} diff --git a/src/Filtering/ImageIntensity/ApplyExpNegativeImageFilter/CMakeLists.txt b/src/Filtering/ImageIntensity/ApplyExpNegativeImageFilter/CMakeLists.txt index 5767a0c07..df5a4ed4e 100644 --- a/src/Filtering/ImageIntensity/ApplyExpNegativeImageFilter/CMakeLists.txt +++ b/src/Filtering/ImageIntensity/ApplyExpNegativeImageFilter/CMakeLists.txt @@ -28,7 +28,7 @@ add_test(NAME ApplyExpNegativeImageFilterTest if(ITK_WRAP_PYTHON) add_test(NAME ApplyExpNegativeImageFilterTestPython - COMMAND ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/Code.py + COMMAND ${Python3_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/Code.py ${CMAKE_CURRENT_BINARY_DIR}/Gourds.png OutputPython.mha 0.001 diff --git a/src/Filtering/ImageIntensity/ComputeSigmoid/CMakeLists.txt b/src/Filtering/ImageIntensity/ComputeSigmoid/CMakeLists.txt index e6cc500a4..cf9ac995a 100644 --- a/src/Filtering/ImageIntensity/ComputeSigmoid/CMakeLists.txt +++ b/src/Filtering/ImageIntensity/ComputeSigmoid/CMakeLists.txt @@ -28,7 +28,7 @@ add_test(NAME ComputeSigmoidTest if(ITK_WRAP_PYTHON) add_test(NAME ComputeSigmoidTestPython - COMMAND ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/Code.py + COMMAND ${Python3_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/Code.py ${CMAKE_CURRENT_BINARY_DIR}/BrainProtonDensitySlice.png OutputPython.png 10 240 10 170 diff --git a/src/Filtering/ImageIntensity/ConvertRGBImageToGrayscaleImage/CMakeLists.txt b/src/Filtering/ImageIntensity/ConvertRGBImageToGrayscaleImage/CMakeLists.txt index 30dd39949..a06a29025 100644 --- a/src/Filtering/ImageIntensity/ConvertRGBImageToGrayscaleImage/CMakeLists.txt +++ b/src/Filtering/ImageIntensity/ConvertRGBImageToGrayscaleImage/CMakeLists.txt @@ -29,10 +29,10 @@ add_test(NAME ConvertRGBImageToGrayscaleImageTest ) if(ITK_WRAP_PYTHON) - find_package(PythonInterp REQUIRED) + find_package(Python3 COMPONENTS Interpreter REQUIRED) string(REPLACE . "Python." output_image "${output_image}") add_test(NAME ConvertRGBImageToGrayscaleImageTestPython - COMMAND ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/Code.py + COMMAND ${Python3_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/Code.py ${input_image} ${output_image} ) diff --git a/src/Filtering/ImageIntensity/RescaleIntensity/CMakeLists.txt b/src/Filtering/ImageIntensity/RescaleIntensity/CMakeLists.txt index 460e5ead4..e566d3259 100644 --- a/src/Filtering/ImageIntensity/RescaleIntensity/CMakeLists.txt +++ b/src/Filtering/ImageIntensity/RescaleIntensity/CMakeLists.txt @@ -34,7 +34,7 @@ add_test(NAME RescaleIntensityTest if(ITK_WRAP_PYTHON) string(REPLACE . "Python." output_image "${output_image}") add_test(NAME RescaleIntensityTestPython - COMMAND ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/Code.py + COMMAND ${Python3_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/Code.py ${input_image} ${output_image} 0 diff --git a/src/Filtering/ImageStatistics/AdaptiveHistogramEqualizationImageFilter/CMakeLists.txt b/src/Filtering/ImageStatistics/AdaptiveHistogramEqualizationImageFilter/CMakeLists.txt index 204333169..f5f467971 100644 --- a/src/Filtering/ImageStatistics/AdaptiveHistogramEqualizationImageFilter/CMakeLists.txt +++ b/src/Filtering/ImageStatistics/AdaptiveHistogramEqualizationImageFilter/CMakeLists.txt @@ -91,7 +91,7 @@ add_test(NAME AdaptiveHistogramEqualizationImageFilterTest04 if(0) if(ITK_WRAP_PYTHON) add_test(NAME AdaptiveHistogramEqualizationImageFilterTest01Python - COMMAND ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/Code.py + COMMAND ${Python3_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/Code.py ${input_image} AdaptiveHistogramEqualizationImageFilterTest01Python.png ${alpha01} @@ -99,7 +99,7 @@ if(ITK_WRAP_PYTHON) ${radius01} ) add_test(NAME AdaptiveHistogramEqualizationImageFilterTest02Python - COMMAND ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/Code.py + COMMAND ${Python3_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/Code.py ${input_image} AdaptiveHistogramEqualizationImageFilterTest02Python.png ${alpha02} @@ -107,7 +107,7 @@ if(ITK_WRAP_PYTHON) ${radius02} ) add_test(NAME AdaptiveHistogramEqualizationImageFilterTest03Python - COMMAND ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/Code.py + COMMAND ${Python3_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/Code.py ${input_image} AdaptiveHistogramEqualizationImageFilterTest03Python.png ${alpha03} @@ -115,7 +115,7 @@ if(ITK_WRAP_PYTHON) ${radius03} ) add_test(NAME AdaptiveHistogramEqualizationImageFilterTest04Python - COMMAND ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/Code.py + COMMAND ${Python3_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/Code.py ${input_image} AdaptiveHistogramEqualizationImageFilterTest04Python.png ${alpha04} @@ -123,7 +123,7 @@ if(ITK_WRAP_PYTHON) ${radius01} ) add_test(NAME AdaptiveHistogramEqualizationImageFilterTest05Python - COMMAND ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/Code.py + COMMAND ${Python3_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/Code.py ${input_image} AdaptiveHistogramEqualizationImageFilterTest05Python.png ${alpha05} @@ -131,7 +131,7 @@ if(ITK_WRAP_PYTHON) ${radius02} ) add_test(NAME AdaptiveHistogramEqualizationImageFilterTest06Python - COMMAND ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/Code.py + COMMAND ${Python3_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/Code.py ${input_image} AdaptiveHistogramEqualizationImageFilterTest06Python.png ${alpha05} diff --git a/src/Filtering/ImageStatistics/CalculateImageMoments/CMakeLists.txt b/src/Filtering/ImageStatistics/CalculateImageMoments/CMakeLists.txt index f5b223fca..686782907 100644 --- a/src/Filtering/ImageStatistics/CalculateImageMoments/CMakeLists.txt +++ b/src/Filtering/ImageStatistics/CalculateImageMoments/CMakeLists.txt @@ -28,9 +28,9 @@ add_test(NAME CalculateImageMomentsTest ) if(ITK_WRAP_PYTHON) - find_package(PythonInterp REQUIRED) + find_package(Python3 COMPONENTS Interpreter REQUIRED) add_test(NAME CalculateImageMomentsTestPython - COMMAND ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/Code.py + COMMAND ${Python3_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/Code.py ${input_image} ) endif() diff --git a/src/Filtering/LabelMap/RemoveHolesNotConnectedToImageBoundaries/CMakeLists.txt b/src/Filtering/LabelMap/RemoveHolesNotConnectedToImageBoundaries/CMakeLists.txt index 7621cd6fc..93c1905a2 100644 --- a/src/Filtering/LabelMap/RemoveHolesNotConnectedToImageBoundaries/CMakeLists.txt +++ b/src/Filtering/LabelMap/RemoveHolesNotConnectedToImageBoundaries/CMakeLists.txt @@ -31,7 +31,7 @@ add_test(NAME RemoveHolesNotConnectedToImageBoundariesTest if(ITK_WRAP_PYTHON) string(REPLACE . "Python." output_image "${output_image}") add_test(NAME RemoveHolesNotConnectedToImageBoundariesTestPython - COMMAND ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/Code.py + COMMAND ${Python3_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/Code.py ${input_image} ${output_image} ) diff --git a/src/Filtering/MathematicalMorphology/DilateAGrayscaleImage/CMakeLists.txt b/src/Filtering/MathematicalMorphology/DilateAGrayscaleImage/CMakeLists.txt index 3089a4992..175cac706 100644 --- a/src/Filtering/MathematicalMorphology/DilateAGrayscaleImage/CMakeLists.txt +++ b/src/Filtering/MathematicalMorphology/DilateAGrayscaleImage/CMakeLists.txt @@ -34,7 +34,7 @@ add_test(NAME DilateAGrayscaleImageTest if(ITK_WRAP_PYTHON) add_test(NAME DilateAGrayscaleImageTestPython - COMMAND ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/Code.py + COMMAND ${Python3_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/Code.py ${CMAKE_CURRENT_BINARY_DIR}/cthead1.png OutputPython.png 5 diff --git a/src/Filtering/MathematicalMorphology/ErodeAGrayscaleImage/CMakeLists.txt b/src/Filtering/MathematicalMorphology/ErodeAGrayscaleImage/CMakeLists.txt index f1471abed..b1c400c48 100644 --- a/src/Filtering/MathematicalMorphology/ErodeAGrayscaleImage/CMakeLists.txt +++ b/src/Filtering/MathematicalMorphology/ErodeAGrayscaleImage/CMakeLists.txt @@ -34,7 +34,7 @@ add_test(NAME ErodeAGrayscaleImageTest if(ITK_WRAP_PYTHON) add_test(NAME ErodeAGrayscaleImageTestPython - COMMAND ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/Code.py + COMMAND ${Python3_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/Code.py ${CMAKE_CURRENT_BINARY_DIR}/cthead1.png OutputPython.png 5 diff --git a/src/Filtering/Smoothing/BlurringAnImageUsingABinomialKernel/CMakeLists.txt b/src/Filtering/Smoothing/BlurringAnImageUsingABinomialKernel/CMakeLists.txt index a6a1ce9f8..69bbd18f0 100644 --- a/src/Filtering/Smoothing/BlurringAnImageUsingABinomialKernel/CMakeLists.txt +++ b/src/Filtering/Smoothing/BlurringAnImageUsingABinomialKernel/CMakeLists.txt @@ -33,10 +33,10 @@ add_test(NAME BlurringAnImageUsingABinomialKernelTest ) if(ITK_WRAP_PYTHON) - find_package(PythonInterp REQUIRED) + find_package(Python3 COMPONENTS Interpreter REQUIRED) string(REPLACE . "Python." output_image "${output_image}") add_test(NAME BlurringAnImageUsingABinomialKernelTestPython - COMMAND ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/Code.py + COMMAND ${Python3_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/Code.py ${input_image} ${output_image} ${test_options} diff --git a/src/Filtering/Smoothing/ComputesSmoothingWithGaussianKernel/CMakeLists.txt b/src/Filtering/Smoothing/ComputesSmoothingWithGaussianKernel/CMakeLists.txt index ffd27e99d..c01fe6e16 100644 --- a/src/Filtering/Smoothing/ComputesSmoothingWithGaussianKernel/CMakeLists.txt +++ b/src/Filtering/Smoothing/ComputesSmoothingWithGaussianKernel/CMakeLists.txt @@ -28,7 +28,7 @@ add_test(NAME ComputesSmoothingWithGaussianKernelTest if(ITK_WRAP_PYTHON) add_test(NAME ComputesSmoothingWithGaussianKernelTestPython - COMMAND ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/Code.py + COMMAND ${Python3_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/Code.py ${CMAKE_CURRENT_BINARY_DIR}/BrainProtonDensitySlice.png OutputPython.png 3 diff --git a/src/Filtering/Smoothing/MeanFilteringOfAnImage/CMakeLists.txt b/src/Filtering/Smoothing/MeanFilteringOfAnImage/CMakeLists.txt index 8aaf50e28..8786a6e48 100644 --- a/src/Filtering/Smoothing/MeanFilteringOfAnImage/CMakeLists.txt +++ b/src/Filtering/Smoothing/MeanFilteringOfAnImage/CMakeLists.txt @@ -28,7 +28,7 @@ add_test(NAME MeanFilteringOfAnImageTest if(ITK_WRAP_PYTHON) add_test(NAME MeanFilteringOfAnImageTestPython - COMMAND ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/Code.py + COMMAND ${Python3_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/Code.py ${CMAKE_CURRENT_BINARY_DIR}/Gourds.png OutputPython.png 2 diff --git a/src/Filtering/Smoothing/MedianFilteringOfAnImage/CMakeLists.txt b/src/Filtering/Smoothing/MedianFilteringOfAnImage/CMakeLists.txt index 53a02d8c0..5a9516288 100644 --- a/src/Filtering/Smoothing/MedianFilteringOfAnImage/CMakeLists.txt +++ b/src/Filtering/Smoothing/MedianFilteringOfAnImage/CMakeLists.txt @@ -28,7 +28,7 @@ add_test(NAME MedianFilteringOfAnImageTest if(ITK_WRAP_PYTHON) add_test(NAME MedianFilteringOfAnImageTestPython - COMMAND ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/Code.py + COMMAND ${Python3_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/Code.py ${CMAKE_CURRENT_BINARY_DIR}/Gourds.png OutputPython.png 2 diff --git a/src/Filtering/Thresholding/ThresholdAnImage/CMakeLists.txt b/src/Filtering/Thresholding/ThresholdAnImage/CMakeLists.txt index 3d18410b8..6f5c4e4c2 100644 --- a/src/Filtering/Thresholding/ThresholdAnImage/CMakeLists.txt +++ b/src/Filtering/Thresholding/ThresholdAnImage/CMakeLists.txt @@ -29,7 +29,7 @@ add_test(NAME ThresholdAnImageTest if(ITK_WRAP_PYTHON) add_test(NAME ThresholdAnImageTestPython - COMMAND ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/Code.py + COMMAND ${Python3_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/Code.py ${CMAKE_CURRENT_BINARY_DIR}/Gourds.png ${CMAKE_CURRENT_BINARY_DIR}/OutputPython.png 64 diff --git a/src/Filtering/Thresholding/ThresholdAnImageUsingBinary/CMakeLists.txt b/src/Filtering/Thresholding/ThresholdAnImageUsingBinary/CMakeLists.txt index 11144f2c4..671bea535 100644 --- a/src/Filtering/Thresholding/ThresholdAnImageUsingBinary/CMakeLists.txt +++ b/src/Filtering/Thresholding/ThresholdAnImageUsingBinary/CMakeLists.txt @@ -31,7 +31,7 @@ add_test(NAME ThresholdAnImageUsingBinaryTest if(ITK_WRAP_PYTHON) add_test(NAME ThresholdAnImageUsingBinaryTestPython - COMMAND ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/Code.py + COMMAND ${Python3_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/Code.py ${CMAKE_CURRENT_BINARY_DIR}/cthead1.png OutputPython.png 50 diff --git a/src/Filtering/Thresholding/ThresholdAnImageUsingOtsu/CMakeLists.txt b/src/Filtering/Thresholding/ThresholdAnImageUsingOtsu/CMakeLists.txt index 07660af4a..c4e0f91f4 100644 --- a/src/Filtering/Thresholding/ThresholdAnImageUsingOtsu/CMakeLists.txt +++ b/src/Filtering/Thresholding/ThresholdAnImageUsingOtsu/CMakeLists.txt @@ -30,7 +30,7 @@ add_test(NAME ThresholdAnImageUsingOtsuTest if(ITK_WRAP_PYTHON) add_test(NAME ThresholdAnImageUsingOtsuTestPython - COMMAND ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/Code.py + COMMAND ${Python3_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/Code.py ${CMAKE_CURRENT_BINARY_DIR}/Gourds.png OutputPython.png 64 diff --git a/src/IO/GDCM/ReadAndPrintDICOMTags/CMakeLists.txt b/src/IO/GDCM/ReadAndPrintDICOMTags/CMakeLists.txt index edb94bfbb..a5a9b9e16 100644 --- a/src/IO/GDCM/ReadAndPrintDICOMTags/CMakeLists.txt +++ b/src/IO/GDCM/ReadAndPrintDICOMTags/CMakeLists.txt @@ -25,10 +25,10 @@ add_test(NAME ReadAndPrintDICOMTagsTest ) if(ITK_WRAP_PYTHON) - find_package(PythonInterp REQUIRED) + find_package(Python3 COMPONENTS Interpreter REQUIRED) string(REPLACE . "Python." output_image "${output_image}") add_test(NAME ReadAndPrintDICOMTagsTestPython - COMMAND ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/Code.py + COMMAND ${Python3_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/Code.py "${CMAKE_CURRENT_BINARY_DIR}" ) endif() diff --git a/src/IO/GDCM/ReadDICOMSeriesAndWrite3DImage/CMakeLists.txt b/src/IO/GDCM/ReadDICOMSeriesAndWrite3DImage/CMakeLists.txt index 25a73a9bc..d1bb53c84 100644 --- a/src/IO/GDCM/ReadDICOMSeriesAndWrite3DImage/CMakeLists.txt +++ b/src/IO/GDCM/ReadDICOMSeriesAndWrite3DImage/CMakeLists.txt @@ -27,7 +27,7 @@ add_test(NAME ReadDICOMSeriesAndWrite3DImage if(ITK_WRAP_PYTHON) string(REPLACE . "Python." output_image "${output_image}") add_test(NAME ReadDICOMSeriesAndWrite3DImagePython - COMMAND ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/Code.py + COMMAND ${Python3_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/Code.py "${CMAKE_CURRENT_BINARY_DIR}" "${CMAKE_CURRENT_BINARY_DIR}/Image3D.Python.nrrd" ) diff --git a/src/IO/ImageBase/CreateAListOfFileNames/CMakeLists.txt b/src/IO/ImageBase/CreateAListOfFileNames/CMakeLists.txt index 74e5feecd..337452c05 100644 --- a/src/IO/ImageBase/CreateAListOfFileNames/CMakeLists.txt +++ b/src/IO/ImageBase/CreateAListOfFileNames/CMakeLists.txt @@ -24,5 +24,5 @@ add_test(NAME CreateAListOfFileNamesTest if(ITK_WRAP_PYTHON) add_test(NAME CreateAListOfFileNamesTestPython - COMMAND ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/Code.py) + COMMAND ${Python3_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/Code.py) endif() diff --git a/src/IO/ImageBase/GenerateSlicesFromVolume/CMakeLists.txt b/src/IO/ImageBase/GenerateSlicesFromVolume/CMakeLists.txt index 28ef8ea0c..7158a8c3f 100644 --- a/src/IO/ImageBase/GenerateSlicesFromVolume/CMakeLists.txt +++ b/src/IO/ImageBase/GenerateSlicesFromVolume/CMakeLists.txt @@ -38,7 +38,7 @@ add_test(NAME GenerateSlicesFromVolumeTest if(ITK_WRAP_PYTHON) add_test(NAME GenerateSlicesFromVolumeTestPython - COMMAND ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/Code.py + COMMAND ${Python3_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/Code.py ${input_image} ${output_image} "Python.png" diff --git a/src/IO/ImageBase/ProcessImageChunks/CMakeLists.txt b/src/IO/ImageBase/ProcessImageChunks/CMakeLists.txt index b06fe5057..0fd4304d2 100644 --- a/src/IO/ImageBase/ProcessImageChunks/CMakeLists.txt +++ b/src/IO/ImageBase/ProcessImageChunks/CMakeLists.txt @@ -35,7 +35,7 @@ add_test(NAME ProcessImageChunksTest if(ITK_WRAP_PYTHON) add_test(NAME ProcessImageChunksTestPython - COMMAND ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/Code.py + COMMAND ${Python3_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/Code.py ${CMAKE_CURRENT_BINARY_DIR}/Gourds.png OutputPython.mha ) diff --git a/src/IO/ImageBase/ReadAnImage/CMakeLists.txt b/src/IO/ImageBase/ReadAnImage/CMakeLists.txt index ddccf08e1..d474ef0dc 100644 --- a/src/IO/ImageBase/ReadAnImage/CMakeLists.txt +++ b/src/IO/ImageBase/ReadAnImage/CMakeLists.txt @@ -28,7 +28,7 @@ add_test(NAME ReadAnImageTest if(ITK_WRAP_PYTHON) add_test(NAME ReadAnImageTestPython - COMMAND ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/Code.py + COMMAND ${Python3_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/Code.py ${input_image} ) endif() diff --git a/src/IO/ImageBase/WriteAnImage/CMakeLists.txt b/src/IO/ImageBase/WriteAnImage/CMakeLists.txt index fe948ed95..bfad0864d 100644 --- a/src/IO/ImageBase/WriteAnImage/CMakeLists.txt +++ b/src/IO/ImageBase/WriteAnImage/CMakeLists.txt @@ -24,5 +24,5 @@ add_test(NAME WriteAnImageTest if(ITK_WRAP_PYTHON) add_test(NAME WriteAnImageTestPython - COMMAND ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/Code.py) + COMMAND ${Python3_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/Code.py) endif() diff --git a/src/Nonunit/Review/SegmentBloodVesselsWithMultiScaleHessianBasedMeasure/CMakeLists.txt b/src/Nonunit/Review/SegmentBloodVesselsWithMultiScaleHessianBasedMeasure/CMakeLists.txt index ad300b664..01092e5a4 100644 --- a/src/Nonunit/Review/SegmentBloodVesselsWithMultiScaleHessianBasedMeasure/CMakeLists.txt +++ b/src/Nonunit/Review/SegmentBloodVesselsWithMultiScaleHessianBasedMeasure/CMakeLists.txt @@ -38,7 +38,7 @@ add_test(NAME SegmentBloodVesselsWithMultiScaleHessianBasedMeasureTest if(ITK_WRAP_PYTHON) string(REPLACE . "Python." output_image "${output_image}") add_test(NAME SegmentBloodVesselsWithMultiScaleHessianBasedMeasureTestPython - COMMAND ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/Code.py + COMMAND ${Python3_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/Code.py ${input_image} ${output_image} --sigma_minimum ${sigma_minimum} diff --git a/src/Numerics/Optimizers/ExhaustiveOptimizer/CMakeLists.txt b/src/Numerics/Optimizers/ExhaustiveOptimizer/CMakeLists.txt index 7d02f1150..b8c6f65bf 100644 --- a/src/Numerics/Optimizers/ExhaustiveOptimizer/CMakeLists.txt +++ b/src/Numerics/Optimizers/ExhaustiveOptimizer/CMakeLists.txt @@ -32,7 +32,7 @@ add_test(NAME ExhaustiveOptimizerTest if(ITK_WRAP_PYTHON) add_test(NAME ExhaustiveOptimizerTestPython - COMMAND ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/Code.py + COMMAND ${Python3_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/Code.py ${fixed_image} ${moving_image}) endif() diff --git a/src/Numerics/Statistics/HistogramCreationAndBinAccess/CMakeLists.txt b/src/Numerics/Statistics/HistogramCreationAndBinAccess/CMakeLists.txt index df33cd0a6..b4426704d 100644 --- a/src/Numerics/Statistics/HistogramCreationAndBinAccess/CMakeLists.txt +++ b/src/Numerics/Statistics/HistogramCreationAndBinAccess/CMakeLists.txt @@ -31,10 +31,10 @@ set_tests_properties(HistogramCreationAndBinAccessTest PROPERTIES PASS_REGULAR_EXPRESSION "${HistogramCreationAndBinAccessTest_Regex}") if(ITK_WRAP_PYTHON) - find_package(PythonInterp REQUIRED) + find_package(Python3 COMPONENTS Interpreter REQUIRED) string(REPLACE . "Python." output_image "${output_image}") add_test(NAME HistogramCreationAndBinAccessTestPython - COMMAND ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/Code.py + COMMAND ${Python3_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/Code.py ) set_tests_properties(HistogramCreationAndBinAccessTestPython PROPERTIES PASS_REGULAR_EXPRESSION "${HistogramCreationAndBinAccessTest_Regex}") diff --git a/src/Registration/Common/ComputeMeanSquareBetweenTwoImages/CMakeLists.txt b/src/Registration/Common/ComputeMeanSquareBetweenTwoImages/CMakeLists.txt index e56232ec1..47ddda4c0 100644 --- a/src/Registration/Common/ComputeMeanSquareBetweenTwoImages/CMakeLists.txt +++ b/src/Registration/Common/ComputeMeanSquareBetweenTwoImages/CMakeLists.txt @@ -29,7 +29,7 @@ add_test(NAME ComputeMeanSquareBetweenTwoImagesTest if(ITK_WRAP_PYTHON) add_test(NAME ComputeMeanSquareBetweenTwoImagesTestPython - COMMAND ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/Code.py + COMMAND ${Python3_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/Code.py Yinyang.png Gourds.png) endif() diff --git a/src/Registration/Common/GlobalRegistrationOfTwoImages/CMakeLists.txt b/src/Registration/Common/GlobalRegistrationOfTwoImages/CMakeLists.txt index 769de325e..8cafd4373 100644 --- a/src/Registration/Common/GlobalRegistrationOfTwoImages/CMakeLists.txt +++ b/src/Registration/Common/GlobalRegistrationOfTwoImages/CMakeLists.txt @@ -27,6 +27,6 @@ add_test(NAME GlobalRegistrationOfTwoImagesTest if( ITK_WRAP_PYTHON ) add_test( NAME GlobalRegistrationOfTwoImagesTestPython - COMMAND ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/Code.py + COMMAND ${Python3_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/Code.py ) endif() diff --git a/src/Registration/Common/Perform2DTranslationRegistrationWithMeanSquares/CMakeLists.txt b/src/Registration/Common/Perform2DTranslationRegistrationWithMeanSquares/CMakeLists.txt index b2010a626..c5772a46d 100644 --- a/src/Registration/Common/Perform2DTranslationRegistrationWithMeanSquares/CMakeLists.txt +++ b/src/Registration/Common/Perform2DTranslationRegistrationWithMeanSquares/CMakeLists.txt @@ -39,7 +39,7 @@ if(ITK_WRAP_PYTHON) string(REPLACE . "Python." output_image2 "${output_image2}") string(REPLACE . "Python." output_image3 "${output_image3}") add_test(NAME Perform2DTranslationRegistrationWithMeanSquaresTestPython - COMMAND ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/Code.py + COMMAND ${Python3_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/Code.py ${input_image1} ${input_image2} ${output_image1} diff --git a/src/Registration/Common/RegisterImageToAnotherUsingLandmarks/CMakeLists.txt b/src/Registration/Common/RegisterImageToAnotherUsingLandmarks/CMakeLists.txt index e1d829305..d2b3ca0d6 100644 --- a/src/Registration/Common/RegisterImageToAnotherUsingLandmarks/CMakeLists.txt +++ b/src/Registration/Common/RegisterImageToAnotherUsingLandmarks/CMakeLists.txt @@ -25,6 +25,6 @@ add_test(NAME RegisterImageToAnotherUsingLandmarksTest if(ITK_WRAP_PYTHON) add_test(NAME RegisterImageToAnotherUsingLandmarksTestPython - COMMAND ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/Code.py + COMMAND ${Python3_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/Code.py ) endif() diff --git a/src/Registration/Metricsv4/RegisterTwoPointSets/CMakeLists.txt b/src/Registration/Metricsv4/RegisterTwoPointSets/CMakeLists.txt index 626f7f19d..73083700b 100644 --- a/src/Registration/Metricsv4/RegisterTwoPointSets/CMakeLists.txt +++ b/src/Registration/Metricsv4/RegisterTwoPointSets/CMakeLists.txt @@ -26,8 +26,8 @@ add_test(NAME RegisterTwoPointSetsTest if(ITK_WRAP_PYTHON) add_test(NAME RegisterTwoPointSetsTest2DPython - COMMAND ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/Code.py 2 + COMMAND ${Python3_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/Code.py 2 ) add_test(NAME RegisterTwoPointSetsTest3DPython - COMMAND ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/Code.py 3) + COMMAND ${Python3_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/Code.py 3) endif() diff --git a/src/Segmentation/LevelSets/SegmentWithGeodesicActiveContourLevelSet/CMakeLists.txt b/src/Segmentation/LevelSets/SegmentWithGeodesicActiveContourLevelSet/CMakeLists.txt index 8764106cf..6199590a9 100644 --- a/src/Segmentation/LevelSets/SegmentWithGeodesicActiveContourLevelSet/CMakeLists.txt +++ b/src/Segmentation/LevelSets/SegmentWithGeodesicActiveContourLevelSet/CMakeLists.txt @@ -50,28 +50,28 @@ add_test(NAME GeodesicActiveContourGrayMatterTest if(ITK_WRAP_PYTHON) add_test(NAME GeodesicActiveContourLeftVentricleTestPython - COMMAND ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/Code.py + COMMAND ${Python3_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/Code.py ${CMAKE_CURRENT_BINARY_DIR}/BrainProtonDensitySlice.png Output1Python.png 81 114 5.0 1.0 -0.5 3.0 2.0 800 ) add_test(NAME GeodesicActiveContourRightVentricleTestPython - COMMAND ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/Code.py + COMMAND ${Python3_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/Code.py ${CMAKE_CURRENT_BINARY_DIR}/BrainProtonDensitySlice.png Output2Python.png 99 114 5.0 1.0 -0.5 3.0 2.0 800 ) add_test(NAME GeodesicActiveContourWhiteMatterTestPython - COMMAND ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/Code.py + COMMAND ${Python3_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/Code.py ${CMAKE_CURRENT_BINARY_DIR}/BrainProtonDensitySlice.png Output3Python.png 56 92 5.0 1.0 -0.3 2.0 10.0 800 ) add_test(NAME GeodesicActiveContourGrayMatterTestPython - COMMAND ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/Code.py + COMMAND ${Python3_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/Code.py ${CMAKE_CURRENT_BINARY_DIR}/BrainProtonDensitySlice.png Output4Python.png 40 90 5.0 .5 -0.3 2.0 10.0 800 diff --git a/src/Segmentation/Watersheds/SegmentWithWatershedImageFilter/CMakeLists.txt b/src/Segmentation/Watersheds/SegmentWithWatershedImageFilter/CMakeLists.txt index 32879d2ea..417a5db83 100644 --- a/src/Segmentation/Watersheds/SegmentWithWatershedImageFilter/CMakeLists.txt +++ b/src/Segmentation/Watersheds/SegmentWithWatershedImageFilter/CMakeLists.txt @@ -71,35 +71,35 @@ add_test(NAME SegmentWithWatershedImageFilterTest05 if(ITK_WRAP_PYTHON) add_test(NAME SegmentWithWatershedImageFilterTest01Python - COMMAND ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/Code.py + COMMAND ${Python3_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/Code.py ${input_image} SegmentWithWatershedImageFilterTest01Python.png ${threshold01} ${level01} ) add_test(NAME SegmentWithWatershedImageFilterTest02Python - COMMAND ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/Code.py + COMMAND ${Python3_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/Code.py ${input_image} SegmentWithWatershedImageFilterTest02Python.png ${threshold02} ${level02} ) add_test(NAME SegmentWithWatershedImageFilterTest03Python - COMMAND ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/Code.py + COMMAND ${Python3_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/Code.py ${input_image} SegmentWithWatershedImageFilterTest03Python.png ${threshold03} ${level03} ) add_test(NAME SegmentWithWatershedImageFilterTest04Python - COMMAND ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/Code.py + COMMAND ${Python3_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/Code.py ${input_image} SegmentWithWatershedImageFilterTest04Python.png ${threshold04} ${level04} ) add_test(NAME SegmentWithWatershedImageFilterTest05Python - COMMAND ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/Code.py + COMMAND ${Python3_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/Code.py ${input_image} SegmentWithWatershedImageFilterTest05Python.png ${threshold05}