Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
F
fslpy
Manage
Activity
Members
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Analyze
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
FSL
fslpy
Commits
29e0af81
Commit
29e0af81
authored
5 years ago
by
Paul McCarthy
Browse files
Options
Downloads
Patches
Plain Diff
TEST: edge cases
parent
6e91d3fb
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
tests/test_wrappers/test_fslstats.py
+18
-0
18 additions, 0 deletions
tests/test_wrappers/test_fslstats.py
with
18 additions
and
0 deletions
tests/test_wrappers/test_fslstats.py
+
18
−
0
View file @
29e0af81
...
@@ -6,6 +6,8 @@ import os.path as op
...
@@ -6,6 +6,8 @@ import os.path as op
import
sys
import
sys
import
contextlib
import
contextlib
import
pytest
import
numpy
as
np
import
numpy
as
np
import
fsl.utils.run
as
run
import
fsl.utils.run
as
run
...
@@ -65,6 +67,10 @@ def test_fslstats_cmdline():
...
@@ -65,6 +67,10 @@ def test_fslstats_cmdline():
expected
=
cmd
+
'
-t image -H 10 1 99 -d diff
'
expected
=
cmd
+
'
-t image -H 10 1 99 -d diff
'
assert
result
[
0
]
==
expected
assert
result
[
0
]
==
expected
# unknown option
with
pytest
.
raises
(
AttributeError
):
fw
.
fslstats
(
'
image
'
).
Q
def
test_fslstats_result
():
def
test_fslstats_result
():
with
tempdir
.
tempdir
():
with
tempdir
.
tempdir
():
...
@@ -92,3 +98,15 @@ def test_fslstats_result():
...
@@ -92,3 +98,15 @@ def test_fslstats_result():
make_random_image
(
'
image
'
,
(
10
,
10
,
10
,
5
))
make_random_image
(
'
image
'
,
(
10
,
10
,
10
,
5
))
result
=
fw
.
fslstats
(
'
image
'
,
K
=
'
mask
'
,
t
=
True
).
run
()
result
=
fw
.
fslstats
(
'
image
'
,
K
=
'
mask
'
,
t
=
True
).
run
()
assert
result
.
shape
==
(
5
,
3
,
2
)
assert
result
.
shape
==
(
5
,
3
,
2
)
# -t/-K with a 3D image
with
mockFSLDIR
(
'
(4,)
'
)
as
fsldir
:
make_random_image
(
'
image
'
,
(
10
,
10
,
10
))
result
=
fw
.
fslstats
(
'
image
'
,
K
=
'
mask
'
,
t
=
True
).
run
()
assert
result
.
shape
==
(
4
,)
result
=
fw
.
fslstats
(
'
image
'
,
t
=
True
).
run
()
assert
result
.
shape
==
(
4
,)
result
=
fw
.
fslstats
(
'
image
'
,
K
=
'
mask
'
).
run
()
assert
result
.
shape
==
(
4
,)
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment