From f091c57789d9e410eb97b368047aaa5c7a8da7d9 Mon Sep 17 00:00:00 2001 From: Matt McCormick Date: Fri, 21 Nov 2025 10:04:10 -0500 Subject: [PATCH 1/5] ENH: Bump ITK version to 5.4.5 --- CMakeLists.txt | 4 ++-- itkVersion.py | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 161f97f8..3367848d 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -94,8 +94,8 @@ if(ITKPythonPackage_SUPERBUILD) set(ITK_REPOSITORY "https://github.com/InsightSoftwareConsortium/ITK.git") - # release-5.4 branch, 2025-06-23 - set(ITK_GIT_TAG "46f39a0ea702247628036fc3cffdb009caa463cf") + # release-5.4 branch, 2025-11-21 + set(ITK_GIT_TAG "v5.4.5") #----------------------------------------------------------------------------- # A separate project is used to download ITK, so that it can reused diff --git a/itkVersion.py b/itkVersion.py index ff7f3050..717bad72 100644 --- a/itkVersion.py +++ b/itkVersion.py @@ -1,4 +1,4 @@ -VERSION = '5.4.4.post1' +VERSION = '5.4.5' def get_versions(): """Returns versions for the ITK Python package. From b698e92e1e4e883256cc3c261481a11b7d675b09 Mon Sep 17 00:00:00 2001 From: Matt McCormick Date: Tue, 21 Apr 2026 09:51:19 -0400 Subject: [PATCH 2/5] ENH: Bump ITK version to 5.4.6 --- CMakeLists.txt | 4 ++-- itkVersion.py | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 3367848d..230f82a4 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -94,8 +94,8 @@ if(ITKPythonPackage_SUPERBUILD) set(ITK_REPOSITORY "https://github.com/InsightSoftwareConsortium/ITK.git") - # release-5.4 branch, 2025-11-21 - set(ITK_GIT_TAG "v5.4.5") + # release-5.4 branch, 2026-04-21 + set(ITK_GIT_TAG "v5.4.6") #----------------------------------------------------------------------------- # A separate project is used to download ITK, so that it can reused diff --git a/itkVersion.py b/itkVersion.py index 717bad72..32e0d246 100644 --- a/itkVersion.py +++ b/itkVersion.py @@ -1,4 +1,4 @@ -VERSION = '5.4.5' +VERSION = '5.4.6' def get_versions(): """Returns versions for the ITK Python package. From 4159ac548554335d73c285fce1512fcc5ab16f31 Mon Sep 17 00:00:00 2001 From: Matt McCormick Date: Thu, 25 Jun 2026 15:17:53 -0400 Subject: [PATCH 3/5] PERF: Set the default threader to Pool Continue to enable TBB support, but change the default threader to Pool. TBB can exhibit decreased performance in some cases, and it seems that more refinement is needed with the number of work units, etc. See: https://discourse.itk.org/t/8x-slower-registration-with-itk-elastix-python-api-vs-elastix-cli-minimal-reproducible-example/7736 https://github.com/InsightSoftwareConsortium/ITKElastix/issues/391 This setting is consistent with the libitk conda-forge build configuration. --- CMakeLists.txt | 1 + scripts/internal/manylinux-build-wheels.sh | 1 + scripts/macpython-build-wheels.sh | 1 + scripts/windows_build_wheels.py | 1 + 4 files changed, 4 insertions(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index 230f82a4..40e9576f 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -282,6 +282,7 @@ if(ITKPythonPackage_SUPERBUILD) -DWRAP_ITK_INSTALL_COMPONENT_PER_MODULE:BOOL=${install_component_per_module} -DITK_LEGACY_SILENT:BOOL=ON -DITK_WRAP_PYTHON:BOOL=ON + -DITK_DEFAULT_THREADER:STRING=Pool -DDOXYGEN_EXECUTABLE:FILEPATH=${DOXYGEN_EXECUTABLE} -DPython3_INCLUDE_DIR:PATH=${Python3_INCLUDE_DIR} -DPython3_LIBRARY:FILEPATH=${Python3_LIBRARY} diff --git a/scripts/internal/manylinux-build-wheels.sh b/scripts/internal/manylinux-build-wheels.sh index 11c30f61..7b1ec6d5 100755 --- a/scripts/internal/manylinux-build-wheels.sh +++ b/scripts/internal/manylinux-build-wheels.sh @@ -99,6 +99,7 @@ for PYBIN in "${PYBINARIES[@]}"; do --config-setting=cmake.define.Python3_EXECUTABLE:FILEPATH=${Python3_EXECUTABLE} \ --config-setting=cmake.define.Python3_INCLUDE_DIR:PATH=${Python3_INCLUDE_DIR} \ --config-setting=cmake.define.Module_ITKTBB:BOOL=ON \ + --config.setting=cmake.define.ITK_DEFAULT_THREADER:STRING=Pool \ --config-setting=cmake.define.TBB_DIR:PATH=${tbb_dir} \ . diff --git a/scripts/macpython-build-wheels.sh b/scripts/macpython-build-wheels.sh index 2985aa87..cea66fff 100755 --- a/scripts/macpython-build-wheels.sh +++ b/scripts/macpython-build-wheels.sh @@ -180,6 +180,7 @@ for VENV in "${VENVS[@]}"; do -DITK_WRAP_DOC:BOOL=ON \ -DModule_ITKTBB:BOOL=${use_tbb} \ -DTBB_DIR:PATH=${tbb_dir} \ + -DITK_DEFAULT_THREADER:STRING=Pool \ ${CMAKE_OPTIONS} \ -G Ninja \ ${source_path} \ diff --git a/scripts/windows_build_wheels.py b/scripts/windows_build_wheels.py index 20372729..28a20bf7 100644 --- a/scripts/windows_build_wheels.py +++ b/scripts/windows_build_wheels.py @@ -85,6 +85,7 @@ def build_wrapped_itk( "-DITK_WRAP_DOC:BOOL=ON", "-DDOXYGEN_EXECUTABLE:FILEPATH=C:/P/doxygen/doxygen.exe", "-DModule_ITKTBB:BOOL=ON", + "-DITK_DEFAULT_THREADER:STRING=Pool", "-DTBB_DIR:PATH=%s" % tbb_dir, "-G", "Ninja", source_path From 3cf7528a6b8b03c096e3e800cb5cec7d7af4d44b Mon Sep 17 00:00:00 2001 From: Matt McCormick Date: Wed, 22 Jul 2026 09:22:12 -0400 Subject: [PATCH 4/5] ENH: Bump ITK version to 5.4.7 --- CMakeLists.txt | 4 ++-- itkVersion.py | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 40e9576f..28b5cab5 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -94,8 +94,8 @@ if(ITKPythonPackage_SUPERBUILD) set(ITK_REPOSITORY "https://github.com/InsightSoftwareConsortium/ITK.git") - # release-5.4 branch, 2026-04-21 - set(ITK_GIT_TAG "v5.4.6") + # release-5.4 branch, 2026-07-22 + set(ITK_GIT_TAG "v5.4.7") #----------------------------------------------------------------------------- # A separate project is used to download ITK, so that it can reused diff --git a/itkVersion.py b/itkVersion.py index 32e0d246..e6a95da4 100644 --- a/itkVersion.py +++ b/itkVersion.py @@ -1,4 +1,4 @@ -VERSION = '5.4.6' +VERSION = '5.4.7' def get_versions(): """Returns versions for the ITK Python package. From 84c6c7fbdc6116b98a6d19b5c52178a2719417d0 Mon Sep 17 00:00:00 2001 From: Axel Garcia Date: Tue, 1 Sep 2026 11:57:42 +0200 Subject: [PATCH 5/5] BUG: Avoid re-extracting the ITK build cache for module dependencies When building a module that depends on another ITK module (e.g. RTK depends on ITKCudaCommon), the ITK build cache is downloaded and extracted once in the parent directory. build-module-deps.sh then symlinks the module directory to that cache (ITKPythonPackage -> ../ITKPythonPackage) and used to re-run the full download-and-extract flow inside the module directory. Re-extracting in the module directory was problematic for two reasons: - Redundant: the same cache was just extracted in the parent directory with the same arguments, and the module directory writes through the symlink into that same shared tree. - Recent GNU tar (openat2 jailification, e.g. Ubuntu tar 1.35+dfsg-4ubuntu0.2+) fails with 'Invalid cross-device link' (EXDEV) when extracting members under ITKPythonPackage/ because the symlink escapes the extraction root. The module dependency build also registers the module (e.g. CudaCommon) into the shared ITK build tree (ITK_DIR) it builds against, so the registration must land in the tree the parent build reuses afterwards. Building against a module-local copy instead of the shared tree breaks serial module dependencies. Fix: when the parent already holds the extracted cache, build the module directly against the shared tree with dockcross-manylinux-build-module-wheels.sh, without re-extracting it. When no cache is available (standalone use of build-module-deps.sh), keep the full download-and-extract-and-build path. --- scripts/dockcross-manylinux-build-module-deps.sh | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/scripts/dockcross-manylinux-build-module-deps.sh b/scripts/dockcross-manylinux-build-module-deps.sh index dede51d3..0f9342d3 100755 --- a/scripts/dockcross-manylinux-build-module-deps.sh +++ b/scripts/dockcross-manylinux-build-module-deps.sh @@ -66,10 +66,13 @@ for MODULE_INFO in ${ITK_MODULE_PREQ_TOPLEVEL//:/ }; do if [[ -d ../ITKPythonPackage ]]; then ln -s ../ITKPythonPackage ln -s ./ITKPythonPackage/oneTBB-prefix + # Cache has already been downloaded, just build + ./ITKPythonPackage/scripts/dockcross-manylinux-build-module-wheels.sh "$@" + else + # No cache available, download it and build + echo "Building module dependency ${MODULE_NAME}" + ./dockcross-manylinux-download-cache-and-build-module-wheels.sh "$@" fi - - echo "Building module dependency ${MODULE_NAME}" - ./dockcross-manylinux-download-cache-and-build-module-wheels.sh "$@" popd echo "Cleaning up module dependency"