Skip to content

ENH: Add Python examples and documentation for Elastix - #2598

Merged
blowekamp merged 2 commits into
SimpleITK:mainfrom
blowekamp:add-elastix-python-examples
May 19, 2026
Merged

blowekamp merged 2 commits into
SimpleITK:mainfrom
blowekamp:add-elastix-python-examples

Conversation

@blowekamp

Copy link
Copy Markdown
Member

This PR adds Python versions of the Elastix registration and Transformix transformation examples, along with comprehensive documentation.

Changes

  • Python Examples: Created elx.py and tfx.py as Python equivalents to the existing C++ examples
  • Test Integration: Added CMake test cases for both Python examples with proper dependencies
  • Documentation: Added Documentation.rst with side-by-side C++/Python code tabs, highlighting the elastix parameter zoo for turnkey registration scenarios
  • Examples Index: Updated to include link to Elastix documentation

The examples demonstrate:

  • ElastixImageFilter for deformable image registration
  • TransformixImageFilter for applying transformations
  • Using parameter files from the elastix parameter zoo

Testing

Added Python test cases in Examples/Elastix/CMakeLists.txt:

  • Python.Example.Elastix - Tests registration with elx.py
  • Python.Example.Transformix - Tests transformation with tfx.py (depends on Elastix output)

Both tests use the brain slice images and par0001.txt parameter file with 40-pixel tolerance.

blowekamp added 2 commits May 19, 2026 16:58
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
blowekamp requested review from Copilot and zivy May 19, 2026 21:06

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot encountered an error and was unable to review this pull request. You can try again by re-requesting a review.

@zivy zivy left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@blowekamp
blowekamp marked this pull request as ready for review May 19, 2026 23:12
@blowekamp
blowekamp merged commit 8330646 into SimpleITK:main May 19, 2026
10 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants