Conversation
Contributor
There was a problem hiding this comment.
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_ltaconversion: XFM, register.dat, FSL FLIRT .mat, ITK/ANTs .tfm, ANTs GenericAffine .mat, AFNI affine text, NiftyReg affine text. - Extends
ltaCLI with a newconvertsubcommand (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.
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.
Adds Support for:
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.