Skip to content

ENH: Ingest ITKMinimalPathExtraction into Modules/Filtering/MinimalPathExtraction#6271

Merged
hjmjohnson merged 91 commits into
InsightSoftwareConsortium:mainfrom
hjmjohnson:ingest-MinimalPathExtraction
May 17, 2026
Merged

ENH: Ingest ITKMinimalPathExtraction into Modules/Filtering/MinimalPathExtraction#6271
hjmjohnson merged 91 commits into
InsightSoftwareConsortium:mainfrom
hjmjohnson:ingest-MinimalPathExtraction

Conversation

@hjmjohnson
Copy link
Copy Markdown
Member

Ingest the ITKMinimalPathExtraction remote module into Modules/Filtering/MinimalPathExtraction (group: Filtering). Source upstream: InsightSoftwareConsortium/ITKMinimalPathExtraction. Tracking issue: #6160.

Ingest stats
  • Commits: 118 (including 36 merge commits -- Mode A topology preserved per Utilities/Maintenance/RemoteModuleIngest/INGESTION_STRATEGY.md)
  • Files installed under Modules/Filtering/MinimalPathExtraction/: 92
  • Approx. content size: 8234 KiB
  • Tip SHA: 5f8dad2694a936aa65f0856285eb5fcb83a16d9e
External-data fixtures

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

(none -- module has no external-data fixtures)

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)
  • 5f8dad2 ENH: Enable Module_MinimalPathExtraction; drop remote stub
  • 3d4ebe2 ENH: Modernize CMake to use itk_module_add_library
  • 9e8ab7c STYLE: CoordRepType -> CoordinateType code readability
  • 1d55c22 STYLE: Replace itkStaticConstMacro with static constexpr
  • a4bf8e4 STYLE: Add itkVirtualGetNameOfClassMacro + itkOverrideGetNameOfClassMacro

@github-actions github-actions Bot added type:Infrastructure Infrastructure/ecosystem related changes, such as CMake or buildbots type:Enhancement Improvement of existing methods or implementation area:Python wrapping Python bindings for a class type:Testing Ensure that the purpose of a class is met/the results on a wide set of test cases are correct area:Filtering Issues affecting the Filtering module area:Remotes Issues affecting the Remote module labels May 14, 2026
@hjmjohnson
Copy link
Copy Markdown
Member Author

@greptileai review this draft before I make it official

1 similar comment
@hjmjohnson
Copy link
Copy Markdown
Member Author

@greptileai review this draft before I make it official

@greptile-apps

This comment was marked as resolved.

Comment thread Modules/Filtering/MinimalPathExtraction/itk-module.cmake
Comment thread Modules/Filtering/MinimalPathExtraction/itk-module.cmake Outdated
@greptile-apps

This comment was marked as outdated.

Comment thread Modules/Filtering/MinimalPathExtraction/itk-module.cmake
@hjmjohnson
Copy link
Copy Markdown
Member Author

/azp run

@hjmjohnson
Copy link
Copy Markdown
Member Author

/azp run

1 similar comment
@hjmjohnson
Copy link
Copy Markdown
Member Author

/azp run

@github-actions github-actions Bot added the type:Data Changes to testing data label May 14, 2026
@hjmjohnson
Copy link
Copy Markdown
Member Author

/azp run

1 similar comment
@hjmjohnson
Copy link
Copy Markdown
Member Author

/azp run

@hjmjohnson hjmjohnson force-pushed the ingest-MinimalPathExtraction branch from 352b1bb to 6c9ea35 Compare May 14, 2026 18:33
@hjmjohnson
Copy link
Copy Markdown
Member Author

Rewrote history with git filter-repo to scrub raw binary blobs from upstream merge ancestry while preserving merge topology. Pre-rewrite tip 352b1bbfbe; post-rewrite tip 6c9ea35546. Binary content remains accessible via .cid/.sha512 content-links at HEAD.

@hjmjohnson
Copy link
Copy Markdown
Member Author

/azp run

1 similar comment
@hjmjohnson
Copy link
Copy Markdown
Member Author

/azp run

@hjmjohnson hjmjohnson force-pushed the ingest-MinimalPathExtraction branch from b0372e2 to 0cd4791 Compare May 14, 2026 20:04
@hjmjohnson
Copy link
Copy Markdown
Member Author

History rewrite (filter-repo) to address ghostflow check-main findings.

What was rewritten and why

Ghostflow flagged three classes of issues in historical commits of this ingest branch:

  1. Exec bit on data files in b39e8c6 (test/data/) and 2aaa9d1 (test/Input/): 23 added .bb / .path files were committed with mode 100755. Filter-repo cleared every 100755 → 100644 for *.bb and *.path paths in the upstream/main..HEAD range.
  2. Invalid commit message in 9f6e342 ("DOC: TerminationValue and note on early termination"): the body used CRLF line endings, leaving the first body line "empty" from ghostflow's perspective. Filter-repo replaced CR with LF and collapsed runs of \n\n\n+ to \n\n.
  3. Python shebang on non-executable DigitalSubtractionAngiographyVesselPath.py in a96ee2a: the leading #!/usr/bin/env python line was stripped at the blob level, matching the prior decision already reflected at the tip.

Merge topology preserved: 127 commits, 36 merges, identical before and after. Tree at the new tip differs from the previous tip only in the 12 mode changes on the surviving test/Input/*.bb and test/Input/*.path files.

Verification
  • git log --diff-filter=A --raw upstream/main..HEAD -- '*.bb' '*.path' | grep '^:000000 100755' → empty
  • No commit in the range adds a python file containing #!/usr/bin/env python
  • Rewritten 9f6e342 equivalent has subject + blank + non-empty first body line
  • pre-commit run --all-files (excluding check-setup-for-development / local-pre-commit, which check per-clone install state) → all content hooks pass: clang-format, gersemi, black, pyupgrade, trim trailing whitespace, mixed line ending, end of files, kw-pre-commit

Old tip: b0372e2658
New tip: 0cd479187f

@hjmjohnson
Copy link
Copy Markdown
Member Author

/azp run

hjmjohnson and others added 28 commits May 17, 2026 07:19
This check replaces default bodies of special member functions with
= default;. The explicitly defaulted function declarations enable more
opportunities in optimization, because the compiler might treat
explicitly defaulted functions as trivial.

Additionally, the C++11 use of = default more clearly expreses the
intent for the special member functions.
Find and remove redundant void argument lists.
expression

This check is responsible for using the auto type specifier for variable
declarations to improve code readability and maintainability.

The auto type specifier will only be introduced in situations where the
variable type matches the type of the initializer expression. In other words
auto should deduce the same type that was originally spelled in the source
The emptiness of a container should be checked using the empty() method
instead of the size() method. It is not guaranteed that size() is a
constant-time function, and it is generally more efficient and also
shows clearer intent to use empty(). Furthermore some containers may
implement the empty() method but not implement the size() method. Using
empty() whenever possible makes it easier to switch to another container
in the future.

SRCDIR= #My local SRC
BLDDIR= #My local BLD

cd
run-clang-tidy.py -extra-arg=-D__clang__ -checks=-*,readability-container-size-empty  -header-filter=.* -fix
The mission of NumFOCUS is to promote open
practices in research, data, and scientific
computing.

https://numfocus.org
The mission of NumFOCUS is to promote open
practices in research, data, and scientific
computing.

https://numfocus.org
Fixes changes made in InsightSoftwareConsortium#2053. ITK_DISALLOW_COPY_AND_ASSIGN will be used if ITK_FUTURE_LEGACY_REMOVE=OFF.
The ability to include either .h or .hxx files as
header files required recursively reading the
.h files twice.  The added complexity is
unnecessary, costly, and can confuse static
analysis tools that monitor header guardes (due
to reaching the maximum depth of recursion
limits for nested #ifdefs in checking).
With updates to FastMarching in ITK, it is necessary to
SetTargetPoints prior to setting TargetReachMode.

Without this change, an exception is thrown in
itkFastMarchingUpwindGradientImageFilter::
VerifyTargetReachedModeConditions() when called by
SetTargetReachedModeToAllTargets()
which is called by itkSpeedfunctionToPathFilter::
ComputeArrivalFunction()
Modules/Remote/MinimalPathExtraction/include/itkSpeedFunctionToPathFilter.hxx:239:51: warning: ignoring return value of 'bool itk::ImageBase<VImageDimension>::TransformPhysicalPointToContinuousIndex(const itk::Point<TCoordRep, VImageDimension>&, itk::ContinuousIndex<TIndexRep, VImageDimension>&) const [with TCoordRep = double; TIndexRep = double; unsigned int VImageDimension = 2]', declared with attribute 'nodiscard' [-Wunused-result]
…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
Use static constexpr directly now that C++11 conformance
is required by all compilers.

:%s/itkStaticConstMacro *( *\([^,]*\),[ \_s]*\([^,]*\),\_s*\([^)]*\)) */static constexpr \2 \1 = \3/ge

