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
0e835e7c
Commit
0e835e7c
authored
4 years ago
by
Paul McCarthy
Browse files
Options
Downloads
Patches
Plain Diff
TEST: Test that loadClusterResults loads correct values
parent
947b7693
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_featanalysis.py
+34
-4
34 additions, 4 deletions
tests/test_featanalysis.py
with
34 additions
and
4 deletions
tests/test_featanalysis.py
+
34
−
4
View file @
0e835e7c
...
@@ -301,14 +301,15 @@ def test_loadClusterResults():
...
@@ -301,14 +301,15 @@ def test_loadClusterResults():
with
tests
.
testdir
()
as
testdir
:
with
tests
.
testdir
()
as
testdir
:
# For higher level analyses, the
# work from a copy of the test data directory
# loadClusterResults function peeks
# at the FEAT input data file
# header, so we have to generate it.
newfeatdir
=
op
.
join
(
testdir
,
'
analysis.feat
'
)
newfeatdir
=
op
.
join
(
testdir
,
'
analysis.feat
'
)
shutil
.
copytree
(
op
.
join
(
datadir
,
featdir
),
newfeatdir
)
shutil
.
copytree
(
op
.
join
(
datadir
,
featdir
),
newfeatdir
)
featdir
=
newfeatdir
featdir
=
newfeatdir
# For higher level analyses, the
# loadClusterResults function peeks
# at the FEAT input data file
# header, so we have to generate it.
if
not
firstlevel
:
if
not
firstlevel
:
datafile
=
op
.
join
(
featdir
,
'
filtered_func_data.nii.gz
'
)
datafile
=
op
.
join
(
featdir
,
'
filtered_func_data.nii.gz
'
)
data
=
np
.
random
.
randint
(
1
,
10
,
(
91
,
109
,
91
))
data
=
np
.
random
.
randint
(
1
,
10
,
(
91
,
109
,
91
))
...
@@ -333,6 +334,35 @@ def test_loadClusterResults():
...
@@ -333,6 +334,35 @@ def test_loadClusterResults():
assert
featanalysis
.
loadClusterResults
(
assert
featanalysis
.
loadClusterResults
(
featdir
,
settings
,
0
)
is
None
featdir
,
settings
,
0
)
is
None
# The above loop just checks that the number of
# clusters loaded for each analysis was correct.
# Below we check that the cluster data was loaded
# correctly, just for one analysis
featdir
=
op
.
join
(
datadir
,
'
1stlevel_1.feat
'
)
settings
=
featanalysis
.
loadSettings
(
featdir
)
cluster
=
featanalysis
.
loadClusterResults
(
featdir
,
settings
,
0
)[
0
]
expected
=
{
'
index
'
:
1
,
'
nvoxels
'
:
296
,
'
p
'
:
1.79e-27
,
'
logp
'
:
26.7
,
'
zmax
'
:
6.03
,
'
zmaxx
'
:
34
,
'
zmaxy
'
:
10
,
'
zmaxz
'
:
1
,
'
zcogx
'
:
31.4
,
'
zcogy
'
:
12.3
,
'
zcogz
'
:
1.72
,
'
copemax
'
:
612
,
'
copemaxx
'
:
34
,
'
copemaxy
'
:
10
,
'
copemaxz
'
:
1
,
'
copemean
'
:
143
}
for
k
,
v
in
expected
.
items
():
assert
np
.
isclose
(
v
,
getattr
(
cluster
,
k
))
def
test_getDataFile
():
def
test_getDataFile
():
paths
=
[
'
analysis.feat/filtered_func_data.nii.gz
'
,
paths
=
[
'
analysis.feat/filtered_func_data.nii.gz
'
,
...
...
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