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
167a8633
Commit
167a8633
authored
7 years ago
by
Paul McCarthy
Browse files
Options
Downloads
Patches
Plain Diff
loadDesignMat now expects the path to the design matrix file, not to the FEAT
directory.
parent
b2e804e6
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
fsl/data/featdesign.py
+13
-8
13 additions, 8 deletions
fsl/data/featdesign.py
with
13 additions
and
8 deletions
fsl/data/featdesign.py
+
13
−
8
View file @
167a8633
...
...
@@ -146,7 +146,7 @@ class FEATFSFDesign(object):
# Get the design matrix, and some
# information about the analysis
designMatrix
=
loadDesignMat
(
featDir
)
designMatrix
=
loadDesignMat
(
op
.
join
(
featDir
,
'
design.mat
'
)
)
version
=
float
(
settings
[
'
version
'
])
level
=
int
(
settings
[
'
level
'
])
...
...
@@ -407,7 +407,7 @@ def getFirstLevelEVs(featDir, settings, designMat):
from its ``design.fsf`` file (see
:func:`.featanalysis.loadSettings`).
:arg designMat: The FEAT design matrix (a numpy array - see
:func:`
.featanalysis.
loadDesign`).
:func:`loadDesign
Mat
`).
:returns: A list of :class:`EV` instances, one for each column in the
design matrix.
...
...
@@ -570,7 +570,7 @@ def getHigherLevelEVs(featDir, settings, designMat):
from its ``design.fsf`` file (see
:func:`.featanalysis.loadSettings`).
:arg designMat: The FEAT design matrix (a numpy array - see
:func:`
.featanalysis.
loadDesign`).
:func:`loadDesign
Mat
`).
:returns: A list of :class:`EV` instances, one for each column in the
design matrix.
...
...
@@ -619,17 +619,16 @@ def getHigherLevelEVs(featDir, settings, designMat):
return
evs
def
loadDesignMat
(
featdir
):
"""
Loads the design matrix
from a FEAT directory
.
def
loadDesignMat
(
designmat
):
"""
Loads the
specified
design matrix.
Returns a ``numpy`` array containing the design matrix data, where the
first dimension corresponds to the data points, and the second to the EVs.
:arg
featdir: A FEAT directory
.
:arg
designmat: Path to the ``design.mat`` file
.
"""
matrix
=
None
designmat
=
op
.
join
(
featdir
,
'
design.mat
'
)
matrix
=
None
log
.
debug
(
'
Loading FEAT design matrix from {}
'
.
format
(
designmat
))
...
...
@@ -637,6 +636,12 @@ def loadDesignMat(featdir):
while
True
:
line
=
f
.
readline
()
# readline returns an empty string at EOF
if
line
==
''
:
break
# Matrix data starts after "/Matrix"
if
line
.
strip
()
==
'
/Matrix
'
:
break
...
...
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