Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
F
fslpy
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Deploy
Releases
Container Registry
Model registry
Monitor
Incidents
Analyze
Value stream analytics
Contributor 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
Michiel Cottaar
fslpy
Commits
46582b1f
Commit
46582b1f
authored
8 years ago
by
Paul McCarthy
Browse files
Options
Downloads
Patches
Plain Diff
Full model fits are no longer de/re-meand.
parent
bb6e10a8
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
fsl/data/featimage.py
+10
-21
10 additions, 21 deletions
fsl/data/featimage.py
with
10 additions
and
21 deletions
fsl/data/featimage.py
+
10
−
21
View file @
46582b1f
...
...
@@ -294,23 +294,15 @@ class FEATImage(fslimage.Image):
return
self
.
__clustMasks
[
con
]
def
fit
(
self
,
contrast
,
xyz
,
fullModel
=
False
):
def
fit
(
self
,
contrast
,
xyz
):
"""
Calculates the model fit for the given contrast vector
at the given voxel.
Passing in a contrast of all 1s, and ``fullModel=True`` will
get you the full model fit. Pass in ``fullModel=False`` for
all other contrasts, otherwise the model fit values will not
be scaled correctly.
:arg contrast: The contrast vector (pass all 1s for a full model
fit).
:arg xyz: Coordinates of the voxel to calculate the model fit
for.
:arg fullModel: Set to ``True`` for a full model fit, ``False``
otherwise.
"""
if
self
.
__design
is
None
:
...
...
@@ -356,19 +348,16 @@ class FEATImage(fslimage.Image):
pe
=
self
.
getPE
(
i
)[
x
,
y
,
z
]
modelfit
+=
ev
*
pe
*
contrast
[
i
]
# Make sure the model fit has an appropriate mean.
#
# Full model fits should, but won't necessarily,
# have the same mean as the data.
#
# The data in first level analyses is demeaned before
# model fitting, so we need to add it back in.
if
fullModel
:
return
modelfit
-
modelfit
.
mean
()
+
data
.
mean
()
elif
firstLevel
:
return
modelfit
-
modelfit
.
mean
()
+
data
.
mean
()
else
:
return
modelfit
# Make sure the model fit has an
# appropriate mean. The data in
# first level analyses is demeaned
# before model fitting, so we need
# to add it back in.
if
firstLevel
:
return
modelfit
+
data
.
mean
()
else
:
return
modelfit
def
partialFit
(
self
,
contrast
,
xyz
,
fullModel
=
False
):
def
partialFit
(
self
,
contrast
,
xyz
):
"""
Calculates and returns the partial model fit for the specified
contrast vector at the specified voxel.
...
...
@@ -377,6 +366,6 @@ class FEATImage(fslimage.Image):
x
,
y
,
z
=
xyz
residuals
=
self
.
getResiduals
()[
x
,
y
,
z
,
:]
modelfit
=
self
.
fit
(
contrast
,
xyz
,
fullModel
=
fullModel
)
modelfit
=
self
.
fit
(
contrast
,
xyz
)
return
residuals
+
modelfit
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