Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Christoph Arthofer
fslpy
Commits
462bff2f
Commit
462bff2f
authored
Jan 21, 2021
by
Paul McCarthy
🚵
Browse files
Merge branch 'rel/3.5.1' into 'v3.5'
Rel/3.5.1 See merge request fsl/fslpy!278
parents
9f467c88
e1225806
Changes
5
Hide whitespace changes
Inline
Side-by-side
CHANGELOG.rst
View file @
462bff2f
...
...
@@ -2,6 +2,26 @@ This document contains the ``fslpy`` release history in reverse chronological
order.
3.5.1 (Thursday 21st January 2021)
----------------------------------
Added
^^^^^
* New :func:`.featanalysis.loadFsf` function, for loading arbitrary ``.fsf``
files (!276).
Fixed
^^^^^
* Adjustments to :mod:`.dicom` tests to work with different versions of
``dcm2niix`` (!277).
3.5.0 (Wednesday 20th January 2021)
-----------------------------------
...
...
fsl/data/featanalysis.py
View file @
462bff2f
...
...
@@ -22,6 +22,7 @@ following functions are provided:
isFirstLevelAnalysis
loadDesign
loadContrasts
loadFsf
loadSettings
getThresholds
loadClusterResults
...
...
@@ -216,17 +217,16 @@ def loadContrasts(featdir):
return
names
,
contrasts
def
loadSettings
(
featdir
):
"""Loads the analysis settings from a FEAT directory.
def
loadFsf
(
designfsf
):
"""Loads the analysis settings from a text file (.fsf) used to configure
FEAT.
Returns a dict containing the settings specified in the ``design.fsf``
file within the directory
Returns a dict containing the settings specified in the file
:arg
featdir: A FEAT directory
.
:arg
designfsf: A .fsf file
.
"""
settings
=
collections
.
OrderedDict
()
designfsf
=
op
.
join
(
featdir
,
'design.fsf'
)
log
.
debug
(
'Loading FEAT settings from {}'
.
format
(
designfsf
))
...
...
@@ -251,6 +251,20 @@ def loadSettings(featdir):
return
settings
def
loadSettings
(
featdir
):
"""Loads the analysis settings from a FEAT directory.
Returns a dict containing the settings specified in the ``design.fsf``
file within the directory
:arg featdir: A FEAT directory.
"""
designfsf
=
op
.
join
(
featdir
,
'design.fsf'
)
return
loadFsf
(
designfsf
)
def
loadDesign
(
featdir
,
settings
):
"""Loads the design matrix from a FEAT directory.
...
...
fsl/version.py
View file @
462bff2f
...
...
@@ -47,7 +47,7 @@ import re
import
string
__version__
=
'3.5.
0
'
__version__
=
'3.5.
1
'
"""Current version number, as a string. """
...
...
tests/test_dicom.py
View file @
462bff2f
...
...
@@ -130,7 +130,8 @@ def test_scanDir():
for
s
in
series
:
assert
s
[
'PatientName'
]
in
(
'MCCARTHY_PAUL'
,
'MCCARTHY^PAUL'
,
'MCCARTHY_PAUL_2'
)
'MCCARTHY_PAUL_2'
,
'MCCARTHY^PAUL^2'
)
def
test_sersiesCRC
():
...
...
@@ -183,11 +184,13 @@ def test_loadSeries():
assert
img
[:].
shape
==
expShape
assert
img
.
getMeta
(
'PatientName'
)
in
(
'MCCARTHY_PAUL'
,
'MCCARTHY^PAUL'
,
'MCCARTHY_PAUL_2'
)
'MCCARTHY_PAUL_2'
,
'MCCARTHY^PAUL^2'
)
assert
'PatientName'
in
img
.
metaKeys
()
assert
'MCCARTHY_PAUL'
in
img
.
metaValues
()
or
\
'MCCARTHY^PAUL'
in
img
.
metaValues
()
or
\
'MCCARTHY_PAUL_2'
in
img
.
metaValues
()
assert
(
'PatientName'
,
'MCCARTHY_PAUL'
)
in
img
.
metaItems
()
or
\
(
'PatientName'
,
'MCCARTHY^PAUL'
)
in
img
.
metaItems
()
or
\
(
'PatientName'
,
'MCCARTHY_PAUL_2'
)
in
img
.
metaItems
()
(
'PatientName'
,
'MCCARTHY_PAUL_2'
)
in
img
.
metaItems
()
or
\
(
'PatientName'
,
'MCCARTHY^PAUL^2'
)
in
img
.
metaItems
()
tests/test_featanalysis.py
View file @
462bff2f
...
...
@@ -240,9 +240,10 @@ def test_loadSettings():
with
tests
.
testdir
()
as
testdir
:
featdir
=
op
.
join
(
testdir
,
'analysis.feat'
)
tests
.
make_dummy_file
(
op
.
join
(
featdir
,
'design.fsf'
),
contents
)
result
=
featanalysis
.
loadSettings
(
featdir
)
assert
result
==
expected
designfsf
=
op
.
join
(
featdir
,
'design.fsf'
)
tests
.
make_dummy_file
(
designfsf
,
contents
)
assert
featanalysis
.
loadSettings
(
featdir
)
==
expected
assert
featanalysis
.
loadFsf
(
designfsf
)
==
expected
def
test_loadDesign
():
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment