ENH: Ingest ITKFixedPointInverseDisplacementField into Modules/Filtering#6368
Open
hjmjohnson wants to merge 63 commits into
Open
ENH: Ingest ITKFixedPointInverseDisplacementField into Modules/Filtering#6368hjmjohnson wants to merge 63 commits into
hjmjohnson wants to merge 63 commits into
Conversation
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.
ENH: Clean CMake code
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.
ENH: Reorganize examples and tests
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[])
BUG: Linking error on Windows
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().
BUG: Shadowed variable
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.
Improvements
The indentation of the loop is also corrected.
COMP: Fix warning about variable index being shadowed
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.
Required in ITK 5.
…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).
97 tasks
This comment was marked as resolved.
This comment was marked as resolved.
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.
6b55de2 to
3d1f13c
Compare
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.
Ingest the
ITKFixedPointInverseDisplacementFieldremote module intoModules/Filtering/, preserving upstream history andgit 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 FixedPointInverse3/3 pass (including the baseline--compare),pre-commit run --all-filesexit 0.Ingest mechanics (v4 pipeline)
ingest-module-v4.sh FixedPointInverseDisplacementField Filtering— filter-repo whitelist + sanitize, Mode-A--no-ffmerge with--allow-unrelated-histories.git blamewalks across the merge boundary to the original authors (Francois Budin 2016, Hans Johnson 2020, Marcel Lüthi)..github/,test/Docker/,examples/,pyproject.toml) stripped..cidcontent-links; both resolve from the IPFS gateway.Modules/Remote/FixedPointInverseDisplacementField.remote.cmakeremoved;-DModule_FixedPointInverseDisplacementField:BOOL=ONadded to the pixi configure-ci task.Post-ingest review fixes (each a separate commit)
Correctness:
GenerateOutputInformationset size/spacing/origin but left the output direction at identity; for a non-identity-direction input the iteration'sTransformIndexToPhysicalPointcomputed points in the wrong frame.m_Sizedefaulted to all-zeros and was used unchecked (silent empty output); now throws if the requested size has zero volume.i <= m_NumberOfIterationsran N+1 passes; now strict.ITK-6 / build hygiene:
itkTypeMacro→itkOverrideGetNameOfClassMacro(static_assert failure underITK_FUTURE_LEGACY_REMOVE).CMakeLists.txtto the in-tree form; drop unusedITKIOImageBasedependency.Cleanup:
PrintSelf, addGetOutputOrigin, adoptAllocateInitialized/Fill, andEXIT_SUCCESS/EXIT_FAILURE+ typed write catch in the test.