Skip to content

ENH: Ingest ITKVariationalRegistration into Modules/Registration/VariationalRegistration#6276

Merged
dzenanz merged 180 commits into
InsightSoftwareConsortium:mainfrom
hjmjohnson:ingest-VariationalRegistration
May 20, 2026
Merged

ENH: Ingest ITKVariationalRegistration into Modules/Registration/VariationalRegistration#6276
dzenanz merged 180 commits into
InsightSoftwareConsortium:mainfrom
hjmjohnson:ingest-VariationalRegistration

Conversation

@hjmjohnson

Copy link
Copy Markdown
Member

Ingest the ITKVariationalRegistration remote module into Modules/Registration/VariationalRegistration (group: Registration). Source upstream: InsightSoftwareConsortium/ITKVariationalRegistration. Tracking issue: #6160.

Ingest stats
  • Commits: 170 (including 28 merge commits -- Mode A topology preserved per Utilities/Maintenance/RemoteModuleIngest/INGESTION_STRATEGY.md)
  • Files installed under Modules/Registration/VariationalRegistration/: 82
  • Approx. content size: 378 KiB
  • Tip SHA: 4f2adde59d738dd57f6ea32b9ee3eef9a40b31f5
External-data fixtures

CID / .sha512 content-links present in this ingest:

  • Modules/Registration/VariationalRegistration/test/Baseline/VariationalRegistrationCurvature2DTest.tif.cid
  • Modules/Registration/VariationalRegistration/test/Baseline/VariationalRegistrationDiffeomorph2DTest.tif.cid
  • Modules/Registration/VariationalRegistration/test/Baseline/VariationalRegistrationDiffeomorph3DTest.nii.gz.cid
  • Modules/Registration/VariationalRegistration/test/Baseline/VariationalRegistrationDiffusive2DTest.tif.cid
  • Modules/Registration/VariationalRegistration/test/Baseline/VariationalRegistrationDiffusive3DTest.nii.gz.cid
  • Modules/Registration/VariationalRegistration/test/Baseline/VariationalRegistrationElastic2DTest.tif.cid
  • Modules/Registration/VariationalRegistration/test/Baseline/VariationalRegistrationElastic3DTest.nii.gz.cid
  • Modules/Registration/VariationalRegistration/test/Baseline/VariationalRegistrationGaussian2DTest.tif.cid
  • Modules/Registration/VariationalRegistration/test/Baseline/VariationalRegistrationGaussian3DTest.nii.gz.cid
  • Modules/Registration/VariationalRegistration/test/Baseline/VariationalRegistrationNCC2DTest.tif.cid
  • Modules/Registration/VariationalRegistration/test/Baseline/VariationalRegistrationNCC3DTest.nii.gz.cid
  • Modules/Registration/VariationalRegistration/test/Baseline/VariationalRegistrationPassiveDemons2D.tif.cid
  • Modules/Registration/VariationalRegistration/test/Baseline/VariationalRegistrationSSD2DTest.tif.cid
  • Modules/Registration/VariationalRegistration/test/Baseline/VariationalRegistrationSSD3DTest.nii.gz.cid
  • Modules/Registration/VariationalRegistration/test/Baseline/VariationalRegistrationSymDiff2DTest.tif.cid
  • Modules/Registration/VariationalRegistration/test/Baseline/VariationalRegistrationSymDiff3DTest.nii.gz.cid
  • Modules/Registration/VariationalRegistration/test/Baseline/VariationalRegistrationSymmetricDemons2DTest.tif.cid
  • Modules/Registration/VariationalRegistration/test/Input/10-P_5x5x5.nii.gz.cid
  • Modules/Registration/VariationalRegistration/test/Input/60-P_5x5x5.nii.gz.cid
  • Modules/Registration/VariationalRegistration/test/Input/img1.png.cid
  • Modules/Registration/VariationalRegistration/test/Input/img2.png.cid

If any fixtures resolve via ITKTestingData, that repo must contain the matching content-link before this PR can merge cleanly.

Follow-on commits (on top of the unrelated-histories merge)
  • 4f2adde COMP: Enable VariationalRegistration module after ingest
  • 16609c2 ENH: Convert from md5 to .cid tags.
  • 18958ea ENH: Bump ITK and change http to https
  • 1e6455d STYLE: Rename ITK_DISALLOW_COPY_AND_ASSIGN to ITK_DISALLOW_COPY_AND_MOVE
  • 9d92357 COMP: No compiled libraries, only executables

aschmiri and others added 30 commits August 28, 2013 10:06
Updated CMakeLists.txt for tests and newer ITK style.
Added input images and Baseline images for the tests.
…pacing

in VariationalRegistrationNCCFunction and VariationalRegistrationSSDFunction.
Remove option to return unscaled time step.
…ages of

the 2D tests. Dont use image spacing for Gaussian regularization (unintended results).
Conflicts:
	src/VariationalRegistrationMain.cxx
@hjmjohnson

Copy link
Copy Markdown
Member Author

/azp run

2 similar comments
@hjmjohnson

Copy link
Copy Markdown
Member Author

/azp run

@hjmjohnson

Copy link
Copy Markdown
Member Author

/azp run

@hjmjohnson

Copy link
Copy Markdown
Member Author

@greptileai review

@thewtex

thewtex commented May 18, 2026

Copy link
Copy Markdown
Member

Addressed the remaining greptile findings:

  1. Wrap file typo — already fixed in follow-on commits (file is correctly named itkVariationalDiffeomorphicRegistrationFilter.wrap)
  2. Deprecated CMake idioms — already fixed (target_include_directories and target_compile_definitions in use)
  3. ODR hazardRegisterRequiredFactories() already marked inline
  4. BSD 4-clause license — removed the advertising clause (clause 3) from both getopt.c and getopt.h, converting to BSD 3-clause. UCB and NetBSD rescinded this clause in 1999.
  5. Dead commented-out code — removed the defunct ExternalData URL lines from test/CMakeLists.txt

These files are only compiled on WIN32+MSVC as a compatibility shim.

hjmjohnson and others added 12 commits May 19, 2026 09:12
Brings VariationalRegistration from a configure-time remote fetch into the ITK
source tree at Modules/Registration/VariationalRegistration/ using the v4 ingestion
pipeline (whitelist filter-repo + per-commit clang-format + black +
commit-prefix sanitization).

Upstream repo:  https://github.com/InsightSoftwareConsortium/ITKVariationalRegistration.git
Upstream tip:   1941db6bec69fe9332fe6cbec8b0256941facaa9
Ingest date:    2026-05-14
Whitelist:      default.list

