Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
FSL
fslpy
Commits
a44c25dd
Commit
a44c25dd
authored
Oct 08, 2020
by
Paul McCarthy
🚵
Browse files
TEST: Add test case with shear component
parent
f339b54d
Changes
2
Hide whitespace changes
Inline
Side-by-side
tests/test_transform/test_affine.py
View file @
a44c25dd
...
...
@@ -226,8 +226,9 @@ def test_compose_and_decompose():
xform
=
lines
[
i
*
4
:
i
*
4
+
4
]
xform
=
np
.
genfromtxt
(
xform
)
scales
,
offsets
,
rotations
=
affine
.
decompose
(
xform
)
result
=
affine
.
compose
(
scales
,
offsets
,
rotations
)
scales
,
offsets
,
rotations
,
shears
=
affine
.
decompose
(
xform
,
shears
=
True
)
result
=
affine
.
compose
(
scales
,
offsets
,
rotations
,
shears
=
shears
)
assert
np
.
all
(
np
.
isclose
(
xform
,
result
,
atol
=
1e-5
))
...
...
tests/test_transform/testdata/test_transform_test_compose.txt
View file @
a44c25dd
...
...
@@ -23,7 +23,7 @@
1.0 0.0 0.0 0.0
0.0 1.0 0.0 0.0
0.0 0.0 -1.0 0.0
0.0 0.0 0.0 1.0
0.0 0.0 0.0 1.0
0.5 0.0 0.0 0.0
0.0 2.4 0.0 0.0
...
...
@@ -35,22 +35,22 @@
0.0 0.0 1.6 53.0
0.0 0.0 0.0 1.0
0.5 0.0 0.0 10.0
0.5 0.0 0.0 10.0
0.0 0.0 -1.6 -6.7877502441
0.0 2.4 0.0 29.7931518555
0.0 0.0 0.0 1.0
0.0 0.0 0.0 1.0
0.0 -2.4 -0.0 30.6160888672
0.0 0.0 -1.6 -6.7877502441
0.5 0.0 0.0 50.5961608887
0.0 0.0 0.0 1.0
0.0 0.0 0.0 1.0
-0.0 1.3765834472 1.3106432709 0.0736983719
0.0 -1.9659649063 0.9177222982 14.1062102814
0.5 0.0 0.0 50.5961608887
0.0 0.0 0.0 1.0
0.453766452 -0.7004337463 0.4832135801 16.789591468
0.453766452 -0.7004337463 0.4832135801 16.789591468
-0.0159784155 1.6056689296 1.1880787388 -16.2943532298
-0.2093817023 -1.640493784 0.9565424959 66.1123321137
0.0 0.0 0.0 1.0
...
...
@@ -109,3 +109,8 @@
0.041017 -0.081580 -6.319922 72.090378
-0.000000 0.381914 -1.365036 -41.159451
0.000000 0.000000 0.000000 1.000000
1.1441229 0.833406 3.765340 3
0.8312539 2.459607 -0.804545 4
1.4142136 1.554275 1.724796 5
0.0 0.0 0.0 1
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment