Repository navigation
ENH: Add Python examples and documentation for Elastix - #2598
Merged
Merged
Conversation
Add Python versions of the Elastix registration (elx.py) and Transformix transformation (tfx.py) examples with CMake test integration. These examples demonstrate the use of ElastixImageFilter and TransformixImageFilter for deformable image registration using parameter files from the elastix zoo.
Add Documentation.rst for Elastix examples with side-by-side C++ and Python code tabs. Update Examples index to include link to Elastix documentation, highlighting the parameter zoo for turnkey registration scenarios.
blowekamp
marked this pull request as ready for review
May 19, 2026 23:12
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.
This PR adds Python versions of the Elastix registration and Transformix transformation examples, along with comprehensive documentation.
Changes
elx.pyandtfx.pyas Python equivalents to the existing C++ examplesDocumentation.rstwith side-by-side C++/Python code tabs, highlighting the elastix parameter zoo for turnkey registration scenariosThe examples demonstrate:
ElastixImageFilterfor deformable image registrationTransformixImageFilterfor applying transformationsTesting
Added Python test cases in
Examples/Elastix/CMakeLists.txt:Python.Example.Elastix- Tests registration withelx.pyPython.Example.Transformix- Tests transformation withtfx.py(depends on Elastix output)Both tests use the brain slice images and
par0001.txtparameter file with 40-pixel tolerance.