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
8dc1cebb
Commit
8dc1cebb
authored
8 months ago
by
Paul McCarthy
Browse files
Options
Downloads
Patches
Plain Diff
ENH: accessors for zfstats
parent
79c280da
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/data/featimage.py
+21
-0
21 additions, 0 deletions
fsl/data/featimage.py
with
21 additions
and
0 deletions
fsl/data/featimage.py
+
21
−
0
View file @
8dc1cebb
...
@@ -72,9 +72,11 @@ class FEATImage(fslimage.Image):
...
@@ -72,9 +72,11 @@ class FEATImage(fslimage.Image):
if
featanalysis
.
hasStats
(
featDir
):
if
featanalysis
.
hasStats
(
featDir
):
design
=
featanalysis
.
loadDesign
(
featDir
,
settings
)
design
=
featanalysis
.
loadDesign
(
featDir
,
settings
)
names
,
cons
=
featanalysis
.
loadContrasts
(
featDir
)
names
,
cons
=
featanalysis
.
loadContrasts
(
featDir
)
ftests
=
featanalysis
.
loadFTests
(
featDir
)
else
:
else
:
design
=
None
design
=
None
names
,
cons
=
[],
[]
names
,
cons
=
[],
[]
ftests
=
[]
fslimage
.
Image
.
__init__
(
self
,
path
,
**
kwargs
)
fslimage
.
Image
.
__init__
(
self
,
path
,
**
kwargs
)
...
@@ -83,12 +85,14 @@ class FEATImage(fslimage.Image):
...
@@ -83,12 +85,14 @@ class FEATImage(fslimage.Image):
self
.
__design
=
design
self
.
__design
=
design
self
.
__contrastNames
=
names
self
.
__contrastNames
=
names
self
.
__contrasts
=
cons
self
.
__contrasts
=
cons
self
.
__ftests
=
ftests
self
.
__settings
=
settings
self
.
__settings
=
settings
self
.
__residuals
=
None
self
.
__residuals
=
None
self
.
__pes
=
[
None
]
*
self
.
numEVs
()
self
.
__pes
=
[
None
]
*
self
.
numEVs
()
self
.
__copes
=
[
None
]
*
self
.
numContrasts
()
self
.
__copes
=
[
None
]
*
self
.
numContrasts
()
self
.
__zstats
=
[
None
]
*
self
.
numContrasts
()
self
.
__zstats
=
[
None
]
*
self
.
numContrasts
()
self
.
__zfstats
=
[
None
]
*
self
.
numFTests
()
self
.
__clustMasks
=
[
None
]
*
self
.
numContrasts
()
self
.
__clustMasks
=
[
None
]
*
self
.
numContrasts
()
if
'
name
'
not
in
kwargs
:
if
'
name
'
not
in
kwargs
:
...
@@ -102,6 +106,7 @@ class FEATImage(fslimage.Image):
...
@@ -102,6 +106,7 @@ class FEATImage(fslimage.Image):
self
.
__pes
=
None
self
.
__pes
=
None
self
.
__copes
=
None
self
.
__copes
=
None
self
.
__zstats
=
None
self
.
__zstats
=
None
self
.
__zfstats
=
None
self
.
__clustMasks
=
None
self
.
__clustMasks
=
None
...
@@ -191,6 +196,11 @@ class FEATImage(fslimage.Image):
...
@@ -191,6 +196,11 @@ class FEATImage(fslimage.Image):
return
len
(
self
.
__contrasts
)
return
len
(
self
.
__contrasts
)
def
numFTests
(
self
):
"""
Returns the number of f-tests in the analysis.
"""
return
len
(
self
.
__ftests
)
def
contrastNames
(
self
):
def
contrastNames
(
self
):
"""
Returns a list containing the name of each contrast in the analysis.
"""
Returns a list containing the name of each contrast in the analysis.
"""
"""
...
@@ -274,6 +284,17 @@ class FEATImage(fslimage.Image):
...
@@ -274,6 +284,17 @@ class FEATImage(fslimage.Image):
return
self
.
__zstats
[
con
]
return
self
.
__zstats
[
con
]
def
getZFStats
(
self
,
ftest
):
"""
Returns the Z statistic image for the given f-test (0-indexed).
"""
if
self
.
__zfstats
[
ftest
]
is
None
:
zfile
=
featanalysis
.
getZFStatFile
(
self
.
__featDir
,
ftest
)
self
.
__zstats
[
con
]
=
fslimage
.
Image
(
zfile
,
name
=
f
'
{
self
.
__analysisName
}
: zfstat
{
con
+
1
}
'
)
return
self
.
__zfstats
[
ftest
]
def
getClusterMask
(
self
,
con
):
def
getClusterMask
(
self
,
con
):
"""
Returns the cluster mask image for the given contrast (0-indexed).
"""
Returns the cluster mask image for the given contrast (0-indexed).
"""
"""
...
...
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