Skip to content

Commit 8fc8227

Browse files
committed
fix: add a first battery of tests
Added some initial tests to check the writing of transforms to ITK and FSL formats.
1 parent 77de318 commit 8fc8227

13 files changed

+148
-5
lines changed

nibabel/affines.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -304,7 +304,9 @@ def obliquity(affine):
304304
The term *obliquity* is defined here as the rotation of those axes with
305305
respect to the cardinal axes.
306306
This implementation is inspired by `AFNI's implementation
307-
<https://github.com/afni/afni/blob/b6a9f7a21c1f3231ff09efbd861f8975ad48e525/src/thd_coords.c#L660-L698>`_
307+
<https://github.com/afni/afni/blob/b6a9f7a21c1f3231ff09efbd861f8975ad48e525/src/thd_coords.c#L660-L698>`_.
308+
For further details about *obliquity*, check `AFNI's documentation
309+
<https://sscc.nimh.nih.gov/sscc/dglen/Obliquity>_.
308310
309311
Parameters
310312
----------

nibabel/tests/data/affine-LAS-itk.tfm

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
affine-RAS-itk.tfm

nibabel/tests/data/affine-LAS.fsl

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
affine-RAS.fsl

nibabel/tests/data/affine-LPS-itk.tfm

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
#Insight Transform File V1.0
2+
#Transform 0
3+
Transform: MatrixOffsetTransformBase_double_3_3
4+
Parameters: 0.999999 -0.000999999 -0.001 0.00140494 0.621609 0.783327 -0.000161717 -0.783327 0.62161 -4 -2 -1
5+
FixedParameters: 0 0 0

nibabel/tests/data/affine-LPS.fsl

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
0.999999 -0.00140494 0.000161717 -3.89014
2+
0.000999999 0.621609 -0.783327 105.905
3+
0.001 0.783327 0.62161 -34.3513
4+
0 0 0 1

nibabel/tests/data/affine-RAS-itk.tfm

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
#Insight Transform File V1.0
2+
#Transform 0
3+
Transform: MatrixOffsetTransformBase_double_3_3
4+
Parameters: 0.999999 -0.000999999 -0.001 0.00140494 0.621609 0.783327 -0.000161717 -0.783327 0.62161 -4 -2 -1
5+
FixedParameters: 0 0 0

nibabel/tests/data/affine-RAS.fsl

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
0.999999 -0.00140494 -0.000161717 4.14529
2+
0.000999999 0.621609 0.783327 -37.3811
3+
-0.001 -0.783327 0.62161 107.976
4+
0 0 0 1
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
#Insight Transform File V1.0
2+
#Transform 0
3+
Transform: MatrixOffsetTransformBase_double_3_3
4+
Parameters: 0.999999 -0.000999999 -0.001 0.00140494 0.621609 0.783327 -0.000161717 -0.783327 0.62161 -4 -2 -1
5+
FixedParameters: 0 0 0

nibabel/tests/data/affine-oblique.fsl

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
0.999998 -0.00181872 -0.0011965 4.26083
2+
0.00206779 0.621609 0.783325 -25.3129
3+
-0.000680894 -0.783326 0.621611 101.967
4+
0 0 0 1
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
../../../doc/source/downloads/someones_anatomy.nii.gz

0 commit comments

Comments
 (0)