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
99f3632a
Commit
99f3632a
authored
5 years ago
by
Paul McCarthy
Browse files
Options
Downloads
Plain Diff
Merge branch 'rf/vest' into 'master'
Rf/vest See merge request fsl/fslpy!146
parents
2aa93074
2cf9719c
No related branches found
No related tags found
No related merge requests found
Pipeline
#4051
passed
5 years ago
Stage: test
Stage: style
Stage: doc
Stage: deploy
Changes
3
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
CHANGELOG.rst
+25
-7
25 additions, 7 deletions
CHANGELOG.rst
fsl/data/vest.py
+10
-1
10 additions, 1 deletion
fsl/data/vest.py
tests/test_vest.py
+30
-2
30 additions, 2 deletions
tests/test_vest.py
with
65 additions
and
10 deletions
CHANGELOG.rst
+
25
−
7
View file @
99f3632a
...
...
@@ -2,16 +2,14 @@ This document contains the ``fslpy`` release history in reverse chronological
order.
2.
4
.0 (
Wednesday July 24th 2019
)
-------------------------
-------
2.
5
.0 (
Under development
)
-------------------------
Added
^^^^^
* New :mod:`.image.roi` module, for exracting an ROI of an image, or expanding
its field-of-view.
* New :meth:`.Image.getAffine` method, for retrieving an affine between any of
the voxel, FSL, or world coordinate systems.
* New :mod:`fsl.transforms` package, which contains classes and functions for
...
...
@@ -30,8 +28,8 @@ Changed
^^^^^^^
* The :mod:`.
r
es
ample_image` script has been updated to support resampling of
images with more than 3 dimensions
.
* The :mod:`.
v
es
t.looksLikeVestLutFile` function has been made slightly more
lenient
.
* `h5py <https://www.h5py.org/>`_ has been added to the ``fslpy`` dependencies.
...
...
@@ -39,11 +37,31 @@ Deprecated
^^^^^^^^^^
* The :mod:`fsl.utils.transform` module has been deprecated its functions can
* The :mod:`fsl.utils.transform` module has been deprecated
;
its functions can
now be found in the :mod:`fsl.transforms.affine` and
:mod:`fsl.transform.flirt` modules.
2.4.0 (Wednesday July 24th 2019)
--------------------------------
Added
^^^^^
* New :mod:`.image.roi` module, for extracting an ROI of an image, or expanding
its field-of-view.
Changed
^^^^^^^
* The :mod:`.resample_image` script has been updated to support resampling of
images with more than 3 dimensions.
2.3.1 (Friday July 5th 2019)
----------------------------
...
...
This diff is collapsed.
Click to expand it.
fsl/data/vest.py
+
10
−
1
View file @
99f3632a
...
...
@@ -22,7 +22,16 @@ def looksLikeVestLutFile(path):
``False`` otherwise.
"""
with
open
(
path
,
'
rt
'
)
as
f
:
return
f
.
readline
().
strip
()
==
'
%!VEST-LUT
'
lines
=
[]
for
i
in
range
(
10
):
line
=
f
.
readline
()
if
line
is
None
:
break
else
:
lines
.
append
(
line
.
strip
())
validHeaders
=
(
'
%!VEST-LUT
'
,
'
%BeginInstance
'
,
'
%%BeginInstance
'
)
return
len
(
lines
)
>
0
and
lines
[
0
]
in
validHeaders
def
loadVestLutFile
(
path
,
normalise
=
True
):
...
...
This diff is collapsed.
Click to expand it.
tests/test_vest.py
+
30
−
2
View file @
99f3632a
...
...
@@ -111,11 +111,37 @@ testfile4Colours = np.array([
testfile5
=
"""
Obviously not a VEST file
"""
testfile6
=
"""
%BeginInstance
/SavedInstanceClassName /ClassLUT
/PseudoColourmap [
<-color{0.0,1.0,5.0}->
<-color{1.0,2.0,4.0}->
<-color{2.0,3.0,3.0}->
]
>>
%%EndInstance
%%EOF
"""
testfile7
=
"""
%%BeginInstance
/SavedInstanceClassName /ClassLUT
/PseudoColourmap [
<-color{0.0,1.0,5.0}->
<-color{1.0,2.0,4.0}->
<-color{2.0,3.0,3.0}->
]
>>
%%EndInstance
%%EOF
"""
def
_createFiles
(
testdir
):
names
=
[
'
testfile1
'
,
'
testfile2
'
,
'
testfile3
'
,
'
testfile4
'
,
'
testfile5
'
]
texts
=
[
testfile1
,
testfile2
,
testfile3
,
testfile4
,
testfile5
]
names
=
[
'
testfile1
'
,
'
testfile2
'
,
'
testfile3
'
,
'
testfile4
'
,
'
testfile5
'
,
'
testfile6
'
,
'
testfile7
'
]
texts
=
[
testfile1
,
testfile2
,
testfile3
,
testfile4
,
testfile5
,
testfile6
,
testfile7
]
for
name
,
text
in
zip
(
names
,
texts
):
filename
=
op
.
join
(
testdir
,
'
{}.txt
'
.
format
(
name
))
...
...
@@ -137,6 +163,8 @@ def test_looksLikeVestLutFile():
assert
vest
.
looksLikeVestLutFile
(
op
.
join
(
testdir
,
'
testfile3.txt
'
))
assert
vest
.
looksLikeVestLutFile
(
op
.
join
(
testdir
,
'
testfile4.txt
'
))
assert
not
vest
.
looksLikeVestLutFile
(
op
.
join
(
testdir
,
'
testfile5.txt
'
))
assert
vest
.
looksLikeVestLutFile
(
op
.
join
(
testdir
,
'
testfile6.txt
'
))
assert
vest
.
looksLikeVestLutFile
(
op
.
join
(
testdir
,
'
testfile7.txt
'
))
finally
:
shutil
.
rmtree
(
testdir
)
...
...
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