Skip to content

ENH: Ingest ITKMontage remote module into Modules/Registration/Montage#6103

Open
hjmjohnson wants to merge 540 commits intoInsightSoftwareConsortium:mainfrom
hjmjohnson:ingest-Montage
Open

ENH: Ingest ITKMontage remote module into Modules/Registration/Montage#6103
hjmjohnson wants to merge 540 commits intoInsightSoftwareConsortium:mainfrom
hjmjohnson:ingest-Montage

Conversation

@hjmjohnson
Copy link
Copy Markdown
Member

@hjmjohnson hjmjohnson commented Apr 22, 2026

Second representative case study for the whitelist-based remote-module ingest tooling (after AnisotropicDiffusionLBR in #6093, tooling from #6098 — both merged). Brings the ITKMontage phase-correlation / mosaic-stitching module in-tree under Modules/Registration/Montage, migrates its content-links to CID, and bumps the PerformanceBenchmarking remote-module pin to current upstream.

Re-ingested 2026-04-23 on top of current upstream/main (no longer stacks on #6109).

Merge-blocker: Montage CID blob upload is still outstanding (CIDs are in-tree but blobs aren't reachable on any ExternalData mirror; Pixi-Cxx will 404 until that's done).

Commit stack (top → bottom)
cb456a6636  ENH:   Bump PerformanceBenchmarking remote pin to latest master
a8dd62e9dd  COMP:  Drop unused upstream _meta.xml archives + fix _readme.txt EOLs
c3c82834c9  STYLE: Apply ITK gersemi formatting to ingested Montage
58957fc57b  ENH:   Enable Montage in CI via configure-ci
96dd8f0bd9  COMP:  Remove Montage.remote.cmake; now in-tree
36f8cd0bce  DOC:   Add README.md pointing at archived upstream for Montage
ad090f854b  COMP:  Fix upstream itk-module.cmake README.md read in ingested Montage
487f7a223a  ENH:   Ingest ITKMontage into Modules/Registration   [merge, upstream history]
4d2cae5430  (upstream/main)

The previous .sha512→.cid migration commit became empty after re-ingest because upstream ITKMontage now provides .cid files directly (its commit 794db52b77 ENH: Convert from md5 to .cid tags. is included in the ingested merge).

CID migration status (MERGE BLOCKER)
  • Conversion done in-tree. All Montage content-links under Modules/Registration/Montage/test/Input/ are .cid files (now provided directly by upstream).
  • Blob upload outstanding. Spot-checked CIDs against the ITKTestingData mirror return HTTP 404. Blobs have not yet been pushed. Pixi-Cxx will keep failing with the "9 mirrors all 404" pattern until this is done.

Required before merge:

./Utilities/Maintenance/RemoteModuleIngest/cid-upload.sh   Modules/Registration/Montage
./Utilities/Maintenance/RemoteModuleIngest/verify-cid-access.sh Modules/Registration/Montage
PerformanceBenchmarking pin bump

Modules/Remote/PerformanceBenchmarking.remote.cmake GIT_TAG advanced from 7950c1d76095 (~2024) to 63fec3013cccfe7e8b1b88a1d2d889f7e64e4469 (upstream master tip, 2026-04-23). Brings in:

  • cf89d96e ENH: ASV-over-native-ITK performance benchmark harness
  • 41bf1b9c BUG: Harden CopyIterationBenchmark against ITK 1d87efa+ regression
  • ddeb770b ENH: Convert from md5 to .cid tags
  • b24324f9 COMP: Use ITK default branch origin/main in ASV config and docs
  • 63fec301 COMP: Drop unused InputPixelType typedefs in CopyIterationBenchmark

The asv CI (PR #612, which consumes this remote module) is separately blocked on ddeb770b's blob upload. The Montage side of this PR is independent.

What is intentionally NOT ingested (Montage)

Excluded by the whitelist:

  • examples/ — applied demonstration code + sample datasets. Stays in the archived upstream; selected examples may relocate to top-level Examples/ in a follow-up PR.
  • LICENSE — ITK's own Apache 2.0 license covers the in-tree module.
  • pyproject.toml, requirements.txt — standalone-repo packaging.
  • CTestConfig.cmake — pointed at a standalone CDash project that no longer applies in-tree.
  • .github/workflows/ — upstream CI config; ITK's in-tree CI covers the module.

See Modules/Registration/Montage/README.md for the full rationale.

Post-merge follow-ups
  1. Open an archival PR on InsightSoftwareConsortium/ITKMontage that (a) deletes the whitelisted files, (b) adds MIGRATION_README.md pointing at ITK in-tree, (c) states intent to archive.
  2. Open a follow-up PR on ITK that selectively moves examples/ content worth keeping into top-level Examples/.
  3. BibTeX reference-format sweep across Montage docs (dzenanz suggestion, 2026-04-22).

dzenanz and others added 30 commits May 10, 2019 17:31
Fix unused variable warning.

Fixes:
```
Modules/Remote/Montage/include/itkMaxPhaseCorrelationOptimizer.hxx:305:10:
warning: unused variable 'confidenceFactor' [-Wunused-variable]
```

raised at:
http://testing.cdash.org/viewBuildError.php?type=1&buildid=5914663
…UnusedVariableWarning

COMP: Fix unused variable warning
If on-disk images have non-unit spacing, this is correctly passed to the
montaging classes. This uncovers some bugs regarding proper spacing support.
ITK does not have proper support for spacing specification in PNG.
sCAL chunk is supported, pHYs chunk is not, see discussion
https://itk.org/pipermail/insight-users/2012-December/046756.html
and proposed patch https://review.source.kitware.com/%23/c/8884/
So we keep unit spacing for some of the tests using PNG input images.
If there was an empty line in a file with CRLF line endings
it would cause a crash. This was due to CR character being
removed after emptiness was checked.
This can cause ratio to be greater than 1.0, causing sine to be NaN,
resulting in NaN being peak index and thus translation, potentially
ruining the whole montage.
Move synthetic, numerous and other outputs which are
not usually examined by hand into a sub-directory.

Removing the word Test from test names.
That makes the tests shorter and easier to distinguish.
* use Eigen (built into ITK)
* computing the positions works
* calculated residuals
* outlier removal
* use alternative registration candidates
* reduce weight instead of eliminate equations
* calculate outlier scores based on standard deviation
* use zero-mean standard deviation for outlier score
* use outlierScore in cost calculation
* nudge towards zero
* use outlier detection on translations instead of positions
* score is an outlier only if it deviates by more than 3
* reducing amount of debug output using #ifndef NDEBUG
* tweaking parameters
* cleaning up debugging output
* exposing outlier detection thresholds
dzenanz and others added 9 commits September 2, 2024 10:26
Co-authored-by: Matt McCormick <matt@mmmccormick.com>
…acro

Added two new macro's, intended to replace the old 'itkTypeMacro' and
'itkTypeMacroNoParent'.

The main aim is to be clearer about what those macro's do: add a virtual
'GetNameOfClass()' member function and override it. Unlike 'itkTypeMacro',
'itkOverrideGetNameOfClassMacro' does not have a 'superclass' parameter, as it
was not used anyway.

Note that originally 'itkTypeMacro' did not use its 'superclass' parameter
either, looking at commit 699b66c, Will
Schroeder, June 27, 2001:
https://github.com/InsightSoftwareConsortium/ITK/blob/699b66cb04d410e555656828e8892107add38ccb/Code/Common/itkMacro.h#L331-L337
For the sake of code readability, a new 'CoordinateType' alias is added for
each nested 'CoordRepType' alias. The old 'CoordRepType' aliases will still be
available with ITK 6.0, but it is recommended to use 'CoordinateType' instead.
The 'CoordRepType' aliases will be removed when 'ITK_FUTURE_LEGACY_REMOVE' is
enabled. Similarly, 'InputCoordinateType', 'OutputCoordinateType', and
'ImagePointCoordinateType' replace 'InputCoordRepType', 'OutputCoordRepType',
and 'ImagePointCoordRepType', respectively.
…Consortium/use-CoordinateType

General code style and CI update for ITK 5.4.2
Montage/include/itkPhaseCorrelationOptimizer.h: In static member
function ‘static const
std::initializer_list<itk::PhaseCorrelationOptimizerEnums::PeakInterpolationMethod>
itk::PhaseCorrelationOptimizerEnums::AllPeakInterpolationMethods()’:
Montage/include/itkPhaseCorrelationOptimizer.h:64:12: warning: returning
local ‘initializer_list’ variable ‘methods’ does not extend the lifetime
of the underlying array [-Winit-list-lifetime]
   64 |     return methods;
      |            ^~~~~~~
Montage/include/itkPhaseCorrelationOptimizer.h:57:58: note: declared
here 57 |     const std::initializer_list<PeakInterpolationMethod>
methods{
      |                                                          ^~~~~~~
@github-actions github-actions Bot added the type:Enhancement Improvement of existing methods or implementation label Apr 22, 2026
Copy link
Copy Markdown
Member

@dzenanz dzenanz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Mostly looks good. Thank you for working on this Hans.

Comment thread Modules/Registration/Montage/test/CMakeLists.txt
@dzenanz
Copy link
Copy Markdown
Member

dzenanz commented Apr 22, 2026

Some ghostflow messages reminded me that we might want to convert references to BibTeX format introduced somewhat recently.

@hjmjohnson hjmjohnson force-pushed the ingest-Montage branch 2 times, most recently from dc06091 to 0a7a33a Compare April 23, 2026 02:37
@hjmjohnson hjmjohnson marked this pull request as ready for review April 23, 2026 12:55
@greptile-apps
Copy link
Copy Markdown
Contributor

greptile-apps Bot commented Apr 23, 2026

Too many files changed for review. (626 files found, 100 file limit)

@hjmjohnson hjmjohnson force-pushed the ingest-Montage branch 2 times, most recently from aa4104b to be308ba Compare April 23, 2026 13:01
Comment thread .github/workflows/arm.yml Outdated
restore-keys: |
ccache-v4-${{ runner.os }}-${{ matrix.name }}-

- name: Restore ExternalData object store
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This commit seems unrelated to Montage ingestion.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I now see that this PR is a test case for #6109.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Of course, remove from here after testing.

MODULE_COMPLIANCE_LEVEL 2
GIT_REPOSITORY https://github.com/InsightSoftwareConsortium/ITKPerformanceBenchmarking.git
GIT_TAG 7950c1d76095033edbf7601a925cdacc2fe717f9
GIT_TAG 63fec3013cccfe7e8b1b88a1d2d889f7e64e4469
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also unrelated to Montage. This should be a separate PR.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I guess this is testing too.

hjmjohnson and others added 8 commits April 23, 2026 19:37
Brings Montage from a configure-time remote fetch into the ITK
source tree at Modules/Registration/Montage/ using the v3 whitelist
filter-repo pipeline.

Upstream repo: https://github.com/InsightSoftwareConsortium/ITKMontage.git
Upstream tip:  f2ba56b24c81a0ac61639d349688d26673a65f73
Ingest date:   2026-04-24

Whitelist passes (git filter-repo):
  - --path include --path src --path test --path wrapping
  - --path CMakeLists.txt --path itk-module.cmake
  - --to-subdirectory-filter Modules/Registration/Montage
  - --prune-empty always
  - (if present) second pass: invert CTestConfig.cmake

Outcome: 697 upstream commits -> 532 surviving;
20 distinct authors preserved; git blame walks across the
merge boundary to original authors.

Content-link inventory: .md5=0  .shaNNN=0  .cid=558

Primary author: Dženan Zukić <dzenan.zukic@kitware.com>

Co-authored-by: Darren Thompson <darrent1974@users.noreply.github.com>
Co-authored-by: Dzenan Zukic <dzenan.zukic@kitware.com>
Co-authored-by: Francois Budin <francois.budin@kitware.com>
Co-authored-by: haaput <haaput@instem>
Co-authored-by: Hans J. Johnson <hans-johnson@uiowa.edu>
Co-authored-by: Hans Johnson <hans.j.johnson@gmail.com>
Co-authored-by: Hans Johnson <hans-johnson@uiowa.edu>
Co-authored-by: Joey Kleingers <joey.kleingers@bluequartz.net>
Co-authored-by: Jon Haitz Legarreta Gorroño <jon.haitz.legarreta@gmail.com>
Co-authored-by: Luis Ibanez <luis.ibanez@kitware.com>
Co-authored-by: Mathew J. Seng <mathewseng@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: Matt McCormick (thewtex) <matt@mmmccormick.com>
Co-authored-by: Michael Jackson <mike.jackson@bluequartz.net>
Co-authored-by: tabish <tabish@instem>
Co-authored-by: Tom Birdsong <40648863+tbirdso@users.noreply.github.com>
Co-authored-by: Tom Birdsong <tom.birdsong@kitware.com>
The upstream itk-module.cmake does `file(READ "${MY_CURRENT_DIR}/README.md"
DOCUMENTATION)` to populate the module description.  The whitelist-based
ingest excludes README.md from the ingested tree, so the READ fails at
configure time.  Replace with an inline `set(DOCUMENTATION ...)` that
gives Doxygen enough context without depending on any non-whitelisted
file.

Also dropped the commented-out `ITKIOHDF5` line and inline comments that
only made sense in the standalone upstream repo.
Upstream ITKMontage's CMakeLists.txt files predate the ITK gersemi
pre-commit hook.  Reformat the four ingested files to satisfy
.gersemi.config (0.19.3): expand itk_add_test() arg lists, normalize
command case, flatten short set() calls.

No functional change.
Two pre-commit issues in the ingested Montage test/Input tree:

1. Seven `_meta.xml` files (57 KB to 3 MB) are upstream-archive metadata
   dumps from the EM-imaging capture tool.  No test references them
   (grep across test/*.cxx is clean).  They rode in via the whitelist
   but serve no in-tree purpose, and four exceed ITK's 100 KB large-
   file threshold enforced by kw-pre-commit.  Deleted.

2. Two tiny `_readme.txt` files (`NoisyTiles/`, `Tiles/`) carried
   human-readable dataset provenance but lacked a trailing newline.
   Appended `\n` so `end-of-file-fixer` passes.

Archival provenance for the deleted `_meta.xml` files remains in the
upstream repository; nothing in-tree depends on them.
Advance the remote-module GIT_TAG from 7950c1d76095 (2024-era) to
63fec3013cccfe7e8b1b88a1d2d889f7e64e4469, the current tip of
InsightSoftwareConsortium/ITKPerformanceBenchmarking master
(2026-04-23), which includes:

  - 63fec301  COMP: Drop unused InputPixelType typedefs in
              CopyIterationBenchmark
  - b24324f9  COMP: Use ITK default branch origin/main in ASV config
              and docs
  - ddeb770b  ENH: Convert from md5 to .cid tags
  - 41bf1b9c  BUG: Harden CopyIterationBenchmark to not crash on ITK
              1d87efa+ regression
  - cf89d96e  ENH: Add ASV-over-native-ITK performance benchmark harness

Carries the new asv-native harness, the ITK-main-branch asv config,
the md5-to-.cid data-link migration, and the -Wunused-local-typedefs
cleanup.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

type:Enhancement Improvement of existing methods or implementation

Projects

None yet

Development

Successfully merging this pull request may close these issues.

8 participants