Skip to content

Add Support for LTA IO and conversion#7

Merged
m-reuter merged 8 commits intomainfrom
lta
Apr 22, 2026
Merged

Add Support for LTA IO and conversion#7
m-reuter merged 8 commits intomainfrom
lta

Conversation

@m-reuter
Copy link
Copy Markdown
Member

@m-reuter m-reuter commented Apr 22, 2026

Adds Support for:

  • xfm
  • register.dat
  • fslmat (FSL flirt)
  • ITK/ANTs txt and ANTs mat
  • NiftiReg
  • Afni

Note, the implementation follow how we did this in FreeSurfer, however real tests with respect to some of these tools have not been performed yet. So some of this is still experimental.

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Adds broad linear-transform I/O + conversion support across several neuroimaging ecosystems by normalizing through NeuroReg’s internal LTA (RAS-to-RAS) representation, and expands CLI/docs/tests accordingly.

Changes:

  • Adds new transform wrappers with read/write + to_lta/from_lta conversion: XFM, register.dat, FSL FLIRT .mat, ITK/ANTs .tfm, ANTs GenericAffine .mat, AFNI affine text, NiftyReg affine text.
  • Extends lta CLI with a new convert subcommand (format inference + overrides, geometry requirements, metadata passthrough).
  • Consolidates and expands tests into tests/test_lta.py, and updates API/CLI documentation + README.

Reviewed changes

Copilot reviewed 16 out of 16 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
tests/test_lta_diff.py Removes older LTA diff-focused test suite (superseded by consolidated tests).
tests/test_lta.py Adds comprehensive tests for LTA + new transform formats and CLI convert/diff/invert/concat behavior.
neuroreg/transforms/lta.py Adds top-level subject/fscale metadata handling and propagation through invert/concat; updates read/write.
neuroreg/transforms/xfm.py Implements MNI/MINC .xfm parsing, path inference from comments, and LTA conversion.
neuroreg/transforms/regdat.py Implements FreeSurfer register.dat I/O and LTA conversion using tkregister geometry conventions.
neuroreg/transforms/fsl.py Implements FSL FLIRT .mat I/O and LTA conversion (geometry-dependent; NIfTI convention handling).
neuroreg/transforms/itk.py Implements ITK/ANTs affine text .tfm I/O and LTA conversion (LPS↔RAS + inversion semantics).
neuroreg/transforms/antsmat.py Implements experimental ANTs/ITK Matlab affine (*GenericAffine.mat) I/O and LTA conversion.
neuroreg/transforms/afni.py Implements experimental AFNI affine text parsing/writing and LTA conversion (LPS↔RAS).
neuroreg/transforms/niftyreg.py Implements NiftyReg affine text I/O and LTA conversion (stored inverse convention).
neuroreg/transforms/init.py Exposes new transform wrappers via package imports and __all__.
neuroreg/cli/lta.py Adds convert subcommand, format inference, and conversion read/write plumbing.
doc/cli/index.rst Documents lta convert usage and examples.
doc/api/transforms.rst Adds API docs for the new transform wrapper classes.
doc/api/cli.rst Adds argparse-generated docs section for lta convert.
README.md Updates CLI overview and adds detailed lta convert documentation + examples.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread neuroreg/transforms/lta.py
Comment thread neuroreg/cli/lta.py
@m-reuter m-reuter merged commit 2d6c477 into main Apr 22, 2026
27 checks passed
@m-reuter m-reuter deleted the lta branch April 22, 2026 14:55
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.

2 participants