Skip to content

ENH: Consolidate remote modules into hierarchical category repos #6060

Closed

Description

@hjmjohnson

Consolidate remote modules into hierarchical category repos

Reduce ~60 remote module repos to ~5 domain-based category repos plus ~13 independent repos. New itk_fetch_module_group() CMake function enables hierarchical sub-groups. Proof of concept (ITKRemoteAnalysis, 8 modules, 77/77 tests pass) in PR #6061. Supersedes #5134.

Problem

ITK has ~60 remote module repositories, each with its own git repo, CI, Python packaging, and boilerplate:

Discussed in #6034 where @blowekamp, @dzenanz, and @hjmjohnson agreed consolidation is needed during the 6.0 beta phase.

Proposal

Group modules into 5 category repos by domain (per @thewtex and @dzenanz: no "Kitware" category, no standalone "Microscopy" — group by domain):

Category Repo Candidate Modules Count
ITKRemoteIO AnalyzeObjectLabelMap, IOFDF, IOMeshMZ3, IOMeshSTL, IOMeshSWC, IOScanco, IOTransformDCMTK, MGHIO, IOOpenSlide 9
ITKRemoteFiltering AnisotropicDiffusionLBR, FastBilateral, GenericLabelInterpolator, HigherOrderAccurateGradient, LabelErodeDilate, MorphologicalContourInterpolation, MultipleImageIterator, ParabolicMorphology, PhaseSymmetry, RLEImage, SimpleITKFilters, SmoothingRecursiveYvvGaussianFilter, SplitComponents 13
ITKRemoteMesh BSplineGradient, Cuberille, FPFH, MeshNoise, MeshToPolyData, PrincipalComponentsAnalysis, SubdivisionQuadEdgeMeshFilter 7
ITKRemoteAnalysis BoneEnhancement, BoneMorphometry, HASI, IsotropicWavelets, PerformanceBenchmarking, RANSAC, TextureFeatures, Thickness3D, (+ StructuralSimilarity from #6034) 8-9
ITKRemoteRegistration FixedPointInverseDisplacementField, GrowCut, LesionSizingToolkit, MinimalPathExtraction, Montage, PolarTransform, SkullStrip, Strain, TwoProjectionRegistration, VariationalRegistration 10

Stay independent (large, complex, or external dependencies):

  • RTK, CudaCommon (RTKConsortium)
  • TubeTK (large, many examples/applications — @dzenanz)
  • Ultrasound (complex multi-dependency, serves as blueprint — @dzenanz)
  • WebAssemblyInterface (wasm toolchain)
  • AdaptiveDenoising (ntustison — external maintainer)
  • Cleaver (SCIInstitute — external dependencies, defer — @dzenanz)
  • SCIFIO, Shape, TractographyTRX (external orgs)
  • SphinxExamples (documentation)
  • VkFFTBackend (GPU backend)
  • TotalVariation, IOOMEZarrNGFF (external dependencies, defer — @dzenanz)
  • BioCell (legacy, may deprecate)
CMake mechanism

New ITKGroup_Remote_<Category> sub-group options, all OFF by default:

ITKGroup_Remote = OFF              # master switch (existing)
  ITKGroup_Remote_IO = OFF         # NEW: fetches ITKRemoteIO repo when ON
  ITKGroup_Remote_Filtering = OFF
  ITKGroup_Remote_Mesh = OFF
  ITKGroup_Remote_Analysis = OFF
  ITKGroup_Remote_Registration = OFF
  • Sub-group OFF: repo not cloned, modules not available
  • Sub-group ON: repo cloned, all contained modules individually toggleable via Module_<name>
  • ITKGroup_Remote=ON: all sub-groups enabled (backward compat)
  • Modules with EXCLUDE_FROM_DEFAULT need explicit Module_<name>=ON even when sub-group is ON

~160 lines of CMake changes across 3 files. New itk_fetch_module_group() function. Existing itk_fetch_module() untouched (independent repos keep working).

Python packaging

Per-category wheels (itk-remote-io, itk-remote-filtering, etc.) replace individual itk-<name> packages. Old packages get a deprecation release pointing to the new category package.

New module workflow

New filters added as a subdirectory PR to the appropriate category repo. No new git repo, no new CI, no new PyPI package setup.

Example: SSIM (PR #6034) goes into ITKRemoteAnalysis as StructuralSimilarity/ subdirectory.

Implementation phases

Decisions

Question Decision Source
Category groupings 5 domain categories (IO, Filtering, Mesh, Analysis, Registration) @thewtex, @dzenanz
"Kitware" category No — merge by domain @thewtex, @dzenanz
Microscopy category No — IOOpenSlide goes to IO @dzenanz
KitwareMedical modules Merge into domain categories @thewtex, @dzenanz
TubeTK Stay independent (large, many examples) @dzenanz
Ultrasound Stay independent, serves as blueprint @dzenanz
External-dep modules Defer (TotalVariation, Cleaver, IOOMEZarrNGFF) @dzenanz
EXCLUDE_FROM_DEFAULT Respected: need explicit Module_<name>=ON Confirmed by prototype
Backward compat ITKGroup_Remote=ON enables all sub-groups Confirmed by prototype
Supersedes #5134 @dzenanz
AdaptiveDenoising (ntustison) TBD — discuss with maintainer
PyPI: individual to category wheels TBD
BioCell TBD — may deprecate

References

Activity

  1. thewtex commented on Apr 14, 2026

    @thewtex
    Member

    I don't think "Kitware" is a topic category and the modules should be added to the appropriate topics.

  2. dzenanz commented on Apr 14, 2026

    @dzenanz
    Member

    This consolidation sure would make any future refactoring easier. It would also supersede #5134.

    I don't think "Kitware" is a topic category and the modules should be added to the appropriate topics.

    I agree with this.

  3. dzenanz commented on Apr 14, 2026

    @dzenanz
    Member

    IOOpenSlide should be part of IO group, not a group by itself.

    TubeTK is quite big, with a lot of examples and applications. I would not group it with anything else.

    The main general problem with grouping is that some modules have external dependencies (e.g. TotalVariation, IOOMEZarrNGFF) which are hard to update, and require special build-related code. Maybe we should leave those alone for now?

  4. dzenanz commented on Apr 14, 2026

    @dzenanz
    Member

    Cleaver has external dependencies. As such, I would leave it alone, at least for the initial refactoring/grouping/combining.

  5. dzenanz commented on Apr 14, 2026

    @dzenanz
    Member

    Ultrasound is already quite a complicated module. It may serve as a blueprint for these combined thematic modules.

  6. hjmjohnson commented on Apr 14, 2026

    @hjmjohnson
    MemberAuthor

    Proof of concept complete

    Draft PR #6061 implements the CMake infrastructure and demonstrates it with an ITKRemoteAnalysis category repo containing 8 modules. All 77 tests pass across all 8 modules, with 1661 commits and full git blame preserved.

    Net result: −221 lines of CMake (106 new lines for itk_fetch_module_group(), 395 removed from 7 individual .remote.cmake files).

    What works
    • itk_fetch_module_group(Analysis ...) clones a multi-module repo into Modules/Remote/Analysis/
    • 4-level glob in ITKModuleEnablement.cmake discovers modules at Remote/Analysis/TextureFeatures/itk-module.cmake
    • ITKGroup_Remote_Analysis=ON requests all non-excluded modules; ITKGroup_Remote=ON propagates to all sub-groups
    • Individual Module_<name>=ON/OFF toggles work within an enabled sub-group
    • Git history fully preserved (1661 commits, blame works, old-to-new hash maps generated)
    • 77/77 tests pass across all 8 modules
    CMake changes required
    File Change Lines
    CMake/ITKModuleEnablement.cmake 4-level glob +1
    CMake/ITKModuleRemote.cmake itk_fetch_module_group() +106
    CMake/ITKGroups.cmake Sub-group request propagation +50
    Modules/Remote/ITKRemoteAnalysis.remote.cmake Category group file +17
    7 individual .remote.cmake files Removed -395
    Net -221 lines
    Decisions confirmed by the prototype
    Question Answer
    Module enable without sub-group Works: Module_X=ON requires sub-group enabled first (module won't be discovered otherwise)
    EXCLUDE_FROM_DEFAULT modules Respected: sub-group ON makes them available but not auto-built; need explicit Module_<name>=ON
    Backward compat ITKGroup_Remote=ON enables all sub-groups
    Independent modules Unaffected: itk_fetch_module() untouched
    ITKRemoteAnalysis repo contents
    • 8 modules: TextureFeatures, BoneMorphometry, BoneEnhancement, Thickness3D, IsotropicWavelets, RANSAC, PerformanceBenchmarking, StructuralSimilarity
    • 1661 commits with preserved authorship and blame
    • commit-maps/ directory with old-to-new hash mappings (1731 entries)
    • COMPLIANCE.md per module (extracted from .remote.cmake grading reports)
    • Reusable consolidation script: itk-consolidate-remotes skill

    Next steps

    1. Create InsightSoftwareConsortium/ITKRemoteAnalysis repo on GitHub, push
    2. Update .remote.cmake GIT_REPOSITORY to point at GitHub URL
    3. Get Discourse feedback on category groupings
    4. Repeat for IO, Filtering, Mesh, Registration, Segmentation, Microscopy
  7. SimonRit commented on Apr 15, 2026

    @SimonRit

    Sounds like a good initiative. I don't see where RTK would fit (and it's complicated like Ultrasound), I agree it can be kept independent.

    ITKCudaCommon however is small, very similar to (and based on) GPUCommon. I personally would be in favor of integrating it to the Core of ITK, it would be useful for machine learning applications to avoid CPU <-> GPU transfers since it supports __cuda_array_interface__. It might not be ready for this though, we're happy to do the required developments to this end.

  8. dzenanz commented on Apr 15, 2026

    @dzenanz
    Member

    While OpenCL is not dead, its further development has ceased. CUDA has outlived it. I would be fine with adding CudaCommon to the main repository, with implied expectation that you would continue being its primary maintainer.

  9. 2 remaining items

  10. blowekamp commented on Apr 15, 2026

    @blowekamp
    Member

    We should change the Python packaging so we produce itk-review package which contains everything in it. Adding header-only stuff into this should be easy.

    On thing to consider here is the release process and updates for remote modules vs "core" or main repo modules. Having remotes modules separate allows them to be packaged and updated separately from the main ITK repo.

  11. SimonRit commented on Apr 15, 2026

    @SimonRit

    We should change the Python packaging so we produce itk-review package which contains everything in it. Adding header-only stuff into this should be easy.

    On thing to consider here is the release process and updates for remote modules vs "core" or main repo modules. Having remotes modules separate allows them to be packaged and updated separately from the main ITK repo.

    It's a good point maybe a reason for keeping itk-cudacommon separate. I don't know how gpucommon package has been prepared?

  12. dzenanz commented on Apr 15, 2026

    @dzenanz
    Member

    GPUCommon was last released in 2019. Maybe @thewtex knows.

  13. thewtex commented on Apr 15, 2026

    @thewtex
    Member

    +1 for dropping the OpenGL GPU modules in ITK 6.

    It would be nice to bring the CUDA modules into the main repository, but I agree that CI and packaging are easier in a separate repository.

  14. hjmjohnson commented on Apr 16, 2026

    @hjmjohnson
    MemberAuthor

    Bringing most remote modules in-tree eliminates the structural CI overhead of maintaining 59 separate repositories. Currently a one-line infrastructure update requires 59 coordinated PRs, each triggering 13 CI jobs — the concrete impact of this is documented in #6074. In-tree modules inherit ITK's build configuration automatically: a CI update is a single commit instead of a multi-week campaign.

    The remote module system should be retained for modules that genuinely can't live in-tree — proprietary dependencies (e.g., CUDA/OpenCL backends), external org ownership (RTK, Cleaver, SCIFIO), or specialized toolchains (WebAssemblyInterface). But the ~47 modules that are pure C++/Python algorithm filters with no external dependencies beyond ITK itself are paying a massive infrastructure tax for independence they don't need. The proof-of-concept ITKRemoteAnalysis (8 modules, 77/77 tests) confirms the CMake mechanism works; Module_<name> granularity and EXCLUDE_FROM_DEFAULT are preserved so users aren't forced to build everything.

    The Python packaging question (@blowekamp, @SimonRit) becomes simpler in-tree: modules ship with the main itk wheel or as opt-in itk-<group> extras, no separate PyPI packages or release cycles to maintain. The 6.0 beta window is the right time.

    Action version fragmentation — why coordination doesn't scale

    The 59 modules are currently spread across 10 different action versions:

    Action ref Modules Status
    @v5.4.6 21 Current target
    @v5.4.4 15 Needs update
    @v5.4.0 8 Needs update
    @v5.4.3 3 Needs update
    @v5.4.5 3 Needs update
    @v5.4.2 2 Needs update
    @main 4 Rolling
    @v6.0b01 2 Beta
    other 1 Special

    38 modules still need the v5.4.6 bump — each requiring a separate PR, review, CI run, and merge. In-tree modules need zero coordination.

    Which modules stay independent

    Criteria for remaining as a remote module:

    • External org ownership (can't merge without org agreement)
    • Proprietary/specialized dependencies incompatible with ITK's CI
    • Separate release cadence that doesn't align with ITK releases
    Module Reason to stay independent
    RTK (RTKConsortium) External org, large, CUDA
    CudaCommon (RTKConsortium) External org, CUDA
    TubeTK Large, many examples/applications
    Ultrasound Complex multi-dependency, blueprint for others
    WebAssemblyInterface Wasm/Emscripten toolchain
    Cleaver (SCIInstitute) External org, vendored deps
    SCIFIO, Shape, TractographyTRX External orgs
    VkFFTBackend GPU/Vulkan backend
    TotalVariation, IOOMEZarrNGFF External library dependencies
    AdaptiveDenoising (ntustison) External maintainer — discuss
    SphinxExamples Documentation, not a module
    BioCell Legacy, may deprecate

    Everything else (~47 modules) is pure ITK C++/Python with no external dependencies — ideal candidates for in-tree.

    CI congestion analysis and actionable fixes: #6074

  15. hjmjohnson commented on Apr 19, 2026

    @hjmjohnson
    MemberAuthor

    Update: the approach has been redirected per reviewer feedback on #6061.

    Rather than consolidating remote modules into a separate category repo, modules are now being ingested inline into the ITK source tree under Modules/Beta/<Name>/ with their full upstream git history preserved via git merge --allow-unrelated-histories. Upstream authors surface correctly in git blame and git log --follow.

    See #6085 for the new strategy demonstration. 10 modules ingested so far (Cuberille, Montage, FastBilateral, GrowCut, MeshToPolyData, BoneEnhancement, AnalyzeObjectLabelMap, SimpleITKFilters, LabelErodeDilate, BoneMorphometry); all tests passing pre- and post-ingest.

    #6061 is closed; its discussion thread contains the reviewer feedback that motivated this pivot.

  16. SimonRit commented on Apr 22, 2026

    @SimonRit

    I have a concern regarding the on-going work. A major limitation of the current ITK Python packages is the loading time, see e.g. https://discourse.itk.org/t/torch-import-time/6354. I know some people who are not using them for this exact reason and prefer using SimpleITK instead. So a PR like #6093 makes me think this is not going in the right direction. Won't this make the existing modules bigger and longer to load? I would prefer the use of a finer granularity in the building of the Python wheels to avoid increasing / reduce the loading time. What do you think @hjmjohnson?

  17. dzenanz commented on Apr 22, 2026

    @dzenanz
    Member

    ITK python loads modules on demand. I don't think this will change load times, at least not significantly. It only moves where modules are residing. It will increase size of mainline module-group DLLs, but will not require additional modules.

  18. SimonRit commented on Apr 22, 2026

    @SimonRit

    If a module depends on itk-filtering, I'm pretty sure #6093 will increase the loading time. It might be not "significant" for one module but it will become significant as the number of integrated remote modules increases. And my point is it's already too long and we should consider splitting in more packages to benefit more from the lazy loading.

  19. dzenanz commented on Apr 22, 2026

    @dzenanz
    Member

    I don't think "filtering" is loaded all at once. @thewtex, and maybe @blowekamp might know better.

  20. hjmjohnson commented on Apr 28, 2026

    @hjmjohnson
    MemberAuthor

    Subsumed by the master remote-module tracking issue: #6160. Per-module disposition, ingest queue, archival follow-ups, and discoverability work all live there now.

  21. SimonRit commented on May 5, 2026

    @SimonRit

    If a module depends on itk-filtering, I'm pretty sure #6093 will increase the loading time. It might be not "significant" for one module but it will become significant as the number of integrated remote modules increases. And my point is it's already too long and we should consider splitting in more packages to benefit more from the lazy loading.

    Just wondering: are the CI generated Python wheels available somewhere? I'm happy to do some tests to evaluate the effect of the hard work of @hjmjohnson on the import time.

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

Metadata

Metadata

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions