Skip to content

Commit dd24b20

Browse files
committed
Merge remote-tracking branch 'upstream/master' into rel/2.3.1
2 parents 15df138 + 7877add commit dd24b20

24 files changed

+701
-104
lines changed

.travis.yml

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,29 +4,31 @@
44
# for it to be on multiple physical lines, so long as you remember: - There
55
# can't be any leading "-"s - All newlines will be removed, so use ";"s
66

7+
dist: xenial
8+
sudo: true
79
language: python
810

9-
# Run jobs on container-based infrastructure, can be overridden per job
10-
sudo: false
11-
1211
cache:
1312
directories:
1413
- $HOME/.cache/pip
1514
env:
1615
global:
17-
- DEPENDS="six numpy scipy matplotlib h5py pillow pydicom"
16+
- DEPENDS="six numpy scipy matplotlib h5py pillow pydicom hypothesis"
1817
- OPTIONAL_DEPENDS=""
1918
- INSTALL_TYPE="setup"
2019
- EXTRA_WHEELS="https://5cf40426d9f06eb7461d-6fe47d9331aba7cd62fc36c7196769e4.ssl.cf2.rackcdn.com"
2120
- PRE_WHEELS="https://7933911d6844c6c53a7d-47bd50c35cd79bd838daf386af554a83.ssl.cf2.rackcdn.com"
2221
- EXTRA_PIP_FLAGS="--find-links=$EXTRA_WHEELS"
2322
- PRE_PIP_FLAGS="--pre $EXTRA_PIP_FLAGS --find-links $PRE_WHEELS"
2423
python:
25-
- 3.4
2624
- 3.5
2725
- 3.6
26+
- 3.7
2827
matrix:
2928
include:
29+
- python: 3.4
30+
dist: trusty
31+
sudo: false
3032
- python: 2.7
3133
env:
3234
- COVERAGE=1
@@ -95,7 +97,7 @@ before_install:
9597
- source venv/bin/activate
9698
- python --version # just to check
9799
- pip install -U pip wheel # needed at one point
98-
- retry pip install nose flake8 mock # always
100+
- retry pip install nose flake8 mock hypothesis # always
99101
- pip install $EXTRA_PIP_FLAGS $DEPENDS $OPTIONAL_DEPENDS
100102
- if [ "${COVERAGE}" == "1" ]; then
101103
pip install coverage;

COPYING

Lines changed: 28 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -121,36 +121,40 @@ Sphinx 0.6 doesn't work properly.
121121
OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH
122122
DAMAGE.
123123

124-
Ordereddict
124+
OrderedSet
125125
-----------
126126

127-
In ``nibabel/externals/ordereddict.py``
127+
In ``nibabel/externals/oset.py``
128128

129-
Copied from: https://pypi.python.org/packages/source/o/ordereddict/ordereddict-1.1.tar.gz#md5=a0ed854ee442051b249bfad0f638bbec
129+
Copied from: https://files.pythonhosted.org/packages/d6/b1/a49498c699a3fda5d635cc1fa222ffc686ea3b5d04b84a3166c4cab0c57b/oset-0.1.3.tar.gz
130130

131131
::
132132

133-
Copyright (c) 2009 Raymond Hettinger
134-
135-
Permission is hereby granted, free of charge, to any person
136-
obtaining a copy of this software and associated documentation files
137-
(the "Software"), to deal in the Software without restriction,
138-
including without limitation the rights to use, copy, modify, merge,
139-
publish, distribute, sublicense, and/or sell copies of the Software,
140-
and to permit persons to whom the Software is furnished to do so,
141-
subject to the following conditions:
142-
143-
The above copyright notice and this permission notice shall be
144-
included in all copies or substantial portions of the Software.
145-
146-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
147-
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
148-
OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
149-
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
150-
HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
151-
WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
152-
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
153-
OTHER DEALINGS IN THE SOFTWARE.
133+
Copyright (c) 2009, Raymond Hettinger, and others All rights reserved.
134+
135+
Package structured based on the one developed to odict Copyright (c) 2010, BlueDynamics Alliance, Austria
136+
137+
- Redistributions of source code must retain the above copyright notice, this
138+
list of conditions and the following disclaimer.
139+
140+
- Redistributions in binary form must reproduce the above copyright notice, this
141+
list of conditions and the following disclaimer in the documentation and/or
142+
other materials provided with the distribution.
143+
144+
- Neither the name of the BlueDynamics Alliance nor the names of its
145+
contributors may be used to endorse or promote products derived from this
146+
software without specific prior written permission.
147+
148+
THIS SOFTWARE IS PROVIDED BY BlueDynamics Alliance AS IS AND ANY EXPRESS OR
149+
IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
150+
MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT
151+
SHALL BlueDynamics Alliance BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
152+
SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
153+
PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
154+
BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
155+
CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
156+
IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY
157+
OF SUCH DAMAGE.
154158

155159
mni_icbm152_t1_tal_nlin_asym_09a
156160
--------------------------------

appveyor.yml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,8 @@ environment:
1212
- PYTHON: C:\Python35-x64
1313
- PYTHON: C:\Python36
1414
- PYTHON: C:\Python36-x64
15+
- PYTHON: C:\Python37
16+
- PYTHON: C:\Python37-x64
1517

1618
install:
1719
# Prepend newly installed Python to the PATH of this build (this cannot be
@@ -20,8 +22,7 @@ install:
2022
- SET PATH=%PYTHON%;%PYTHON%\Scripts;%PATH%
2123

2224
# Install the dependencies of the project.
23-
- pip install numpy scipy matplotlib nose h5py mock
24-
- pip install pydicom
25+
- pip install numpy scipy matplotlib nose h5py mock hypothesis pydicom
2526
- pip install .
2627
- SET NIBABEL_DATA_DIR=%CD%\nibabel-data
2728

bin/nib-diff

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
#!python
2+
# emacs: -*- mode: python-mode; py-indent-offset: 4; indent-tabs-mode: nil -*-
3+
# vi: set ft=python sts=4 ts=4 sw=4 et:
4+
### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ##
5+
#
6+
# See COPYING file distributed along with the NiBabel package for the
7+
# copyright and license terms.
8+
#
9+
### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ##
10+
"""
11+
Quick diff summary for a set of neuroimaging files
12+
"""
13+
14+
from nibabel.cmdline.diff import main
15+
16+
if __name__ == '__main__':
17+
main()

dev-requirements.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,3 +2,4 @@
22
-r requirements.txt
33
nose
44
mock
5+
hypothesis

doc/source/coordinate_systems.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -255,7 +255,7 @@ axes *starts* on the right, anterior, superior of the subject, rather than
255255
*ending* on the right, anterior, superior. In other words, they would use
256256
"RAS" to refer to a coordinate system we would call "LPI". To be safe, we'll
257257
call our interpretation of the RAS convention "RAS+", meaning that Right,
258-
Anterior, Posterior are all positive values on these axes.
258+
Anterior, Superior are all positive values on these axes.
259259

260260
Some people also use "right" to mean the right hand side when an observer
261261
looks at the front of the scanner, from the foot the scanner bed.

nibabel/casting.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -268,6 +268,9 @@ def type_info(np_type):
268268
# 80) but in calculations nexp in fact appears to be 11 as for float64
269269
ret.update(dict(width=width))
270270
return ret
271+
if vals == (105, 11, 16): # correctly detected double double
272+
ret.update(dict(nmant=nmant, nexp=nexp, width=width))
273+
return ret
271274
# Oh dear, we don't recognize the type information. Try some known types
272275
# and then give up. At this stage we're expecting exotic longdouble or
273276
# their complex equivalent.

nibabel/cifti2/parse_cifti2.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -517,28 +517,28 @@ def flush_chardata(self):
517517
# conversion to numpy array
518518
c = BytesIO(data.strip().encode('utf-8'))
519519
vertices = self.struct_state[-1]
520-
vertices.extend(np.genfromtxt(c, dtype=np.int))
520+
vertices.extend(np.loadtxt(c, dtype=np.int))
521521
c.close()
522522

523523
elif self.write_to == 'VoxelIndices':
524524
# conversion to numpy array
525525
c = BytesIO(data.strip().encode('utf-8'))
526526
parent = self.struct_state[-1]
527-
parent.voxel_indices_ijk.extend(np.genfromtxt(c, dtype=np.int).reshape(-1, 3))
527+
parent.voxel_indices_ijk.extend(np.loadtxt(c, dtype=np.int).reshape(-1, 3))
528528
c.close()
529529

530530
elif self.write_to == 'VertexIndices':
531531
# conversion to numpy array
532532
c = BytesIO(data.strip().encode('utf-8'))
533533
index = self.struct_state[-1]
534-
index.extend(np.genfromtxt(c, dtype=np.int))
534+
index.extend(np.loadtxt(c, dtype=np.int))
535535
c.close()
536536

537537
elif self.write_to == 'TransformMatrix':
538538
# conversion to numpy array
539539
c = BytesIO(data.strip().encode('utf-8'))
540540
transform = self.struct_state[-1]
541-
transform.matrix = np.genfromtxt(c, dtype=np.float)
541+
transform.matrix = np.loadtxt(c, dtype=np.float)
542542
c.close()
543543

544544
elif self.write_to == 'Label':

0 commit comments

Comments
 (0)