-
Notifications
You must be signed in to change notification settings - Fork 260
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[WIP] ENH: Load/save linear transform array (LTA) files #565
Conversation
b8844ec
to
7a3f71a
Compare
Codecov Report
@@ Coverage Diff @@
## master #565 +/- ##
==========================================
- Coverage 91.85% 91.15% -0.71%
==========================================
Files 97 98 +1
Lines 12357 12490 +133
Branches 2177 2190 +13
==========================================
+ Hits 11351 11385 +34
- Misses 675 774 +99
Partials 331 331
Continue to review full report at Codecov.
|
Chris - this may not be relevant - but there's some stuff on the FSL mat format here : https://github.com/nipy/dipy/blob/master/dipy/external/fsl.py#L69 |
Chris - where are we with this one? |
The status here is that it's stalled. Now I have a better understanding of the different affine conventions (i.e. FSL using a voxel-based origin, ITK ignoring sforms) the urgency of working through all of this has fallen away a little bit. I'd be up for trying to make a roadmap for handling affine transforms, but I think that's going to involve settling on a common internal representation. I actually like the LTA approach, which includes both the source and target spaces, which means that this information is sufficient to produce an FSL or ITK matrix. But #567 is my highest priority when I have time, followed by #550. |
7a3f71a
to
dacf547
Compare
@effigies do you want to move this one to poldracklab/nitransforms until that is finished and we pull everything together in nibabel's proper? |
dacf547
to
d5f4a08
Compare
Hello @effigies, Thank you for updating!
To test for issues locally, |
This should be superseded by nitransforms. |
This is a first pass at supporting loading and saving of LTA files. This is a pretty flexible structure that encodes the geometry (equivalent to the VOX-RAS affine) of the source and target spaces, and an affine transform between those spaces.
I'm using
LabeledWrapStruct
essentially as a way to enforce numpy typing on a dict. TheVolumeGeometry
type seems like it may recur a bit in FreeSurfer, as it shows up in geometry files, as well.The end goal is to support conversion between different affine formats. Because I'm working with the three formats regularly, I'll aim for LTA (.lta), FSL (.mat) and ITK (.txt) formats first.
A not-incidental secondary goal will be to document these different formats, as most of their existing documentation is the parsing/emitting code in the various packages that support these formats.
TODO:
VOX_TO_VOX
andRAS_TO_RAS
, at minimum)