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
0fe45912
Commit
0fe45912
authored
1 month ago
by
Paul McCarthy
Browse files
Options
Downloads
Patches
Plain Diff
TEST: Test for loadFEATDesignFile
parent
1fb9d589
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
fsl/tests/test_featdesign.py
+42
-2
42 additions, 2 deletions
fsl/tests/test_featdesign.py
with
42 additions
and
2 deletions
fsl/tests/test_featdesign.py
+
42
−
2
View file @
0fe45912
...
@@ -103,8 +103,9 @@ with the following commands:
...
@@ -103,8 +103,9 @@ with the following commands:
"""
"""
import
os.path
as
op
import
os.path
as
op
import
numpy
as
np
import
textwrap
as
tw
import
numpy
as
np
import
pytest
import
pytest
...
@@ -400,6 +401,45 @@ def test_loadDesignMat():
...
@@ -400,6 +401,45 @@ def test_loadDesignMat():
featdesign
.
loadDesignMat
(
badfile
)
featdesign
.
loadDesignMat
(
badfile
)
# fsl/fslpy!469
def
test_loadFEATDesignFile
():
with
tempdir
():
with
open
(
'
design1.con
'
,
'
wt
'
)
as
f
:
f
.
write
(
tw
.
dedent
(
"""
/ContrastName1 mycontrast
/NumWaves 2
/NumContrasts 1
/Matrix
10 20
"""
).
strip
())
with
open
(
'
design2.con
'
,
'
wt
'
)
as
f
:
f
.
write
(
tw
.
dedent
(
"""
/ContrastName1
/NumWaves 2
/NumContrasts 1
/Matrix
10 20
"""
).
strip
())
des1
=
featanalysis
.
loadFEATDesignFile
(
'
design1.con
'
)
exp1
=
{
'
ContrastName1
'
:
'
mycontrast
'
,
'
NumWaves
'
:
'
2
'
,
'
NumContrasts
'
:
'
1
'
,
'
Matrix
'
:
'
10 20
'
}
des2
=
featanalysis
.
loadFEATDesignFile
(
'
design2.con
'
)
exp2
=
{
'
ContrastName1
'
:
''
,
'
NumWaves
'
:
'
2
'
,
'
NumContrasts
'
:
'
1
'
,
'
Matrix
'
:
'
10 20
'
}
assert
des1
==
exp1
assert
des2
==
exp2
def
test_VoxelwiseEVs
():
def
test_VoxelwiseEVs
():
with
tempdir
():
with
tempdir
():
img
=
tests
.
make_random_image
(
'
image.nii.gz
'
,
(
10
,
10
,
10
,
10
))
img
=
tests
.
make_random_image
(
'
image.nii.gz
'
,
(
10
,
10
,
10
,
10
))
...
...
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