'itkStaticConstMacro(name, type, value)' became unconditionally
identical to 'static constexpr type name = value' with ITK commit
aec9519 "ENH: Update compiler macros (InsightSoftwareConsortium#810)",
maekclena, 7 May 2019.

'itkGetStaticConstMacro(name)' became unconditionally identical to
'(Self::name)' with ITK commit 84e490b
"Removing some outdated compiler conditionals", Hans Johnson, 31 July
2010.

Most 'itkStaticConstMacro' calls were removed by ITK commit 5c14741
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.
Replace add_library with itk_module_add_library macro for better
integration with ITK module system. This provides automatic dependency
linking, include directory setup, and consistent target naming.
Activates the newly ingested module in the configure-ci task and
removes its Modules/Remote/*.remote.cmake stub.
Remove duplicate ENABLE_SHARED keyword and replace placeholder
DESCRIPTION with a meaningful summary of the module's purpose.
Replace C-style casts that strip const with explicit const_cast on the
result of GetInput() / dynamic_cast, and remove an unreachable return
following itkExceptionMacro (which throws).
Replace the C-style cast that strips const from the dynamic_cast result
with an explicit const_cast.
Applies to PhysicalCentralDifferenceImageFunction definitions, per ITK
convention enforced by clang-tidy.
Replace the raw binary test fixtures (images, speed volumes, baselines)
with ExternalData content-link files and wrap their references in
DATA{...} so the blobs are fetched from ITKTestingData at build time
rather than committed into the ITK tree.
Co-authored-by: greptile-apps[bot] <165735046+greptile-apps[bot]@users.noreply.github.com>
AdvanceOneStep() only dispatched the fully-connected branch for
spaceDimension 2 or 3; any other dimension fell through with bestValue
unchanged, causing the optimizer to StopOptimization() at the start
point with no diagnostic. Raise an exception so the unsupported case
is surfaced rather than silently terminating path extraction.
The ingested upstream test/CMakeLists.txt used plain add_test() with
literal DATA{...} arguments. CMake's add_test() does not expand DATA{};
only itk_add_test() (via ExternalData_Add_Test) does, so the test
driver received the literal string "DATA{/.../Foo.mhd,Foo.zraw}" as a
filename and every data-driven test failed immediately. Switch the 18
data-driven tests to itk_add_test().

Synthetic_03_NeighborhoodIterate is marked WILL_FAIL: its multi-seed
baseline cannot be reproduced with either the upstream or the appended
front-insertion semantics; rebaselining is tracked as a post-ingest
follow-up so the remaining 17 tests can gate CI.
Co-authored-by: greptile-apps[bot] <165735046+greptile-apps[bot]@users.noreply.github.com>
@hjmjohnson hjmjohnson force-pushed the ingest-MinimalPathExtraction branch from 9ac1142 to 55131ee Compare May 17, 2026 13:19
@hjmjohnson hjmjohnson merged commit eb00442 into InsightSoftwareConsortium:main May 17, 2026
19 of 20 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:Filtering Issues affecting the Filtering module area:Python wrapping Python bindings for a class 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.