Skip to content

COMP: Bump ANTs to current master + disable TractographyTRX for ITK6 compat#17

Open
hjmjohnson wants to merge 1 commit into
netstim:masterfrom
hjmjohnson:itk6-compat-bump-ants
Open

COMP: Bump ANTs to current master + disable TractographyTRX for ITK6 compat#17
hjmjohnson wants to merge 1 commit into
netstim:masterfrom
hjmjohnson:itk6-compat-bump-ants

Conversation

@hjmjohnson

Copy link
Copy Markdown

Bump Slicer_ants_GIT_TAG to current ANTsX/ANTs master and disable the new USE_TractographyTRX option so SlicerANTs builds against ITK upstream main (v6 prep) and stays buildable against ITK 5.x.

Why this is needed

ITK upstream main (in preparation for v6) has trimmed transitive includes. With the previously-pinned ANTs 8c4e2077 (2024-09-10), the file Utilities/itkSurfaceImageCurvature.{h,hxx} uses itk::ImageRegionIteratorWithIndex without an explicit #include <itkImageRegionIteratorWithIndex.h>. Under ITK main this fails with 48 errors:

.../itkSurfaceImageCurvature.h:59:11: error: ‘ImageRegionIteratorWithIndex’ does not name a type
.../itkSurfaceImageCurvature.hxx:104:3: error: ‘ImageIteratorType’ was not declared in this scope

The fix is already in ANTsX/ANTs master (Utilities/itkSurfaceImageCurvature.h now #includes the iterator header directly). Bumping the pin pulls it in.

The newer ANTs also adds an antsApplyTransformsToTRX / PrintTRXHeader example app that requires the Module_TractographyTRX ITK module plus a trx_cpp external dependency, both of which aren't present in Slicer's ITK build. Disabling them via -DUSE_TractographyTRX:BOOL=OFF keeps the rest of ANTs building.

Backward compatibility
  • The added #include <itkImageRegionIteratorWithIndex.h> in itkSurfaceImageCurvature.h makes explicit a transitive include that already worked under ITK 5.x — harmless on the older toolchain.
  • -DUSE_TractographyTRX:BOOL=OFF is a no-op against the previous ANTs pin (the option didn't exist there).
  • ANTs upstream master SuperBuild.cmake uses set(ITK_EXTERNAL_NAME ITKv${ITK_VERSION_MAJOR}) — explicitly supporting both ITK 5 and 6.
Verified

Compiled clean against Slicer host built with:

  • ITK from Slicer/ITK branch slicer-upstream-main-namespace-2026-05-10 (= InsightSoftwareConsortium/ITK main 59176b1d + 1 commit: opt-in itkNamespace.h shim)
  • ITK_FUTURE_LEGACY_REMOVE=ON
  • Qt 6.8.2, gcc 13.3, Linux x86_64
  • ccache compiler launcher

Produces:

  • bin/antsRegistration
  • lib/Slicer-5.11/cli-modules/libantsRegistrationCLILib.so
  • lib/Slicer-5.11/libl_antsRegistration.so
  • lib/Slicer-5.11/libl_antsApplyTransforms.so
  • lib/Slicer-5.11/libantsUtilities.so

ITK 5.4.6 verification is queued through a dual-target dashboard
(make extensions-itk546 extensions-itk-main against the Slicer/ExtensionsIndex
catalog) — will report results back to this PR if any change is required.

Tracking

Part of the broader Slicer ITK6 transition effort tracked at
Slicer/Slicer#9149.

…compat

Bump Slicer_ants_GIT_TAG from 8c4e2077 (2024-09-10) to ad0e6a1d (current
ANTsX/ANTs master).

The newer ANTs source adds an explicit `#include <itkImageRegionIteratorWithIndex.h>`
in `Utilities/itkSurfaceImageCurvature.{h,hxx}`, which is required when building
against ITK upstream main (v6 prep) where the transitive include chain has been
trimmed. The include is harmless under ITK 5.x (the header has always existed),
so the change is backward compatible.

Also disable the new `USE_TractographyTRX` option (default ON in ANTs upstream).
The TRX-tractography apps require the Module_TractographyTRX ITK module plus
trx_cpp, which are not part of Slicer's ITK build. With this option OFF, the
TRX example apps (PrintTRXHeader, antsApplyTransformsToTRX) are excluded from
the build.

Verified to compile against:
  - ITK upstream main (InsightSoftwareConsortium/ITK @ 59176b1d + opt-in
    itkNamespace.h shim, used by Slicer/ITK fork) with
    ITK_FUTURE_LEGACY_REMOVE=ON, Qt 6.8.2, gcc 13.3.
  - (ITK 5.4.6 verification pending separate dual-target dashboard.)
@hjmjohnson hjmjohnson marked this pull request as ready for review May 11, 2026 14:05
@hjmjohnson

Copy link
Copy Markdown
Author

@simonoxen FYI: Preparing Slicer for ITKv6 additions. ANTs has supported ITKv6 for quite a while.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant