Skip to content

ENH: Ingest ITKFixedPointInverseDisplacementField into Modules/Filtering#6368

Open
hjmjohnson wants to merge 63 commits into
InsightSoftwareConsortium:mainfrom
hjmjohnson:ingest-FixedPointInverseDisplacementField
Open

ENH: Ingest ITKFixedPointInverseDisplacementField into Modules/Filtering#6368
hjmjohnson wants to merge 63 commits into
InsightSoftwareConsortium:mainfrom
hjmjohnson:ingest-FixedPointInverseDisplacementField

Conversation

@hjmjohnson
Copy link
Copy Markdown
Member

Ingest the ITKFixedPointInverseDisplacementField remote module into Modules/Filtering/, preserving upstream history and git blame, then apply a small set of ITK-6 modernization and correctness fixes surfaced by review. Part of the remote-module consolidation tracked in #6160.

The module computes the inverse of a displacement field via the Chen et al. fixed-point scheme. Built and tested locally on macOS arm64 (Release): module builds clean, ctest -R FixedPointInverse 3/3 pass (including the baseline --compare), pre-commit run --all-files exit 0.

Ingest mechanics (v4 pipeline)
  • ingest-module-v4.sh FixedPointInverseDisplacementField Filtering — filter-repo whitelist + sanitize, Mode-A --no-ff merge with --allow-unrelated-histories.
  • Merge topology preserved (18 upstream merges carried through); git blame walks across the merge boundary to the original authors (Francois Budin 2016, Hans Johnson 2020, Marcel Lüthi).
  • Whitelisted file set only (include/, test/, wrapping/, CMakeLists.txt, itk-module.cmake); scaffolding (.github/, test/Docker/, examples/, pyproject.toml) stripped.
  • Test data already on .cid content-links; both resolve from the IPFS gateway.
  • Modules/Remote/FixedPointInverseDisplacementField.remote.cmake removed; -DModule_FixedPointInverseDisplacementField:BOOL=ON added to the pixi configure-ci task.
Post-ingest review fixes (each a separate commit)

Correctness:

  • BUG: Propagate input directionGenerateOutputInformation set size/spacing/origin but left the output direction at identity; for a non-identity-direction input the iteration's TransformIndexToPhysicalPoint computed points in the wrong frame.
  • BUG: Reject an unset output sizem_Size defaulted to all-zeros and was used unchecked (silent empty output); now throws if the requested size has zero volume.
  • BUG: Exact iteration count — loop bound i <= m_NumberOfIterations ran N+1 passes; now strict.

ITK-6 / build hygiene:

  • COMP: deprecated itkTypeMacroitkOverrideGetNameOfClassMacro (static_assert failure under ITK_FUTURE_LEGACY_REMOVE).
  • COMP: reduce module CMakeLists.txt to the in-tree form; drop unused ITKIOImageBase dependency.

Cleanup:

  • STYLE: remove unused aliases/includes, the dead input iterator, complete PrintSelf, add GetOutputOrigin, adopt AllocateInitialized/Fill, and EXIT_SUCCESS/EXIT_FAILURE + typed write catch in the test.

XiaoxiaoLiu and others added 30 commits March 13, 2014 09:39
Fixed point approximation implementation from IJ.
The installation rule installs InvertDeformationField in ${CMAKE_INSTALL_PREFIX}/${INSTALL_RUNTIME_DESTINATION}.
INSTALL_RUNTIME_DESTINATION is a CACHE variable that can be set in the command line when configuring the ITKUtils project.
* Reorganization of the code to match ITK remote module
* InvertDeformationField executable moved to examples folder
* addition of a test
* Addition of scripts to create a docker image to run tests
* Addition of a licence
* Integration in CircleCI
ENH: Converting ITKUtils to ITK remote module.
Remove unused CMake code, replace uppercase commands
by lower case command for consistency, and remove CMakeLists.txt
file that was not used.
README file has been updated to reference both the original paper
describing the algorithm and the Insight Journal paper implementing
the algorithm. Filter files headers have been updated to match
ITK requirements.
ENH: Update README and filter files headers
When compiled as a remote module outside of ITK and inside the
ITK source tree, the behavior of the module should be the same.
Since the example requires the ITK IO factory mechanism, and to
follow the ITK guide lines, the 'examples' folder is now
a different CMake project: it is not included in the remote
module compilation.
ITK_USE_FILE should not be included as it creates an IO
header file that does not match the list of IO provided
by the module test libraries.
BUG: Remove usage of ITK_USE_FILE
TestDriver main function has to have the following signature:
int {TestDriverFunctionName}(int argv, char* argc[])
To be consistent with the ITK naming, every occurence of
the word 'Deformation' has been replaced by 'Displacement'
…ment

