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
FSL
fslpy
Commits
d4d0d342
Commit
d4d0d342
authored
Feb 28, 2020
by
Paul McCarthy
🚵
Browse files
Merge branch 'rel/2.8.3' into 'v2.8'
Rel/2.8.3 See merge request fsl/fslpy!201
parents
477a43a5
8ce91f13
Pipeline
#5066
passed with stages
in 1 minute and 28 seconds
Changes
4
Pipelines
2
Hide whitespace changes
Inline
Side-by-side
.ci/test_template.sh
View file @
d4d0d342
...
...
@@ -2,6 +2,13 @@
set
-e
# Temporary: this should be done
# in docker image definition
apt
install
-y
locales
locale-gen en_US.UTF-8
locale-gen en_GB.UTF-8
update-locale
# If running on a fork repository, we merge in the
# upstream/master branch. This is done so that merge
# requests from fork to the parent repository will
...
...
@@ -59,4 +66,4 @@ if [[ $CI_COMMIT_REF_NAME == v* ]]; then
python setup.py
test
--addopts
=
"
$TEST_OPTS
-m 'longtest'"
fi
python
-m
coverage report
python
-m
coverage report
-i
CHANGELOG.rst
View file @
d4d0d342
...
...
@@ -2,6 +2,16 @@ This document contains the ``fslpy`` release history in reverse chronological
order.
2.8.3 (Friday 28th February 2020)
---------------------------------
Fixed
^^^^^
* Fixed a bug in the :meth:`.Image.save` method.
2.8.2 (Thursday 27th February 2020)
-----------------------------------
...
...
fsl/data/image.py
View file @
d4d0d342
...
...
@@ -254,7 +254,7 @@ class Nifti(notifier.Notifier, meta.Meta):
shape
,
pixdim
)
self
.
header
=
header
self
.
__
header
=
header
self
.
__shape
=
shape
self
.
__origShape
=
origShape
self
.
__pixdim
=
pixdim
...
...
@@ -262,6 +262,11 @@ class Nifti(notifier.Notifier, meta.Meta):
self
.
__isNeurological
=
isneuro
def
__del__
(
self
):
"""Clears the reference to the ``nibabel`` header object. """
self
.
__header
=
None
@
staticmethod
def
determineShape
(
header
):
"""This method is called by :meth:`__init__`. It figures out the actual
...
...
@@ -492,6 +497,24 @@ class Nifti(notifier.Notifier, meta.Meta):
return
''
.
join
([
c
for
c
in
val
if
c
in
string
.
printable
]).
strip
()
@
property
def
header
(
self
):
"""Return a reference to the ``nibabel`` header object. """
return
self
.
__header
@
header
.
setter
def
header
(
self
,
header
):
"""Replace the ``nibabel`` header object managed by this ``Nifti``
with a new header. The new header must have the same dimensions,
voxel size, and orientation as the old one.
"""
new
=
Nifti
(
header
)
if
not
(
self
.
sameSpace
(
new
)
and
self
.
ndim
==
new
.
ndim
):
raise
ValueError
(
'Incompatible header'
)
self
.
__header
=
header
@
property
def
niftiVersion
(
self
):
"""Returns the NIFTI file version:
...
...
@@ -1180,8 +1203,7 @@ class Image(Nifti):
def
__del__
(
self
):
"""Closes any open file handles, and clears some references. """
self
.
header
=
None
Nifti
.
__del__
(
self
)
self
.
__nibImage
=
None
self
.
__imageWrapper
=
None
...
...
@@ -1411,12 +1433,6 @@ class Image(Nifti):
nib
.
save
(
self
.
__nibImage
,
tmpfname
)
# nibabel should close any old
# file handles when the image/
# header refs are deleted
self
.
__nibImage
=
None
self
.
header
=
None
# Copy to final destination,
# and reload from there
imcp
.
imcp
(
tmpfname
,
filename
,
overwrite
=
True
)
...
...
fsl/version.py
View file @
d4d0d342
...
...
@@ -47,7 +47,7 @@ import re
import
string
__version__
=
'2.8.
2
'
__version__
=
'2.8.
3
'
"""Current version number, as a string. """
...
...
Write
Preview
Markdown
is supported
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