Skip to content

COMP: Build against ITK 6 - #3

Merged
hjmjohnson merged 3 commits into
InsightSoftwareConsortium:mainfrom
hjmjohnson:itk6-compat
Sep 24, 2026
Merged

hjmjohnson merged 3 commits into
InsightSoftwareConsortium:mainfrom
hjmjohnson:itk6-compat

Conversation

@hjmjohnson

Copy link
Copy Markdown
Member

Make the Python wrapping produce a module for the first time, and use ITK_DISALLOW_COPY_AND_MOVE for ITK 6. All three fixes also apply to ITK 5.4.

Wrapping defects
  • itk_wrap_module() named the filter rather than the module EntropyBasedIntensityCorrection that itk-module.cmake declares.
  • The .wrap file named itk::EntropyBasedIntensityCorrection, so the machinery looked for a header that does not exist, and instantiated the class with two template arguments where the filter takes three.
Verification

Configured with ITK_DIR pointing at an installed ITK 6 tree (upstream main as of 2026-09-22, ITK_WRAP_PYTHON=ON), built the module and its Python wrapping, and imported the wrapped module from Python. The module still builds against ITK 5.4.

The Python wrapping for this module has never produced a module. Three
independent defects, all of which also apply to ITK 5.4:

itk_wrap_module() named the filter rather than the ITK module, so the
generated sources did not match the module EntropyBasedIntensityCorrection
that itk-module.cmake declares.

The .wrap file named the class itk::EntropyBasedIntensityCorrection, from
which the wrapping machinery derives the header name, so it looked for
itkEntropyBasedIntensityCorrection.h. It also instantiated the class with two
template arguments; the filter takes three (TInputImage, TMaskImage,
TOutputImage).

ITK 6 turns ITK_DISALLOW_COPY_AND_ASSIGN into a static assertion asking for
ITK_DISALLOW_COPY_AND_MOVE, which ITK 5.4 defines as well.
@hjmjohnson
hjmjohnson marked this pull request as ready for review September 22, 2026 16:05
Every source file's header used the retired "Copyright Insight Software
Consortium" line instead of "Copyright NumFOCUS", and the Apache License
URL was missing its scheme's final letter (http, not https). Both are
checked verbatim against Utilities/KWStyle/ITKHeader.h, so
EntropyBasedIntensityCorrectionKWStyleTest failed on every file.
InsightSoftwareConsortium/ITKClangFormatLinterAction renamed its default
branch from master to main, so @master no longer resolves and the lint
job fails before running. Also bumps actions/checkout from the
long-deprecated v1 to v4, matching sibling remote modules.
@hjmjohnson
hjmjohnson merged commit 8d613ac into InsightSoftwareConsortium:main Sep 24, 2026
7 of 27 checks passed
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.

2 participants