ENH: Ingest ITKRLEImage into Modules/Filtering#6208
Merged
hjmjohnson merged 122 commits intoInsightSoftwareConsortium:mainfrom May 5, 2026
Merged
ENH: Ingest ITKRLEImage into Modules/Filtering#6208hjmjohnson merged 122 commits intoInsightSoftwareConsortium:mainfrom
hjmjohnson merged 122 commits intoInsightSoftwareConsortium:mainfrom
Conversation
Coding style more adhering to ITK style guide
signed/unsigned correctness
Addressing warnings
Adding RLEImage specific tests
Trying to resolve build failures in the main repository
Applying uncrustify with ITK's aggressive style configuration
… built This should prevent failures of automatic build tests on dashboards
Fixing the linking errors for tests when default modules are not built
This comment was marked as resolved.
This comment was marked as resolved.
hjmjohnson
added a commit
to hjmjohnson/ITK
that referenced
this pull request
May 5, 2026
…terns
Add a 'Known artifacts at PR-review time' section to capture two
things future ingest operators need to expect but that v3/v4 do not
fix automatically:
- The single ghostflow-check-main 'root commit not allowed' error
that every Mode-A merge produces. Maintainers override at merge.
Calling it out keeps operators from chasing a non-fix.
- A short table of code-level patterns Greptile has flagged
post-ingest on multiple modules (IOMeshSTL InsightSoftwareConsortium#6206, RLEImage InsightSoftwareConsortium#6208):
signed-vs-unsigned size types, missing override, dead return after
itkExceptionMacro, stray test args, external-friend declarations,
GetBuffer-const correctness, and allocator-init invariants.
The table is the durable channel for cross-ingest review knowledge —
extend it as new recurring patterns surface.
50 tasks
dzenanz
reviewed
May 5, 2026
4c9afe8 to
9544c1f
Compare
dzenanz
approved these changes
May 5, 2026
Brings RLEImage from a configure-time remote fetch into the ITK source tree at Modules/Filtering/RLEImage/ using the v4 ingestion pipeline (whitelist filter-repo + per-commit clang-format + black + commit-prefix sanitization). Upstream repo: https://github.com/KitwareMedical/ITKRLEImage.git Upstream tip: 03d1d9b5868d9f43bb4066637034cd667922cab9 Ingest date: 2026-05-04 Whitelist: RLEImage.list Per-commit transforms applied across all 112 commits: - filter-repo --paths-from-file (whitelist) - filter-repo --to-subdirectory-filter Modules/Filtering/RLEImage - 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: 36 -> 26 merge(s). Primary author: Dženan Zukić <dzenan.zukic@kitware.com> Co-authored-by: Dzenan Zukic <dzenan.zukic@kitware.com> Co-authored-by: Francois Budin <francois.budin@gmail.com> Co-authored-by: Francois Budin <francois.budin@kitware.com> Co-authored-by: Hans J. Johnson <hans-johnson@uiowa.edu> Co-authored-by: Hans Johnson <hans-johnson@uiowa.edu> 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 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: Stephen R. Aylward <stephen.aylward@kitware.com> Co-authored-by: Tom Birdsong <tom.birdsong@kitware.com>
C++17 class-template-argument-deduction synthesizes implicit guides
only from the primary class template; the partial specializations
ImageRegionConstIterator<RLEImage<...>> and ImageRegionIterator<
RLEImage<...>> need explicit deduction guides so generic ITK code
that calls the unparameterized form
ImageRegionConstIterator it(image, region);
can be instantiated when image is an RLEImage. Without these guides,
the call in itkImageAlgorithm.hxx (and any other CTAD-using ITK core
code) fails to compile when downstream code instantiates the algorithm
template against an RLEImage type. The same generic call already
works for the primary itk::Image<T,N> case because CTAD synthesizes
guides from the primary template's constructors.
Surfaced when wiring up MorphologicalContourInterpolation's
RLEImage-flavored test which uses itkImageFileWriter.h
-> itkImageAlgorithm.hxx with RLEImage instantiations.
The const overload returned a non-const SmartPointer to m_Buffer, allowing callers holding a const RLEImage to mutate the underlying RLE line buffer. Return BufferType::ConstPointer so the const overload preserves const semantics.
The itk_add_test for itkRLEImageIteratorTest passed itkRLEImageIteratorWithIndexTest as a second positional argument. Test drivers forward argv[2..n] to the function named in argv[1]; they do not invoke a second function. The withIndex test still runs via its own registration so coverage is unchanged.
…mage In-tree, ITK_SOURCE_DIR is always defined and ITK's top-level CMakeLists pins the CMake minimum version. The per-module cmake_minimum_required line and if(NOT ITK_SOURCE_DIR) ... else() itk_module_impl() endif() guard are dead code. Pre-emptive cleanup matching the v4 ingest-pipeline rules codified in PR InsightSoftwareConsortium#6204 (sanitize-history.py:patch_drop_cmake_minimum_required and :patch_standalone_build_guard).
Add itkRLEImageMultiLabelMeshPipelineFriendTest, an in-tree witness that the `friend class ::MultiLabelMeshPipeline;` grants on itk::ImageConstIterator<itk::RLEImage<...>> and itk::ImageRegionConstIterator<itk::RLEImage<...>> are still in place. The test defines a stub `MultiLabelMeshPipeline` at global scope (the same name and namespace as the friend declarations target) and reads several of the iterator's protected scan-line bookkeeping members (m_Index0 / m_BeginIndex0 / m_EndIndex0 / m_RealIndex / m_SegmentRemainder). If a future cleanup ever removes the friendship the test fails to compile, surfacing the regression at build time. The downstream consumer this protects is ITK-SNAP's MultiLabelMeshPipeline, which uses direct access to those iterator internals for its multi-label surface-extraction performance path. Removing the friendship would silently break that build with no warning from this module's own test suite.
9544c1f to
5f48a03
Compare
11c2f38
into
InsightSoftwareConsortium:main
16 of 19 checks passed
hjmjohnson
added a commit
to hjmjohnson/ITK
that referenced
this pull request
May 6, 2026
…est-rleimage ENH: Ingest ITKRLEImage into Modules/Filtering
hjmjohnson
added a commit
that referenced
this pull request
May 7, 2026
ENH: Ingest ITKMorphologicalContourInterpolation (stacked on #6208)
hjmjohnson
added a commit
to hjmjohnson/ITK
that referenced
this pull request
May 7, 2026
…terns
Add a 'Known artifacts at PR-review time' section to capture two
things future ingest operators need to expect but that v3/v4 do not
fix automatically:
- The single ghostflow-check-main 'root commit not allowed' error
that every Mode-A merge produces. Maintainers override at merge.
Calling it out keeps operators from chasing a non-fix.
- A short table of code-level patterns Greptile has flagged
post-ingest on multiple modules (IOMeshSTL InsightSoftwareConsortium#6206, RLEImage InsightSoftwareConsortium#6208):
signed-vs-unsigned size types, missing override, dead return after
itkExceptionMacro, stray test args, external-friend declarations,
GetBuffer-const correctness, and allocator-init invariants.
The table is the durable channel for cross-ingest review knowledge —
extend it as new recurring patterns surface.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Ingests
RLEImagefrom the standalone remote module KitwareMedical/ITKRLEImage into ITK atModules/Filtering/RLEImage/. Branch is based directly onupstream/mainand contains no v4-tooling files in its diff — independently mergeable.Local validation:
pre-commit run --all-filesclean;RLEImageTestDriverbuilds; 45/45 RLEImage tests pass locally (afterExternalDatafetches ~30.cidcontent links).What this provides
RLEImageis a memory-efficient run-length-encoded image type — a drop-in alternative toitk::Imagefor storing large label volumes (segmentation masks). The flagship template isitk::RLEImage<TPixel, VImageDimension, CounterType>, with iterator and filter specializations that operate directly on the encoded representation without decompression.Path:
Modules/Filtering/RLEImage/— chosen because the module's libraryDEPENDS ITKImageGrid(a Filtering-group module), which precludes aModules/Core/placement.Pipeline metrics
README.rst → README.mdrewrites initk-module.cmakegit log -- Modules/Filtering/RLEImageDependencies
The module library and tests depend only on ITK core modules — no remote-module dependencies:
DEPENDS(library):ITKImageGridTEST_DEPENDS:ITKTestKernelEXCLUDE_FROM_DEFAULTis set on the module so it does not auto-build unlessModule_RLEImage:BOOL=ONis passed (matching upstream behavior).Companion module
Modules/Filtering/MorphologicalContourInterpolation/(still a remotemodule on
upstream/mainas of this writing) has an optionalTEST_DEPENDSonRLEImage. Once this PR merges and that module isalso brought in-tree, MCI's RLEImage-flavored tests will be reachable.
A follow-up MCI ingest PR will stack on this one.
Follow-up commits in this PR
After the merge commit (
ENH: Ingest ITKRLEImage into Modules/Filtering):STYLE:Apply gersemi 0.19.3 to RLEImage wrapping test CMakeLists. The v4 sanitize pass uses gersemi 0.24.0; ITK's pre-commit pins 0.19.3. The post-mergepre-commit run --all-filesgate caught one CMake file where the two versions disagree.DOC:AddModules/Filtering/RLEImage/README.mdpointing at the archived upstream.COMP:RemoveModules/Remote/RLEImage.remote.cmake(now in-tree).ENH:EnableModule_RLEImage:BOOL=ONinpyproject.tomlconfigure-ci.The v4 sanitize automatically rewrote
file(READ "${...}/README.rst" DOCUMENTATION)initk-module.cmaketo readREADME.mdinstead — no manualCOMPpatch was needed.Phase B (upstream archival) — deferred
Per the v4 design (PR #6204), the upstream archival step is intentionally separated. After this PR merges into ITK
main, run:That step pushes the deletion +
MIGRATION_README.md → README.mdpromotion to upstream and flipsarchived=true. This PR makes no upstream changes; the upstreamITKRLEImagerepository remains live until the operator manually runs Phase B.