Per-commit transforms applied across all 168 commits:
  - filter-repo --paths-from-file (whitelist)
  - filter-repo --to-subdirectory-filter Modules/Registration/VariationalRegistration
  - clang-format -style=file (ITK main's .clang-format) for *.cxx/.h/.hxx/...
  - black for *.py
  - heuristic ITK prefix added to commit subjects without one

Merge topology preserved: 35 -> 27 merge(s).

Primary author: aschmiri <a.schmidtrichberg@gmail.com>

Co-authored-by: Alexander Schmidt-Richberg <a.schmidtrichberg@gmail.com>
Co-authored-by: aschmiri <a.schmidt-richberg@imperial.ac.uk>
Co-authored-by: aschmiri <alexander.schmidt-richberg@philips.com>
Co-authored-by: bvadmin <bvadmin@elmo.imi.uni-luebeck.de>
Co-authored-by: bvadmin <bvadmin@ErnieLinux.(none)>
Co-authored-by: Dženan Zukić <dzenan.zukic@kitware.com>
Co-authored-by: ehrhardt <ehrhardt@imi.uni-luebeck.de>
Co-authored-by: Francois Budin <francois.budin@gmail.com>
Co-authored-by: Hans J. Johnson <hans-johnson@uiowa.edu>
Co-authored-by: Hans Johnson <hans-johnson@uiowa.edu>
Co-authored-by: Jan <jan@ErnieLinux.(none)>
Co-authored-by: Jan Ehrhardt <ehrhardt@imi.uni-luebeck.de>
Co-authored-by: Jon Haitz Legarreta <jhlegarreta@vicomtech.org>
Co-authored-by: Jon Haitz Legarreta Gorroño <jon.haitz.legarreta@gmail.com>
Co-authored-by: Mathew Seng <mathewseng@gmail.com>
Co-authored-by: Matt McCormick <matt.mccormick@kitware.com>
Co-authored-by: Matt McCormick <matt@mmmccormick.com>
Co-authored-by: Rene Werner <r.werner@uke.de>
Co-authored-by: Tom Birdsong <tom.birdsong@kitware.com>
Co-authored-by: Zach Williamson <zachary-williamson@uiowa.edu>
Remove the configure-time fetch stub in Modules/Remote/ now that the
sources live at Modules/Registration/VariationalRegistration/, enable
Module_VariationalRegistration in the configure-ci pixi task, and
absorb a residual clang-format fixup in the K&R-style win32 getopt.c
that pre-commit caught after the ingest merge.
The wrap files referenced itk::VariationalDiffeomophicRegistrationFilter
(missing 'r') which would fail Python wrapping compilation. Rename
files and class reference to match the actual C++ class name
VariationalDiffeomorphicRegistrationFilter.
The function was defined in a header without inline, which would
trigger a multiple-definition linker error if the header is ever
included in more than one translation unit.
Replace directory-scoped include_directories with target-scoped
target_include_directories, add the missing module include/ path so
the example executable finds module headers, and replace the
deprecated COMPILE_FLAGS target property with target_compile_definitions
for USE_2D_IMPL.
The ten ITKIO* modules are required only by the standalone example
executable's RegisterRequiredFactories(), not by the header-only
library. Moving them to PRIVATE_DEPENDS prevents every downstream
consumer from being forced to link all ten IO backends transitively.
The IPFS CIDs for VariationalRegistrationElastic2DTest.tif and
VariationalRegistrationCurvature2DTest.tif (bafkrei...la and
bafkrei...s4) are not retrievable through any IPFS gateway
(dweb.link, ipfs.io, w3s.link all return 504) and the Populate
ExternalData cache job rejects partial caches.

Replace the .cid content links with .sha512 content links matching
the upstream ITKVariationalRegistration test baselines; the blobs
are present on data.kitware.com and resolve through ITK's existing
sha512 ExternalData URL template.
The example executables (VariationalRegistration and
VariationalRegistration2D) previously linked against
${VariationalRegistration_LIBRARIES}, which is never populated
because the module exposes no compiled library sources of its own.
This caused undefined references to itk::DataObjectError and
itk::InvalidRequestedRegionError at link time on macOS / Linux /
Windows Pixi-Cxx builds.

Enumerate the module DEPENDS / PRIVATE_DEPENDS targets directly so
the example resolves itk::Exception and image IO symbols
deterministically from inside the ITK source tree.
- itk-module.cmake: replace placeholder DESCRIPTION with substantive
  one-liner describing the demons / diffeomorphic / curvature-based
  variational registration filters with multi-resolution support.
- src/CMakeLists.txt: use CMAKE_CURRENT_LIST_DIR instead of
  CMAKE_CURRENT_SOURCE_DIR for example-executable target_include_directories
  (and the WIN32 win32_compatibility branch).  CMAKE_CURRENT_LIST_DIR is
  the directory of the currently-processed CMakeLists file, which is the
  more robust idiom inside an included subdirectory.
…ink list

ITKImageFilterBase, ITKFiniteDifference, ITKDisplacementField,
ITKRegistrationCommon, and ITKBinaryMathematicalMorphology are
header-only ITK modules (no src/ directory, no compiled library).
Passing them to target_link_libraries caused CMake to emit bare
`-lITKImageFilterBase` etc. on the link line, which the linker
could not resolve:

  ld: library not found for -lITKImageFilterBase

The headers from these modules remain available via the module
DEPENDS include-path propagation, so dropping them from the
example link list is sufficient to fix macOS / Linux Pixi-Cxx
builds without losing any compile-time access.
Test2D appended a bare "-O ${OutParam}" even when OutputExt was empty,
so OutParam was unset and the test driver invoked the CLI with a
trailing "-O" and no value. getopt ("O:" requires an argument) aborted
the CLI before any output was written, so --compare then failed with
"Could not create IO object". Build the optional -O <file> pair only
when an output extension is given.
13 CLI registration tests compare against baselines inherited from the
archived remote module that do not match ITK-proper's deterministic
output, and whose source is unrecoverable. The deltas are not
bit-portable across platforms, so neither baseline regeneration from a
single platform nor a blanket tolerance is safe. Disable them pending a
cross-platform baseline review tracked in InsightSoftwareConsortium#6305 (parity with the
already-disabled Curvature3D). Diffeomorph2D and the driver/print-help
tests remain enabled.
@hjmjohnson hjmjohnson force-pushed the ingest-VariationalRegistration branch from 2f9f6e1 to b1780a3 Compare May 19, 2026 14:12
@hjmjohnson hjmjohnson requested review from dzenanz and thewtex May 20, 2026 11:03
@dzenanz dzenanz merged commit 00e9d12 into InsightSoftwareConsortium:main May 20, 2026
19 of 20 checks passed
@dzenanz

dzenanz commented May 20, 2026

Copy link
Copy Markdown
Member

After merging:

[7409/7580] Generating /home/runner/work/ITK/ITK/build/ExternalData/Modules/Filtering/GenericLabelInterpolator/test/Baseline/gl_gaussian_3.mha
FAILED: [code=1] ExternalData/Modules/Filtering/GenericLabelInterpolator/test/Baseline/gl_gaussian_3.mha-hash-stamp ExternalData/Modules/Filtering/GenericLabelInterpolator/test/Baseline/gl_gaussian_3.mha /home/runner/work/ITK/ITK/build/ExternalData/Modules/Filtering/GenericLabelInterpolator/test/Baseline/gl_gaussian_3.mha-hash-stamp /home/runner/work/ITK/ITK/build/ExternalData/Modules/Filtering/GenericLabelInterpolator/test/Baseline/gl_gaussian_3.mha 
cd /home/runner/work/ITK/ITK/build && /home/runner/work/ITK/ITK/.pixi/envs/cxx/bin/cmake -Drelative_top=/home/runner/work/ITK/ITK/build -Dfile=/home/runner/work/ITK/ITK/build/ExternalData/Modules/Filtering/GenericLabelInterpolator/test/Baseline/gl_gaussian_3.mha -Dname=/home/runner/work/ITK/ITK/Modules/Filtering/GenericLabelInterpolator/test/Baseline/gl_gaussian_3.mha -Dexts=.cid -DExternalData_ACTION=fetch -DExternalData_CONFIG=/home/runner/work/ITK/ITK/build/ITKData_config.cmake -P /home/runner/work/ITK/ITK/CMake/ExternalData.cmake
-- Fetching "https://insightsoftwareconsortium.github.io/ITKTestingData/CID/bafkreihi5ylz5qypvqfl3j4hglalh4cxxh64ooxi4bcqujvjbngys3wqlq"
-- Fetching "http://127.0.0.1:8080/ipfs/bafkreihi5ylz5qypvqfl3j4hglalh4cxxh64ooxi4bcqujvjbngys3wqlq"
-- Fetching "https://ipfs.io/ipfs/bafkreihi5ylz5qypvqfl3j4hglalh4cxxh64ooxi4bcqujvjbngys3wqlq"
-- Fetching "https://ipfs.filebase.io/ipfs/bafkreihi5ylz5qypvqfl3j4hglalh4cxxh64ooxi4bcqujvjbngys3wqlq"
-- Fetching "https://gateway.pinata.cloud/ipfs/bafkreihi5ylz5qypvqfl3j4hglalh4cxxh64ooxi4bcqujvjbngys3wqlq"
-- Fetching "https://cloudflare-ipfs.com/ipfs/bafkreihi5ylz5qypvqfl3j4hglalh4cxxh64ooxi4bcqujvjbngys3wqlq"
-- Fetching "https://dweb.link/ipfs/bafkreihi5ylz5qypvqfl3j4hglalh4cxxh64ooxi4bcqujvjbngys3wqlq"
-- Fetching "[https://data.kitware.com:443/api/v1/file/hashsum/CID/bafkreihi5ylz5qypvqfl3j4hglalh4cxxh64ooxi4bcqujvjbngys3wqlq/download](https://data.kitware.com/api/v1/file/hashsum/CID/bafkreihi5ylz5qypvqfl3j4hglalh4cxxh64ooxi4bcqujvjbngys3wqlq/download)"
-- Fetching "https://itk.org/files/ExternalData/CID/bafkreihi5ylz5qypvqfl3j4hglalh4cxxh64ooxi4bcqujvjbngys3wqlq"
CMake Error at /home/runner/work/ITK/ITK/CMake/ExternalData.cmake:1169 (message):


  Object CID=bafkreihi5ylz5qypvqfl3j4hglalh4cxxh64ooxi4bcqujvjbngys3wqlq not
  found at:

    https://insightsoftwareconsortium.github.io/ITKTestingData/CID/bafkreihi5ylz5qypvqfl3j4hglalh4cxxh64ooxi4bcqujvjbngys3wqlq ("HTTP response code said error")
    http://127.0.0.1:8080/ipfs/bafkreihi5ylz5qypvqfl3j4hglalh4cxxh64ooxi4bcqujvjbngys3wqlq ("Could not connect to server")
    https://ipfs.io/ipfs/bafkreihi5ylz5qypvqfl3j4hglalh4cxxh64ooxi4bcqujvjbngys3wqlq ("HTTP response code said error")
    https://ipfs.filebase.io/ipfs/bafkreihi5ylz5qypvqfl3j4hglalh4cxxh64ooxi4bcqujvjbngys3wqlq ("HTTP response code said error")
    https://gateway.pinata.cloud/ipfs/bafkreihi5ylz5qypvqfl3j4hglalh4cxxh64ooxi4bcqujvjbngys3wqlq ("HTTP response code said error")
    https://cloudflare-ipfs.com/ipfs/bafkreihi5ylz5qypvqfl3j4hglalh4cxxh64ooxi4bcqujvjbngys3wqlq ("Could not resolve hostname")
    https://dweb.link/ipfs/bafkreihi5ylz5qypvqfl3j4hglalh4cxxh64ooxi4bcqujvjbngys3wqlq ("HTTP response code said error")
    [https://data.kitware.com:443/api/v1/file/hashsum/CID/bafkreihi5ylz5qypvqfl3j4hglalh4cxxh64ooxi4bcqujvjbngys3wqlq/download](https://data.kitware.com/api/v1/file/hashsum/CID/bafkreihi5ylz5qypvqfl3j4hglalh4cxxh64ooxi4bcqujvjbngys3wqlq/download) ("HTTP response code said error")
    https://itk.org/files/ExternalData/CID/bafkreihi5ylz5qypvqfl3j4hglalh4cxxh64ooxi4bcqujvjbngys3wqlq ("HTTP response code said error")

hjmjohnson added a commit to InsightSoftwareConsortium/ITKVariationalRegistration that referenced this pull request May 27, 2026
…s repo

The VariationalRegistration module has been ingested into ITK main under Modules/Registration/VariationalRegistration via
InsightSoftwareConsortium/ITK#6276. Delete the whitelisted module
sources, preserve the original README, and promote the migration
notice to README.md so the GitHub landing page reflects archived
status.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:Python wrapping Python bindings for a class area:Registration Issues affecting the Registration module area:Remotes Issues affecting the Remote module type:Data Changes to testing data type:Enhancement Improvement of existing methods or implementation type:Infrastructure Infrastructure/ecosystem related changes, such as CMake or buildbots type:Testing Ensure that the purpose of a class is met/the results on a wide set of test cases are correct

Projects

None yet

Development

Successfully merging this pull request may close these issues.