Skip to content

Commit 8534bb4

Browse files
committed
Merge pull request #1 from matthew-brett/update-plus-for-296
MRG: merged current master, refactor dicom import
2 parents 44f7430 + 14af19c commit 8534bb4

File tree

231 files changed

+11331
-6864
lines changed

Some content is hidden

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

231 files changed

+11331
-6864
lines changed

.gitignore

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,12 @@
1515
*.tmp
1616
.project
1717
.pydevproject
18+
*.py.orig
1819

19-
# Not sure what the next two are for
20+
# Not sure what the next one is for
2021
*.kpf
22+
23+
# Makefile target file markers
2124
*-stamp
2225

2326
# Compiled source #
@@ -58,6 +61,8 @@ dist/
5861
.shelf
5962
.tox/
6063
.coverage
64+
.ropeproject/
65+
htmlcov/
6166

6267
# Logs and databases #
6368
######################

.gitmodules

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,3 +4,12 @@
44
[submodule "nibabel-data/nitest-minc2"]
55
path = nibabel-data/nitest-minc2
66
url = git://github.com/matthew-brett/nitest-minc2.git
7+
[submodule "nipy-ecattest"]
8+
path = nibabel-data/nipy-ecattest
9+
url = https://github.com/freec84/nipy-ecattest
10+
[submodule "nibabel-data/nitest-freesurfer"]
11+
path = nibabel-data/nitest-freesurfer
12+
url = https://bitbucket.org/nipy/nitest-freesurfer.git
13+
[submodule "nibabel-data/parrec_oblique"]
14+
path = nibabel-data/parrec_oblique
15+
url = https://github.com/grlee77/parrec_oblique.git

.mailmap

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,3 +27,7 @@ Kevin S. Hahn <[email protected]> Kevin S. Hahn <[email protected]>
2727
Basile Pinsard <[email protected]> bpinsard <[email protected]>
2828
Basile Pinsard <[email protected]> bpinsard <[email protected]>
2929
30+
Ben Cipollini <[email protected]> Ben Cipollini <[email protected]>
31+
Chris Markiewicz <[email protected]> Christopher J. Markiewicz <[email protected]>
32+
Chris Markiewicz <[email protected]> Christopher J. Markiewicz <[email protected]>
33+
Chris Markiewicz <[email protected]> Chris Johnson <[email protected]>

.travis.yml

