Skip to content

Commit 8a17f08

Browse files
authored
Merge branch 'master' into orthoview_vlim
2 parents 7d2b9b3 + f5dec18 commit 8a17f08

File tree

114 files changed

+6223
-1385
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

114 files changed

+6223
-1385
lines changed

.gitmodules

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,3 +13,6 @@
1313
[submodule "nibabel-data/parrec_oblique"]
1414
path = nibabel-data/parrec_oblique
1515
url = https://github.com/grlee77/parrec_oblique.git
16+
[submodule "nibabel-data/nitest-cifti2"]
17+
path = nibabel-data/nitest-cifti2
18+
url = https://github.com/demianw/nibabel-nitest-cifti2.git

.mailmap

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ Cindee Madison <cindee@berkeley.edu> CindeeM <cindee@berkeley.edu>
1717
Cindee Madison <cindee@berkeley.edu> cindeem <cindee@berkeley.edu>
1818
Ian Nimmo-Smith <iannimmosmith@gmail.com> Ian Nimmo-Smith <ian.nimmo-smith@mrc-cbu.cam.ac.uk>
1919
Jean-Baptiste Poline <jbpoline@gmail.com> jbpoline <jbpoline@gmail.com>
20-
Félix C. Morency <felix.morency@gmail.com> Felix C. Morency <felix.c.morency@usherbrooke.ca> Félix C. Morency <felix.c.morency@usherbrooke.ca>
20+
Félix C. Morency <felix.morency@gmail.com> Felix C. Morency <felix.c.morency@usherbrooke.ca>
2121
Félix C. Morency <felix.morency@gmail.com> Félix C. Morency <felix.c.morency@usherbrooke.ca>
2222
Krish Subramaniam <krish.subramaniam@gmail.com> Krish Subramaniam <krish@monster.nmr.mgh.harvard.edu>
2323
Eric Larson <larson.eric.d@gmail.com> Eric89GXL <larson.eric.d@gmail.com>
@@ -28,10 +28,15 @@ Basile Pinsard <basile.pinsard@gmail.com> bpinsard <basile.pinsard@gmail.com>
2828
Basile Pinsard <basile.pinsard@gmail.com> bpinsard <bpinsard@imed.jussieu.fr>
2929
Nguyen, Ly <nguyen60@seattleu.edu> lxn2 <lxn2@uw.edu>
3030
Ben Cipollini <ben.cipollini@gmail.com> Ben Cipollini <bcipolli@ucsd.edu>
31+
Chris Markiewicz <effigies@gmail.com> Christopher J. Markiewicz <markiewicz@stanford.edu>
3132
Chris Markiewicz <effigies@gmail.com> Christopher J. Markiewicz <effigies@bu.edu>
3233
Chris Markiewicz <effigies@gmail.com> Christopher J. Markiewicz <effigies@gmail.com>
3334
Chris Markiewicz <effigies@gmail.com> Chris Johnson <effigies@bu.edu>
3435
Jaakko Leppäkangas <jaeilepp@student.jyu.fi> jaeilepp <jaeilepp@student.jyu.fi>
3536
Ariel Rokem <arokem@gmail.com> arokem <arokem@gmail.com>
3637
Oliver P. Hinds <ohinds@gmail.com> ohinds <ohinds@gmail.com>
3738
Marc-Alexandre Côté <marc.cote.19@gmail.com> Marc-Alexandre Cote <marc.cote.19@gmail.com>
39+
Satrajit Ghosh <satra@mit.edu> Satrajit Ghosh <satrajit.ghosh@gmail.com>
40+
Jasper J.F. van den Bosch <japsai@gmail.com> Jasper <japsai@gmail.com>
41+
Gregory R. Lee <grlee77@gmail.com> Gregory R. Lee <gregory.lee@cchmc.org>
42+
Demian Wassermann <demian@bwh.harvard.edu> Demian Wassermann <demian.wassermann@inria.fr>

.travis.yml

