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
73b415bd
Commit
73b415bd
authored
Nov 30, 2017
by
Paul McCarthy
🚵
Browse files
unit tests for rmsdev function
parent
6d1802e6
Changes
1
Hide whitespace changes
Inline
Side-by-side
tests/test_transform.py
View file @
73b415bd
...
...
@@ -537,3 +537,34 @@ def test_sformToFlirtMatrix():
assert
np
.
all
(
np
.
isclose
(
result1
,
expected
))
assert
np
.
all
(
np
.
isclose
(
result2
,
expected
))
def
test_rmsdev
():
t1
=
np
.
eye
(
4
)
t2
=
transform
.
scaleOffsetXform
([
1
,
1
,
1
],
[
2
,
0
,
0
])
assert
np
.
isclose
(
transform
.
rmsdev
(
t1
,
t2
),
2
)
assert
np
.
isclose
(
transform
.
rmsdev
(
t1
,
t2
,
R
=
2
),
2
)
assert
np
.
isclose
(
transform
.
rmsdev
(
t1
,
t2
,
R
=
2
,
xc
=
(
1
,
1
,
1
)),
2
)
t1
=
np
.
eye
(
3
)
lastdist
=
0
for
i
in
range
(
1
,
11
):
rot
=
np
.
pi
*
i
/
10.0
t2
=
transform
.
axisAnglesToRotMat
(
rot
,
0
,
0
)
result
=
transform
.
rmsdev
(
t1
,
t2
)
assert
result
>
lastdist
lastdist
=
result
for
i
in
range
(
11
,
20
):
rot
=
np
.
pi
*
i
/
10.0
t2
=
transform
.
axisAnglesToRotMat
(
rot
,
0
,
0
)
result
=
transform
.
rmsdev
(
t1
,
t2
)
assert
result
<
lastdist
lastdist
=
result
Write
Preview
Supports
Markdown
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