Skip to content

Commit 7fe9d3c

Browse files
committed
Merge branch 'master' into enh/DivisionWarningsTSNR
2 parents 06b6ce7 + c1e811e commit 7fe9d3c

File tree

1,043 files changed

+24869
-17555
lines changed

Some content is hidden

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

1,043 files changed

+24869
-17555
lines changed

.gitignore

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
/nipype/build
66
/nipype/nipype.egg-info
77
/doc/_build
8+
/doc/preproc
89
/doc/users/examples
910
/doc/api/generated
1011
*.pyc
@@ -17,3 +18,6 @@
1718
.DS_Store
1819
nipype/testing/data/von-ray_errmap.nii.gz
1920
nipype/testing/data/von_errmap.nii.gz
21+
crash*.pklz
22+
.coverage
23+
htmlcov/

.travis.yml

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -3,16 +3,17 @@ cache:
33
language: python
44
python:
55
- 2.7
6+
- 3.4
67
env:
78
- INSTALL_DEB_DEPENDECIES=true
89
- INSTALL_DEB_DEPENDECIES=false
910
before_install:
10-
- if [ ${TRAVIS_PYTHON_VERSION:0:1} == "2" ]; then wget http://repo.continuum.io/miniconda/Miniconda-latest-Linux-x86_64.sh
11-
-O miniconda.sh; else wget http://repo.continuum.io/miniconda/Miniconda3-3.6.0-Linux-x86_64.sh
11+
- if [ ${TRAVIS_PYTHON_VERSION:0:1} == "2" ]; then wget http://repo.continuum.io/miniconda/Miniconda2-latest-Linux-x86_64.sh
12+
-O miniconda.sh; else wget http://repo.continuum.io/miniconda/Miniconda3-latest-Linux-x86_64.sh
1213
-O miniconda.sh; fi
1314
- chmod +x miniconda.sh
1415
- "./miniconda.sh -b"
15-
- export PATH=/home/travis/miniconda/bin:$PATH
16+
- if [ ${TRAVIS_PYTHON_VERSION:0:1} == "2" ]; then export PATH=/home/travis/miniconda2/bin:$PATH; else export PATH=/home/travis/miniconda3/bin:$PATH; fi
1617
- if $INSTALL_DEB_DEPENDECIES; then sudo rm -rf /dev/shm; fi
1718
- if $INSTALL_DEB_DEPENDECIES; then sudo ln -s /run/shm /dev/shm; fi
1819
- if $INSTALL_DEB_DEPENDECIES; then bash <(wget -q -O- http://neuro.debian.net/_files/neurodebian-travis.sh);
@@ -22,20 +23,20 @@ before_install:
2223
- if $INSTALL_DEB_DEPENDECIES; then travis_retry sudo apt-get install -qq fsl-atlases;
2324
fi
2425
- if $INSTALL_DEB_DEPENDECIES; then source /etc/fsl/fsl.sh; fi
26+
- if $INSTALL_DEB_DEPENDECIES; then source /etc/afni/afni.sh; fi
2527
install:
2628
- conda update --yes conda
2729
- conda create -n testenv --yes pip python=$TRAVIS_PYTHON_VERSION
2830
- source activate testenv
2931
- if [ ${TRAVIS_PYTHON_VERSION:0:1} == "2" ]; then pip install ordereddict; fi
30-
- conda install --yes numpy scipy nose traits networkx dateutil
31-
- pip install nibabel
32+
- conda install --yes numpy scipy nose networkx dateutil
33+
- if [ ${TRAVIS_PYTHON_VERSION:0:1} == "2" ]; then conda install --yes traits; else pip install traits; fi
3234
- pip install python-coveralls
3335
- pip install nose-cov
34-
- pip install https://github.com/RDFLib/rdflib/archive/master.zip
35-
- pip install https://github.com/trungdong/prov/archive/rdf.zip
36+
- pip install -r requirements.txt # finish remaining requirements
3637
- python setup.py install
3738
script:
38-
- nosetests --with-doctest --with-cov --cov nipype --cov-config .coveragerc --logging-level=INFO
39+
- python -W once:FSL:UserWarning:nipype `which nosetests` --with-doctest --with-cov --cover-package nipype --cov-config .coveragerc --logging-level=INFO
3940
after_success:
4041
- coveralls --config_file .coveragerc
4142
deploy:

CHANGES

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,18 @@
1-
Next Release
1+
Next release
22
============
3+
4+
* TST: Cache APT in CircleCI (https://github.com/nipy/nipype/pull/1333)
5+
* ENH: Add new flags to the BRAINSABC for new features (https://github.com/nipy/nipype/pull/1322)
6+
* ENH: Provides a Nipype wrapper for ANTs DenoiseImage (https://github.com/nipy/nipype/pull/1291)
7+
* FIX: Minor bugfix logging hash differences (https://github.com/nipy/nipype/pull/1298)
8+
* FIX: Use released Prov python library (https://github.com/nipy/nipype/pull/1279)
9+
* ENH: Support for Python 3 (https://github.com/nipy/nipype/pull/1221)
10+
* FIX: VTK version check missing when using tvtk (https://github.com/nipy/nipype/pull/1219)
11+
* ENH: Added an OAR scheduler plugin (https://github.com/nipy/nipype/pull/1259)
12+
* ENH: New ANTs interface: antsBrainExtraction (https://github.com/nipy/nipype/pull/1231)
13+
* API: Default model level for the bedpostx workflow has been set to "2" following FSL 5.0.9 lead
314
* ENH: New interfaces for interacting with AWS S3: S3DataSink and S3DataGrabber (https://github.com/nipy/nipype/pull/1201)
15+
* ENH: Interfaces for MINC tools (https://github.com/nipy/nipype/pull/1304)
416

517
Release 0.11.0 (September 15, 2015)
618
============

THANKS.rst

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,11 @@ Contributors to Nipype include but are not limited to:
1010
* Aimi Watanabe
1111
* Alexander Schaefer
1212
* Alexandre Gramfort
13+
* Alexandre Savio
1314
* Anisha Keshavan
1415
* Ariel Rokem
1516
* Ben Acland
17+
* Ben Cipollini
1618
* Basile Pinsard
1719
* Brendan Moloney
1820
* Brian Cheung

bin/nipype2boutiques

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#!/usr/bin/env python
1+
#!python
22
# emacs: -*- mode: python; py-indent-offset: 4; indent-tabs-mode: nil -*-
33
# vi: set ft=python sts=4 ts=4 sw=4 et:
44
import sys

bin/nipype_cmd

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#!/usr/bin/env python
1+
#!python
22
# emacs: -*- mode: python; py-indent-offset: 4; indent-tabs-mode: nil -*-
33
# vi: set ft=python sts=4 ts=4 sw=4 et:
44
import sys

bin/nipype_display_crash

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#!/usr/bin/env python
1+
#!python
22
"""Displays crash information from Nipype crash files. For certain crash files,
33
one can rerun a failed node in a temp directory.
44

build_docs.py

Lines changed: 21 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@
88
python setup.py build_sphinx
99
"""
1010

11+
from __future__ import print_function
12+
1113
# Standard library imports
1214
import sys
1315
import os
@@ -27,23 +29,25 @@
2729

2830
################################################################################
2931
# Distutils Command class for installing nipype to a temporary location.
32+
33+
3034
class TempInstall(Command):
3135
temp_install_dir = os.path.join('build', 'install')
3236

3337
def run(self):
3438
""" build and install nipype in a temporary location. """
3539
install = self.distribution.get_command_obj('install')
3640
install.install_scripts = self.temp_install_dir
37-
install.install_base = self.temp_install_dir
41+
install.install_base = self.temp_install_dir
3842
install.install_platlib = self.temp_install_dir
3943
install.install_purelib = self.temp_install_dir
40-
install.install_data = self.temp_install_dir
41-
install.install_lib = self.temp_install_dir
44+
install.install_data = self.temp_install_dir
45+
install.install_lib = self.temp_install_dir
4246
install.install_headers = self.temp_install_dir
4347
install.run()
4448

4549
# Horrible trick to reload nipype with our temporary instal
46-
for key in sys.modules.keys():
50+
for key in list(sys.modules.keys()):
4751
if key.startswith('nipype'):
4852
sys.modules.pop(key, None)
4953
sys.path.append(os.path.abspath(self.temp_install_dir))
@@ -62,12 +66,11 @@ def finalize_options(self):
6266
# Distutils Command class for API generation
6367
class APIDocs(TempInstall):
6468
description = \
65-
"""generate API docs """
69+
"""generate API docs """
6670

6771
user_options = [
6872
('None', None, 'this command has no options'),
69-
]
70-
73+
]
7174

7275
def run(self):
7376
# First build the project and install it to a temporary location.
@@ -131,30 +134,29 @@ def run(self):
131134

132135
def zip_docs(self):
133136
if not os.path.exists(DOC_BUILD_DIR):
134-
raise OSError, 'Doc directory does not exist.'
137+
raise OSError('Doc directory does not exist.')
135138
target_file = os.path.join('doc', 'documentation.zip')
136139
# ZIP_DEFLATED actually compresses the archive. However, there
137140
# will be a RuntimeError if zlib is not installed, so we check
138141
# for it. ZIP_STORED produces an uncompressed zip, but does not
139142
# require zlib.
140143
try:
141144
zf = zipfile.ZipFile(target_file, 'w',
142-
compression=zipfile.ZIP_DEFLATED)
145+
compression=zipfile.ZIP_DEFLATED)
143146
except RuntimeError:
144147
warnings.warn('zlib not installed, storing the docs '
145-
'without compression')
148+
'without compression')
146149
zf = zipfile.ZipFile(target_file, 'w',
147-
compression=zipfile.ZIP_STORED)
150+
compression=zipfile.ZIP_STORED)
148151

149152
for root, dirs, files in os.walk(DOC_BUILD_DIR):
150153
relative = relative_path(root)
151154
if not relative.startswith('.doctrees'):
152155
for f in files:
153156
zf.write(os.path.join(root, f),
154-
os.path.join(relative, 'html_docs', f))
157+
os.path.join(relative, 'html_docs', f))
155158
zf.close()
156159

157-
158160
def finalize_options(self):
159161
""" Override the default for the documentation build
160162
directory.
@@ -164,23 +166,25 @@ def finalize_options(self):
164166

165167
################################################################################
166168
# Distutils Command class to clean
169+
170+
167171
class Clean(clean):
168172

169173
def run(self):
170174
clean.run(self)
171175
api_path = os.path.join('doc', 'api', 'generated')
172176
if os.path.exists(api_path):
173-
print "Removing %s" % api_path
177+
print("Removing %s" % api_path)
174178
shutil.rmtree(api_path)
175179
interface_path = os.path.join('doc', 'interfaces', 'generated')
176180
if os.path.exists(interface_path):
177-
print "Removing %s" % interface_path
181+
print("Removing %s" % interface_path)
178182
shutil.rmtree(interface_path)
179183
if os.path.exists(DOC_BUILD_DIR):
180-
print "Removing %s" % DOC_BUILD_DIR
184+
print("Removing %s" % DOC_BUILD_DIR)
181185
shutil.rmtree(DOC_BUILD_DIR)
182186
if os.path.exists(DOC_DOCTREES_DIR):
183-
print "Removing %s" % DOC_DOCTREES_DIR
187+
print("Removing %s" % DOC_DOCTREES_DIR)
184188
shutil.rmtree(DOC_DOCTREES_DIR)
185189

186190

@@ -189,5 +193,3 @@ def run(self):
189193
'api_docs': APIDocs,
190194
'clean': Clean,
191195
}
192-
193-

circle.yml

Lines changed: 25 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,52 +1,62 @@
11
dependencies:
22
cache_directories:
3+
- "~/.apt-cache"
34
- "~/examples/data"
45
- "~/examples/fsdata"
5-
- "~/examples/feeds"
66
- "~/mcr"
77
- "~/spm12"
88
- "~/examples/fsl_course_data"
9+
pre:
10+
# Let CircleCI cache the apt archive
11+
- sudo rm -rf /var/cache/apt/archives && sudo ln -s ~/.apt-cache /var/cache/apt/archives && mkdir -p ~/.apt-cache/partial
12+
- wget -O- http://neuro.debian.net/lists/precise.us-ca.full | sudo tee /etc/apt/sources.list.d/neurodebian.sources.list
13+
- sudo apt-key adv --recv-keys --keyserver hkp://pgp.mit.edu:80 0xA5D32F012649A5A9
14+
- sudo apt-get update
915
override:
16+
# Install apt packages
17+
- sudo apt-get install -y fsl-core fsl-atlases fsl-mni152-templates fsl-feeds afni
18+
- echo "source /etc/fsl/fsl.sh" >> $HOME/.profile
19+
- echo "source /etc/afni/afni.sh" >> $HOME/.profile
20+
- mkdir -p ~/examples/ && ln -sf /usr/share/fsl-feeds/ ~/examples/feeds
21+
# Set up python environment
1022
- pip install --upgrade pip
1123
- pip install -e .
1224
- pip install matplotlib sphinx ipython boto
1325
- gem install fakes3
14-
- if [[ ! -d ~/examples/data ]]; then wget "http://tcpdiag.dl.sourceforge.net/project/nipy/nipype/nipype-0.2/nipype-tutorial.tar.bz2"; tar jxvf nipype-tutorial.tar.bz2; mkdir ~/examples; mv nipype-tutorial/* ~/examples/; fi
15-
# we download this manually because CircleCI does not cache apt
16-
- if [[ ! -d ~/examples/feeds ]]; then wget "http://fsl.fmrib.ox.ac.uk/fsldownloads/fsl-5.0.8-feeds.tar.gz"; tar zxvf fsl-5.0.8-feeds.tar.gz; mv feeds ~/examples/; fi
17-
- if [[ ! -d ~/examples/fsl_course_data ]]; then wget -c "http://fsl.fmrib.ox.ac.uk/fslcourse/fdt1.tar.gz" ; wget -c "http://fsl.fmrib.ox.ac.uk/fslcourse/fdt2.tar.gz"; wget -c "http://fsl.fmrib.ox.ac.uk/fslcourse/tbss.tar.gz"; mkdir ~/examples/fsl_course_data; tar zxvf fdt1.tar.gz -C ~/examples/fsl_course_data; tar zxvf fdt2.tar.gz -C ~/examples/fsl_course_data; tar zxvf tbss.tar.gz -C ~/examples/fsl_course_data; fi
18-
- wget -O- http://neuro.debian.net/lists/trusty.us-nh.full | sudo tee /etc/apt/sources.list.d/neurodebian.sources.list
19-
- sudo apt-key adv --recv-keys --keyserver hkp://pgp.mit.edu:80 0xA5D32F012649A5A9
20-
- sudo apt-get update -y; sudo apt-get install -y fsl-core fsl-atlases
26+
- if [[ ! -d ~/examples/data ]]; then wget "http://tcpdiag.dl.sourceforge.net/project/nipy/nipype/nipype-0.2/nipype-tutorial.tar.bz2" && tar jxvf nipype-tutorial.tar.bz2 && mv nipype-tutorial/* ~/examples/; fi
27+
- if [[ ! -d ~/examples/fsl_course_data ]]; then wget -c "http://fsl.fmrib.ox.ac.uk/fslcourse/fdt1.tar.gz" && wget -c "http://fsl.fmrib.ox.ac.uk/fslcourse/fdt2.tar.gz" && wget -c "http://fsl.fmrib.ox.ac.uk/fslcourse/tbss.tar.gz" && mkdir ~/examples/fsl_course_data && tar zxvf fdt1.tar.gz -C ~/examples/fsl_course_data && tar zxvf fdt2.tar.gz -C ~/examples/fsl_course_data && tar zxvf tbss.tar.gz -C ~/examples/fsl_course_data; fi
2128
- bash ~/nipype/tools/install_spm_mcr.sh
22-
- mkdir -p ~/.nipype && echo "[logging]" > ~/.nipype/nipype.cfg && echo "workflow_level = DEBUG" >> ~/.nipype/nipype.cfg && echo "interface_level = DEBUG" >> ~/.nipype/nipype.cfg && echo "filemanip_level = DEBUG" >> ~/.nipype/nipype.cfg
29+
- mkdir -p ~/.nipype && echo '[logging]' > ~/.nipype/nipype.cfg && echo 'workflow_level = DEBUG' >> ~/.nipype/nipype.cfg && echo 'interface_level = DEBUG' >> ~/.nipype/nipype.cfg && echo 'filemanip_level = DEBUG' >> ~/.nipype/nipype.cfg
30+
machine:
31+
environment:
32+
FSLOUTPUTTYPE: NIFTI_GZ
2333
test:
2434
override:
25-
- . /usr/share/fsl/5.0/etc/fslconf/fsl.sh && nosetests --with-doctest --logging-level=DEBUG --verbosity=3:
35+
- source $HOME/.profile; nosetests --with-doctest --logging-level=DEBUG --verbosity=3:
2636
environment:
2737
SPMMCRCMD: "$HOME/spm12/run_spm12.sh $HOME/mcr/v85/ script"
2838
FORCE_SPMMCR: 1
2939
FSL_COURSE_DATA: "$HOME/examples/fsl_course_data"
3040
timeout: 2600
3141
- set -o pipefail && cd doc && make html 2>&1 | tee ~/log.txt
3242
- cat ~/log.txt && if grep -q "ERROR" ~/log.txt; then false; else true; fi
33-
- . /usr/share/fsl/5.0/etc/fslconf/fsl.sh && python ~/nipype/tools/run_examples.py test_spm Linear workflow3d workflow4d:
43+
- source $HOME/.profile; python ~/nipype/tools/run_examples.py test_spm Linear workflow3d workflow4d:
3444
pwd: ../examples
3545
environment:
3646
SPMMCRCMD: "$HOME/spm12/run_spm12.sh $HOME/mcr/v85/ script"
3747
FORCE_SPMMCR: 1
3848
timeout: 1600
39-
- . /usr/share/fsl/5.0/etc/fslconf/fsl.sh && python ~/nipype/tools/run_examples.py fmri_fsl_feeds Linear l1pipeline:
49+
- source $HOME/.profile; python ~/nipype/tools/run_examples.py fmri_fsl_feeds Linear l1pipeline:
4050
pwd: ../examples
41-
- . /usr/share/fsl/5.0/etc/fslconf/fsl.sh && python ~/nipype/tools/run_examples.py fmri_spm_dartel Linear level1 l2pipeline:
51+
- source $HOME/.profile; python ~/nipype/tools/run_examples.py fmri_spm_dartel Linear level1 l2pipeline:
4252
pwd: ../examples
4353
environment:
4454
SPMMCRCMD: "$HOME/spm12/run_spm12.sh $HOME/mcr/v85/ script"
4555
FORCE_SPMMCR: 1
4656
timeout: 1600
47-
- . /usr/share/fsl/5.0/etc/fslconf/fsl.sh && python ~/nipype/tools/run_examples.py fmri_fsl_reuse Linear level1_workflow:
57+
- source $HOME/.profile; python ~/nipype/tools/run_examples.py fmri_fsl_reuse Linear level1_workflow:
4858
pwd: ../examples
49-
- . /usr/share/fsl/5.0/etc/fslconf/fsl.sh && python ~/nipype/tools/run_examples.py fmri_spm_nested Linear level1 l2pipeline:
59+
- source $HOME/.profile; python ~/nipype/tools/run_examples.py fmri_spm_nested Linear level1 l2pipeline:
5060
pwd: ../examples
5161
environment:
5262
SPMMCRCMD: "$HOME/spm12/run_spm12.sh $HOME/mcr/v85/ script"

doc/conf.py

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,11 @@
1212
# All configuration values have a default; values that are commented out
1313
# serve to show the default.
1414

15-
import sys, os
15+
import sys
16+
import os
1617

1718
nipypepath = os.path.abspath('..')
18-
sys.path.insert(1,nipypepath)
19+
sys.path.insert(1, nipypepath)
1920

2021
import nipype
2122

@@ -168,9 +169,9 @@
168169
#html_use_smartypants = True
169170

170171
# Custom sidebar templates, maps document names to template names.
171-
html_sidebars = {'**': ['gse.html','localtoc.html', 'sidebar_versions.html', 'indexsidebar.html'],
172-
'searchresults' : ['sidebar_versions.html', 'indexsidebar.html'],
173-
'version' : []}
172+
html_sidebars = {'**': ['gse.html', 'localtoc.html', 'sidebar_versions.html', 'indexsidebar.html'],
173+
'searchresults': ['sidebar_versions.html', 'indexsidebar.html'],
174+
'version': []}
174175

175176
# Additional templates that should be rendered to pages, maps page names to
176177
# template names.
@@ -211,8 +212,8 @@
211212
# Grouping the document tree into LaTeX files. List of tuples
212213
# (source start file, target name, title, author, documentclass [howto/manual]).
213214
latex_documents = [
214-
('documentation', 'nipype.tex', u'nipype Documentation',
215-
u'Neuroimaging in Python team', 'manual'),
215+
('documentation', 'nipype.tex', u'nipype Documentation',
216+
u'Neuroimaging in Python team', 'manual'),
216217
]
217218

218219
# The name of an image file (relative to this directory) to place at the top of

doc/devel/cmd_interface_devel.rst

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -198,11 +198,13 @@ output_name (optional)
198198
name of the output (if this is not set same name as the input will be
199199
assumed)
200200

201-
keep_extension (optional - not used)
202-
if you want the extension from the input to be kept
201+
keep_extension (optional)
202+
if you want the extension from the input or name_template to be kept. The
203+
name_template extension always overrides the input extension.
203204

204205
In addition one can add functionality to your class or base class, to allow
205-
changing extensions specific to package or interface
206+
changing extensions specific to package or interface. This overload function is
207+
trigerred only if keep_extension is not defined.
206208

207209
.. testcode::
208210

doc/devel/matlab_interface_devel.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ By subclassing **MatlabCommand** for your main class, and **MatlabInputSpec** fo
9393
>>> hello = HelloWorld()
9494
>>> hello.inputs.name = 'hello_world'
9595
>>> out = hello.run()
96-
>>> print out.outputs.matlab_output
96+
>>> print(out.outputs.matlab_output)
9797
"""
9898
input_spec = HelloWorldInputSpec
9999
output_spec = HelloWorldOutputSpec

doc/devel/python_interface_devel.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ do is to define inputs, outputs, _run_interface() (not run()), and _list_outputs
4141
thresholded_map = np.zeros(data.shape)
4242
thresholded_map[active_map] = data[active_map]
4343

44-
new_img = nb.Nifti1Image(thresholded_map, img.get_affine(), img.get_header())
44+
new_img = nb.Nifti1Image(thresholded_map, img.affine, img.header)
4545
_, base, _ = split_filename(fname)
4646
nb.save(new_img, base + '_thresholded.nii')
4747

0 commit comments

Comments
 (0)