Lines changed: 23 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -12,21 +12,19 @@ sudo: false
1212
cache:
1313
directories:
1414
- $HOME/.cache/pip
15-
addons:
16-
apt:
17-
packages:
18-
- libhdf5-serial-dev
19-
# For numpy --pre wheels
20-
- libatlas-base-dev
2115
env:
2216
global:
23-
- DEPENDS="numpy scipy matplotlib h5py pillow"
17+
- DEPENDS="six numpy scipy matplotlib h5py pillow"
2418
- PYDICOM=1
2519
- INSTALL_TYPE="setup"
20+
- EXTRA_WHEELS="https://5cf40426d9f06eb7461d-6fe47d9331aba7cd62fc36c7196769e4.ssl.cf2.rackcdn.com"
21+
- PRE_WHEELS="https://7933911d6844c6c53a7d-47bd50c35cd79bd838daf386af554a83.ssl.cf2.rackcdn.com"
22+
- EXTRA_PIP_FLAGS="--find-links=$EXTRA_WHEELS"
23+
- PRE_PIP_FLAGS="--pre $EXTRA_PIP_FLAGS --find-links $PRE_WHEELS"
2624
python:
27-
- 3.3
2825
- 3.4
2926
- 3.5
27+
- 3.6
3028
matrix:
3129
include:
3230
- python: 2.7
@@ -35,19 +33,19 @@ matrix:
3533
# Absolute minimum dependencies
3634
- python: 2.7
3735
env:
38-
- DEPENDS=numpy==1.5.1 PYDICOM=0
36+
- DEPENDS="numpy==1.7.1" PYDICOM=0
3937
# Absolute minimum dependencies plus oldest MPL
4038
# Check these against:
39+
# nibabel/info.py
4140
# doc/source/installation.rst
4241
# requirements.txt
43-
# .travis.yml
4442
- python: 2.7
4543
env:
46-
- DEPENDS="numpy==1.5.1 matplotlib==1.3.1" PYDICOM=0
44+
- DEPENDS="numpy==1.7.1 matplotlib==1.3.1" PYDICOM=0
4745
# Minimum pydicom dependency
4846
- python: 2.7
4947
env:
50-
- DEPENDS="numpy==1.5.1 pydicom==0.9.7 pillow==2.6"
48+
- DEPENDS="numpy==1.7.1 pydicom==0.9.7 pillow==2.6"
5149
# test against numpy 1.7
5250
- python: 2.7
5351
env:
@@ -56,10 +54,14 @@ matrix:
5654
- python: 2.7
5755
env:
5856
- PYDICOM="v1.0"
59-
# test against pre-release builds
57+
# test 2.7 against pre-release builds of everything
6058
- python: 2.7
6159
env:
62-
- EXTRA_PIP_FLAGS="--pre"
60+
- EXTRA_PIP_FLAGS="$PRE_PIP_FLAGS"
61+
# test 3.5 against pre-release builds of everything
62+
- python: 3.5
63+
env:
64+
- EXTRA_PIP_FLAGS="$PRE_PIP_FLAGS"
6365
# Documentation doctests
6466
- python: 2.7
6567
env:
@@ -84,12 +86,14 @@ matrix:
8486
- DOC_DOC_TEST=1
8587
before_install:
8688
- source tools/travis_tools.sh
89+
- python -m pip install --upgrade pip
90+
- pip install --upgrade virtualenv
8791
- virtualenv --python=python venv
8892
- source venv/bin/activate
8993
- python --version # just to check
90-
- pip install -U pip wheel # upgrade to latest pip find 3.5 wheels; wheel to avoid errors
94+
- pip install -U pip wheel # needed at one point
9195
- retry pip install nose flake8 mock # always
92-
- wheelhouse_pip_install $EXTRA_PIP_FLAGS $DEPENDS
96+
- pip install $EXTRA_PIP_FLAGS $DEPENDS
9397
# pydicom <= 0.9.8 doesn't install on python 3
9498
- if [ "${TRAVIS_PYTHON_VERSION:0:1}" == "2" ]; then
9599
if [ "$PYDICOM" == "1" ]; then
@@ -111,13 +115,13 @@ install:
111115
elif [ "$INSTALL_TYPE" == "sdist" ]; then
112116
python setup_egg.py egg_info # check egg_info while we're here
113117
python setup_egg.py sdist
114-
wheelhouse_pip_install $EXTRA_PIP_FLAGS dist/*.tar.gz
118+
pip install $EXTRA_PIP_FLAGS dist/*.tar.gz
115119
elif [ "$INSTALL_TYPE" == "wheel" ]; then
116120
pip install wheel
117121
python setup_egg.py bdist_wheel
118-
wheelhouse_pip_install $EXTRA_PIP_FLAGS dist/*.whl
122+
pip install $EXTRA_PIP_FLAGS dist/*.whl
119123
elif [ "$INSTALL_TYPE" == "requirements" ]; then
120-
wheelhouse_pip_install $EXTRA_PIP_FLAGS -r requirements.txt
124+
pip install $EXTRA_PIP_FLAGS -r requirements.txt
121125
python setup.py install
122126
fi
123127
# Point to nibabel data directory

Changelog

Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,58 @@ Gerhard (SG) and Eric Larson (EL).
2424

2525
References like "pr/298" refer to github pull request numbers.
2626

27+
Upcoming Release
28+
================
29+
30+
New features
31+
------------
32+
33+
* CIFTI support (pr/249) (Satra Ghosh, Michiel Cottaar, BC, CM, Demian
34+
Wassermann, MB)
35+
* Support for MRtrix TCK streamlines file format (pr/486) (MC, reviewed by
36+
MB, Arnaud Bore, J-Donald Tournier, Jean-Christophe Houde)
37+
38+
Enhancements
39+
------------
40+
41+
* Support for alternative header field name variants in .PAR files
42+
(pr/507) (Gregory R. Lee)
43+
* Various enhancements to streamlines API by MC: support for reading TRK
44+
version 1 (pr/512); concatenation of tractograms using `+`/`+=` operators
45+
(pr/495); function to concatenate multiple ArraySequence objects (pr/494)
46+
* Support for numpy 1.12 (pr/500, pr/502) (MC, MB)
47+
* Allow dtype specifiers as fileslice input (pr/485) (MB)
48+
* Support "headerless" ArrayProxy specification, enabling memory-efficient
49+
ArrayProxy reshaping (pr/521) (CM)
50+
* Allow unknown NIfTI intent codes, add FSL codes (pr/528) (Paul McCarthy)
51+
* Improve error handling for ``img.__getitem__`` (pr/533) (Ariel Rokem)
52+
* Delegate reorientation to SpatialImage classes (pr/544) (Mark Hymers, CM,
53+
reviewed by MB)
54+
55+
Bug fixes
56+
---------
57+
58+
* Miscellaneous MINC reader fixes (pr/493) (Robert D. Vincent, reviewed by CM,
59+
MB)
60+
* Fix corner case in ``wrapstruct.get`` (pr/516) (Paul McCarthy, reviewed by
61+
CM, MB)
62+
63+
Maintenance
64+
-----------
65+
66+
* Documentation update (pr/514) (Ivan Gonzalez)
67+
* Update testing to use pre-release builds of dependencies (pr/509) (MB)
68+
* Better warnings when nibabel not on path (pr/503) (MB)
69+
70+
API changes and deprecations
71+
----------------------------
72+
73+
* ``header`` argument to ``ArrayProxy.__init__`` is renamed to ``spec``
74+
* Deprecation of ``header`` property of ``ArrayProxy`` object, for removal in
75+
3.0
76+
* ``wrapstruct.get`` now returns entries evaluating ``False``, instead of ``None``
77+
78+
2779
2.1 (Monday 22 August 2016)
2880
===========================
2981

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -288,4 +288,4 @@ rm-orig:
288288
# Remove .orig temporary diff files generated by git
289289
find . -name "*.orig" -print | grep -v "fsaverage" | xargs rm
290290

291-
.PHONY: orig-src pylint
291+
.PHONY: orig-src pylint all build

bin/nib-ls

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,11 +19,9 @@ import numpy as np
1919
import nibabel as nib
2020

2121
from math import ceil
22-
from collections import defaultdict
2322
from optparse import OptionParser, Option
2423
from io import StringIO
2524
from nibabel.py3k import asunicode
26-
from nibabel.externals.six.moves import xrange
2725

2826
__author__ = 'Yaroslav Halchenko'
2927
__copyright__ = 'Copyright (c) 2011-2016 Yaroslav Halchenko ' \

doc/Makefile

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,10 @@
11
# Makefile for Sphinx documentation
22
#
33

4+
# The Python executable to be used
5+
#
6+
PYTHON ?= python
7+
48
# You can set these variables from the command line.
59
SPHINXOPTS =
610
SPHINXBUILD = sphinx-build
@@ -98,4 +102,3 @@ gitwash-update:
98102
python ../tools/gitwash_dumper.py source nibabel --github-user=nipy \
99103
--project-url=http://nipy.org/nibabel \
100104
--project-ml-url=https://mail.python.org/mailman/listinfo/neuroimaging
101-

doc/source/conf.py

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,6 @@
2222
import sys
2323
import os
2424

25-
import nibabel
26-
2725
# Check for external Sphinx extensions we depend on
2826
try:
2927
import numpydoc
@@ -34,6 +32,13 @@
3432
except ImportError:
3533
raise RuntimeError('Need to install "texext" package for doc build')
3634

35+
# Need nibabel installed as well
36+
try:
37+
import nibabel
38+
except ImportError:
39+
raise RuntimeError('Need nibabel on Python PATH; consider "make htmldoc" '
40+
'from nibabel root directory')
41+
3742
# If extensions (or modules to document with autodoc) are in another directory,
3843
# add these directories to sys.path here. If the directory is relative to the
3944
# documentation root, use os.path.abspath to make it absolute, like shown here.
@@ -82,7 +87,7 @@
8287

8388
# General information about the project.
8489
project = u'NiBabel'
85-
copyright = u'2006-2016, %(MAINTAINER)s <%(AUTHOR_EMAIL)s>' % rel
90+
copyright = u'2006-2017, %(MAINTAINER)s <%(AUTHOR_EMAIL)s>' % rel
8691

8792
# The version info for the project you're documenting, acts as replacement for
8893
# |version| and |release|, also used in various other places throughout the

doc/source/coordinate_systems.rst

Lines changed: 28 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -97,11 +97,11 @@ middle voxel in the EPI data array like this:
9797
:nofigs:
9898

9999
>>> n_i, n_j, n_k = epi_img_data.shape
100-
>>> center_i = (n_i - 1) / 2.
101-
>>> center_j = (n_j - 1) / 2.
102-
>>> center_k = (n_k - 1) / 2.
100+
>>> center_i = (n_i - 1) // 2 # // for integer division
101+
>>> center_j = (n_j - 1) // 2
102+
>>> center_k = (n_k - 1) // 2
103103
>>> center_i, center_j, center_k
104-
(26.0, 30.0, 16.0)
104+
(26, 30, 16)
105105
>>> center_vox_value = epi_img_data[center_i, center_j, center_k]
106106
>>> center_vox_value
107107
81.549287796020508
@@ -216,7 +216,7 @@ From scanner to subject
216216
If the subject is lying in the usual position for a brain scan, face up
217217
and head first in the scanner, then scanner-left/right is also the left-right
218218
axis of the subject's head, scanner-floor/ceiling is the anterior-posterior
219-
axis of the head and scanner-bore is the inferior-posterior axis of the head.
219+
axis of the head and scanner-bore is the inferior-superior axis of the head.
220220

221221
Sometimes the subject is not lying in the standard position. For example, the
222222
subject may be lying with their face pointing to the right (in terms of the
@@ -239,7 +239,7 @@ scanner-floor/ceiling, but reversed so that positive values are towards the
239239
floor. This axis goes from left to right in the subject, with positive values
240240
to the right. The second (Y) axis would be scanner-left/right
241241
(anterior-posterior in the subject), and the Z axis would be scanner-bore
242-
(inferior-posterior).
242+
(inferior-superior).
243243

244244
Naming reference spaces
245245
=======================
@@ -386,8 +386,8 @@ A rotation of $\gamma$ radians around the first array axis:
386386
\end{bmatrix} =
387387
\begin{bmatrix}
388388
1 & 0 & 0 \\
389-
0 & \cos(\gamma) & 0 & -\sin(\gamma) \\
390-
0 & \sin(\gamma) & 0 & \cos(\gamma) \\
389+
0 & \cos(\gamma) & -\sin(\gamma) \\
390+
0 & \sin(\gamma) & \cos(\gamma) \\
391391
\end{bmatrix}
392392
\begin{bmatrix}
393393
i\\
@@ -515,16 +515,16 @@ We could record the parameters necessary for $f$ as the 3 by 3 matrix, $M$
515515
and the 3 by 1 vector $(a, b, c)$.
516516

517517
In fact, the 4 by 4 image *affine array* does include exactly this
518-
information. If $m_{ij}$ is the value in row $i$ column $j$ of matrix $M$,
518+
information. If $m_{i,j}$ is the value in row $i$ column $j$ of matrix $M$,
519519
then the image affine matrix $A$ is:
520520

521521
.. math::
522522
523523
A =
524524
\begin{bmatrix}
525-
m_{11} & m_{12} & m_{13} & a \\
526-
m_{21} & m_{22} & m_{23} & b \\
527-
m_{31} & m_{32} & m_{33} & c \\
525+
m_{1,1} & m_{1,2} & m_{1,3} & a \\
526+
m_{2,1} & m_{2,2} & m_{2,3} & b \\
527+
m_{3,1} & m_{3,2} & m_{3,3} & c \\
528528
0 & 0 & 0 & 1 \\
529529
\end{bmatrix}
530530
@@ -546,9 +546,9 @@ vectors:
546546
1\\
547547
\end{bmatrix} =
548548
\begin{bmatrix}
549-
m_{11} & m_{12} & m_{13} & a \\
550-
m_{21} & m_{22} & m_{23} & b \\
551-
m_{31} & m_{32} & m_{33} & c \\
549+
m_{1,1} & m_{1,2} & m_{1,3} & a \\
550+
m_{2,1} & m_{2,2} & m_{2,3} & b \\
551+
m_{3,1} & m_{3,2} & m_{3,3} & c \\
552552
0 & 0 & 0 & 1 \\
553553
\end{bmatrix}
554554
\begin{bmatrix}
@@ -614,6 +614,19 @@ matrix. Put another way:
614614
1\\
615615
\end{bmatrix}
616616
617+
A^{-1}\begin{bmatrix}
618+
x\\
619+
y\\
620+
z\\
621+
1\\
622+
\end{bmatrix} = A^{-1} A
623+
\begin{bmatrix}
624+
i\\
625+
j\\
626+
k\\
627+
1\\
628+
\end{bmatrix}
629+
617630
\begin{bmatrix}
618631
i\\
619632
j\\

doc/source/dicom/dicom_orientation.rst

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -58,12 +58,12 @@ Section 10.7.1.3: Pixel Spacing
5858
DICOM voxel to patient coordinate system mapping
5959
================================================
6060

61-
See:
61+
See:
6262

63-
* http://www.dclunie.com/medical-image-faq/html/part2.html
64-
* http://fixunix.com/dicom/50449-image-position-patient-image-orientation-patient.html
63+
* http://www.dclunie.com/medical-image-faq/html/part2.html;
64+
* `this dicom mailing list post <https://groups.google.com/forum/#!topic/comp.protocols.dicom/-Nms_GgmdRc>`_;
6565

66-
See `wikipedia direction cosine`_ for a definition of direction cosines.
66+
See `wikipedia direction cosine`_ for a definition of direction cosines.
6767

6868
From section C.7.6.2.1.1 of the `DICOM object definitions`_ (2009):
6969

doc/source/index.rst

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,14 @@ contributed code and discussion (in rough order of appearance):
7070
* `Ariel Rokem`_
7171
* Eleftherios Garyfallidis
7272
* Jaakko Leppäkangas
73+
* Syam Gadde
74+
* Robert D. Vincent
75+
* Ivan Gonzalez
76+
* Demian Wassermann
77+
* Paul McCarthy
78+
* Fernando Pérez García
79+
* Venky Reddy
80+
* Mark Hymers
7381

7482
License reprise
7583
===============

0 commit comments

Comments
 (0)