Lines changed: 86 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -3,16 +3,31 @@
33
# munges each line before executing it to print out the exit status. It's okay
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
6+
67
language: python
8+
9+
# Run jobs on container-based infrastructure, can be overridden per job
10+
sudo: false
11+
12+
cache:
13+
directories:
14+
- $HOME/.cache/pip
15+
addons:
16+
apt:
17+
packages:
18+
- libhdf5-serial-dev
19+
# For numpy --pre wheels
20+
- libatlas-base-dev
721
env:
822
global:
923
- DEPENDS="numpy scipy matplotlib h5py"
1024
- PYDICOM=1
25+
- INSTALL_TYPE="setup"
1126
python:
1227
- 2.6
13-
- 3.2
1428
- 3.3
1529
- 3.4
30+
- 3.5
1631
matrix:
1732
include:
1833
- python: 2.7
@@ -22,54 +37,105 @@ matrix:
2237
- python: 2.7
2338
env:
2439
- DEPENDS=numpy==1.5.1 PYDICOM=0
40+
# Absolute minimum dependencies plus oldest MPL
41+
- python: 2.7
42+
env:
43+
- DEPENDS=numpy==1.5.1 matplotlib==1.3.1 PYDICOM=0
2544
# Minimum pydicom dependency
2645
- python: 2.7
2746
env:
2847
- DEPENDS="numpy==1.5.1 pydicom==0.9.7"
48+
# pydicom 1.0 (currently unreleased)
49+
- python: 2.7
50+
env:
51+
- PYDICOM="v1.0"
52+
# test against pre-release builds
53+
- python: 2.7
54+
env:
55+
- EXTRA_PIP_FLAGS="--pre"
2956
# Documentation doctests
3057
- python: 2.7
3158
env:
3259
- DOC_DOC_TEST=1
60+
- python: 2.7
61+
env:
62+
- INSTALL_TYPE=sdist
63+
- python: 2.7
64+
env:
65+
- INSTALL_TYPE=wheel
66+
- python: 2.7
67+
env:
68+
- INSTALL_TYPE=requirements
69+
- python: 2.7
70+
env:
71+
- STYLE=1
72+
- python: 3.5
73+
env:
74+
- STYLE=1
3375
before_install:
76+
- source tools/travis_tools.sh
3477
- virtualenv --python=python venv
3578
- source venv/bin/activate
3679
- python --version # just to check
37-
- pip install nose # always
38-
- pip install --no-index -f http://travis-wheels.scikit-image.org $DEPENDS
80+
- pip install -U pip wheel # upgrade to latest pip find 3.5 wheels; wheel to avoid errors
81+
- retry pip install nose flake8 # always
82+
- wheelhouse_pip_install $EXTRA_PIP_FLAGS $DEPENDS
3983
# pydicom <= 0.9.8 doesn't install on python 3
4084
- if [ "${TRAVIS_PYTHON_VERSION:0:1}" == "2" ]; then
4185
if [ "$PYDICOM" == "1" ]; then
4286
pip install pydicom;
87+
elif [ "$PYDICOM" == "v1.0" ]; then
88+
pip install git+https://github.com/darcymason/pydicom.git@43f278444d5cb2e4648135d3edcd430c363c6975;
4389
fi
4490
fi
4591
- if [ "${COVERAGE}" == "1" ]; then
4692
pip install coverage;
4793
pip install coveralls;
4894
fi
49-
- if [[ $DEPENDS == *h5py* ]]; then
50-
sudo apt-get install libhdf5-serial-dev;
51-
fi
5295
# command to install dependencies
5396
install:
54-
- python setup.py install
97+
- |
98+
if [ "$INSTALL_TYPE" == "setup" ]; then
99+
python setup.py install
100+
elif [ "$INSTALL_TYPE" == "sdist" ]; then
101+
python setup_egg.py egg_info # check egg_info while we're here
102+
python setup_egg.py sdist
103+
wheelhouse_pip_install $EXTRA_PIP_FLAGS dist/*.tar.gz
104+
elif [ "$INSTALL_TYPE" == "wheel" ]; then
105+
pip install wheel
106+
python setup_egg.py bdist_wheel
107+
wheelhouse_pip_install $EXTRA_PIP_FLAGS dist/*.whl
108+
elif [ "$INSTALL_TYPE" == "requirements" ]; then
109+
wheelhouse_pip_install $EXTRA_PIP_FLAGS -r requirements.txt
110+
python setup.py install
111+
fi
55112
# Point to nibabel data directory
56113
- export NIBABEL_DATA_DIR="$PWD/nibabel-data"
57114
# command to run tests, e.g. python setup.py test
58115
script:
59-
# Change into an innocuous directory and find tests from installation
60-
- mkdir for_testing
61-
- cd for_testing
62-
- if [ "${COVERAGE}" == "1" ]; then
63-
cp ../.coveragerc .;
64-
COVER_ARGS="--with-coverage --cover-package nibabel";
65-
fi
66-
- if [ "$DOC_DOC_TEST" == "1" ]; then
67-
pip install sphinx;
68-
cd ../doc;
69-
make html;
70-
make doctest;
116+
- |
117+
if [ "${STYLE}" == "1" ]; then
118+
# Run styles only on core nibabel code.
119+
flake8 nibabel
71120
else
72-
nosetests --with-doctest $COVER_ARGS nibabel;
121+
# Change into an innocuous directory and find tests from installation
122+
mkdir for_testing
123+
cd for_testing
124+
if [ "${COVERAGE}" == "1" ]; then
125+
cp ../.coveragerc .;
126+
COVER_ARGS="--with-coverage --cover-package nibabel";
127+
fi
128+
if [ "$DOC_DOC_TEST" == "1" ]; then
129+
pip install sphinx numpydoc texext;
130+
cd ../doc;
131+
make html;
132+
make doctest;
133+
else
134+
nosetests --with-doctest $COVER_ARGS nibabel;
135+
fi
73136
fi
74137
after_success:
75138
- if [ "${COVERAGE}" == "1" ]; then coveralls; fi
139+
140+
notifications:
141+
webhooks: http://nipy.bic.berkeley.edu:54856/travis

COPYING

Lines changed: 61 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -128,27 +128,29 @@ In ``nibabel/externals/ordereddict.py``
128128

129129
Copied from: https://pypi.python.org/packages/source/o/ordereddict/ordereddict-1.1.tar.gz#md5=a0ed854ee442051b249bfad0f638bbec
130130

131-
Copyright (c) 2009 Raymond Hettinger
132-
133-
Permission is hereby granted, free of charge, to any person
134-
obtaining a copy of this software and associated documentation files
135-
(the "Software"), to deal in the Software without restriction,
136-
including without limitation the rights to use, copy, modify, merge,
137-
publish, distribute, sublicense, and/or sell copies of the Software,
138-
and to permit persons to whom the Software is furnished to do so,
139-
subject to the following conditions:
140-
141-
The above copyright notice and this permission notice shall be
142-
included in all copies or substantial portions of the Software.
143-
144-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
145-
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
146-
OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
147-
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
148-
HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
149-
WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
150-
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
151-
OTHER DEALINGS IN THE SOFTWARE.
131+
::
132+
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.
152154

153155
mni_icbm152_t1_tal_nlin_asym_09a
154156
--------------------------------
@@ -158,6 +160,8 @@ The file ``doc/source/someone.nii.gz`` is a subsampled version of the file
158160
archive ``mni_icbm152_t1_tal_nlin_asym_09a``. The original image has the
159161
following license (where 'softwware' refers to the image):
160162

163+
::
164+
161165
Copyright (C) 1993-2004 Louis Collins, McConnell Brain Imaging Centre,
162166
Montreal Neurological Institute, McGill University.
163167

@@ -204,3 +208,39 @@ The files::
204208

205209
are from https://github.com/yarikoptic/nitest-balls1, also released under the
206210
the PDDL version 1.0 available at http://opendatacommons.org/licenses/pddl/1.0/
211+
212+
nibabel/nibabel/tests/data/umass_anonymized.PAR
213+
214+
is courtesy of the University of Massachusetts Medical School, also released
215+
under the PDDL.
216+
217+
218+
Six
219+
--------------------
220+
221+
In ``nibabel/externals/six.py``
222+
223+
Copied from: https://pypi.python.org/packages/source/s/six/six-1.3.0.tar.gz#md5=ec47fe6070a8a64c802363d2c2b1e2ee
224+
225+
::
226+
227+
Copyright (c) 2010-2013 Benjamin Peterson
228+
229+
Permission is hereby granted, free of charge, to any person obtaining a copy of
230+
this software and associated documentation files (the "Software"), to deal in
231+
the Software without restriction, including without limitation the rights to
232+
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
233+
the Software, and to permit persons to whom the Software is furnished to do so,
234+
subject to the following conditions:
235+
236+
The above copyright notice and this permission notice shall be included in all
237+
copies or substantial portions of the Software.
238+
239+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
240+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
241+
FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
242+
COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
243+
IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
244+
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
245+
246+

Changelog

Lines changed: 50 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,10 +22,58 @@ NiBabel
2222
Most work on NiBabel so far has been by Matthew Brett (MB), Michael Hanke (MH)
2323
and Stephan Gerhard (SG).
2424

25-
* 2.0.1
25+
References like "pr/298" refer to github pull request numbers.
26+
27+
* Upcoming
2628

2729
* Read and write support for DICOM tags in NIfTI Extended Header using
28-
pydicom.
30+
pydicom (pr/296);
31+
* Trackvis reader will now allow final streamline to have fewer points that
32+
tne numbe declared in the header, with ``strict=False`` argument to
33+
``read`` function;
34+
* Minor API breakage in trackvis reader. We are now raising a DataError if
35+
there are too few streamlines in the file, instead of a HeaderError. We
36+
are raising a DataError if the track is truncated when ``strict=True``
37+
(the default), rather than a TypeError when trying to create the points
38+
array.
39+
40+
* 2.0.2 (Monday 23 November 2015)
41+
42+
* Fix for integer overflow on large images (pr/325) (MB);
43+
* Fix for Freesurfer nifti files with unusual dimensions (pr/332) (Chris
44+
Markiewicz);
45+
* Fix typos on benchmarks and tests (pr/336, pr/340, pr/347) (Chris
46+
Markiewicz);
47+
* Fix Windows install script (pr/339) (MB);
48+
* Support for Python 3.5 (pr/363) (MB) and numpy 1.10 (pr/358) (Chris
49+
Markiewicz);
50+
* Update pydicom imports to permit version 1.0 (pr/379) (Chris Markiewicz);
51+
* Workaround for Python 3.5.0 gzip regression (pr/383) (Ben Cipollini).
52+
* tripwire.TripWire object now raises subclass of AttributeError when trying
53+
to get an attribute, rather than a direct subclass of Exception. This
54+
prevents Python 3.5 triggering the tripwire when doing inspection prior to
55+
running doctests.
56+
* Minor API change for tripwire.TripWire object; code that checked for
57+
AttributeError will now also catch TripWireError.
58+
59+
* 2.0.1 (Saturday 27 June 2015)
60+
61+
Contributions from Ben Cipollini, Chris Markiewicz, Alexandre Gramfort,
62+
Clemens Bauer, github user freec84.
63+
64+
* Bugfix release with minor new features;
65+
* Added ``axis`` parameter to ``concat_images`` (pr/298) (Ben Cipollini);
66+
* Fix for unsigned integer data types in ECAT images (pr/302) (MB, test data
67+
and issue report from Github user freec84);
68+
* Added new ECAT and Freesurfer data files to automated testing;
69+
* Fix for Freesurfer labels error on early numpies (pr/307) (Alexandre
70+
Gramfort);
71+
* Fixes for PAR / REC header parsing (pr/312) (MB, issue reporting and test
72+
data by Clemens C. C. Bauer);
73+
* Workaround for reading Freesurfer ico7 surface files (pr/315) (Chris
74+
Markiewicz);
75+
* Changed to github pages for doc hosting;
76+
* Changed docs to point to [email protected] mailing list.
2977

3078
* 2.0.0 (Tuesday 9 December 2014)
3179

MANIFEST.in

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
include AUTHOR COPYING Makefile* MANIFEST.in setup* README.*
2-
include Changelog TODO
2+
include Changelog TODO requirements.txt
33
recursive-include doc *
44
recursive-include bin *
55
recursive-include tools *

0 commit comments

Comments
 (0)