ENH: Renamed 'Deformation' by 'Displacement'
ImageDimension was declared both as a member variable of the class
and inside GenerateData().
In header file, instantiation file should only be included
if ITK_MANUAL_INSTANTIATION is not defined.
Addition of parentheses to remove the following warning:
'warning: logical not is only applied to the left hand side of this comparison'
The full domain of the input displacement field may be needed.

This addresses segmentation faults encountered when the requested
region does not match in largest possible region.
BUG: Always request the full input image
Remove unneeded check for null input, this is already checked in the
pipeline.
There is no need to copy the input image and pre-compute a it's
negative value. The value is simply negated when needed.
The indentation of the loop is also corrected.
COMP: Fix warning about variable index being shadowed
thewtex and others added 13 commits September 23, 2018 14:22
Attempt to address:

  Preprocessing
  /.../ITK/Modules/Filtering/QuadEdgeMeshFil/.../ITK/Modules/Remote/FixedPointInverseDisplacementField/include/.!20897!itkFixedPointInverseDisplacementFieldImageFilter.h:47:
  warning: File ended in the middle of a comment block! Perhaps a
  missing \endcode?
…xygen-warnings

COMP: Doxygen file in the middle of a comment block
As discussed in:
http://review.source.kitware.com/#/c/12655/

the use of the template keyword "class" was substituted by "typename" in
the toolkit for the reasons stated in that topic.
…/UseTypenameKeywordConsistently

STYLE: Use "typename" for template parameters.
…pping-test-location

STYLE: Move Python test to wrapping/test/CMakeLists.txt
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.
Converts a default constructor’s member initializers into the new
default member initializers in C++11. Other member initializers that match the
default member initializer are removed. This can reduce repeated code or allow
use of ‘= default’.
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).
@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 31, 2026
@hjmjohnson hjmjohnson marked this pull request as ready for review May 31, 2026 11:38
@greptile-apps

This comment was marked as resolved.

hjmjohnson and others added 4 commits June 3, 2026 11:15
Brings FixedPointInverseDisplacementField from a configure-time remote fetch into the ITK
source tree at Modules/Filtering/FixedPointInverseDisplacementField/ using the v4 ingestion
pipeline (whitelist filter-repo + per-commit clang-format + black +
commit-prefix sanitization).

Upstream repo:  https://github.com/InsightSoftwareConsortium/ITKFixedPointInverseDisplacementField.git
Upstream tip:   76525fe4cbd5eda9075107eede3c1d09deed4a4f
Ingest date:    2026-06-03
Whitelist:      default.list

Per-commit transforms applied across all 59 commits:
  - filter-repo --paths-from-file (whitelist)
  - filter-repo --to-subdirectory-filter Modules/Filtering/FixedPointInverseDisplacementField
  - 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: 29 -> 18 merge(s).

Primary author: Francois Budin <francois.budin@kitware.com>

Co-authored-by: Bradley Lowekamp <blowekamp@mail.nih.gov>
Co-authored-by: Dženan Zukić <dzenan.zukic@kitware.com>
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: 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: matt.mccormick@kitware.com <Matt McCormick>
Co-authored-by: Tom Birdsong <tom.birdsong@kitware.com>
Co-authored-by: Xiaoxiao Liu <xiaoxiao.liu@kitware.com>
Drop the standalone find_package(ITK)/ITKModuleExternal scaffolding from
the module CMakeLists (in-tree builds use itk_module_impl) and apply
gersemi formatting to the wrapping test CMakeLists.
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: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.

9 participants