Skip to content

Commit a80756c

Browse files
committed
Merge pull request #12 from nipy/master
Update new_interfaces with current Nipype Master
2 parents 8e88e09 + c46b932 commit a80756c

31 files changed

+699
-194
lines changed

.travis.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ before_install:
3434
echo 'include_dirs = /usr/include:/usr/include/X11' >> $HOME/.numpy-site.cfg;
3535
fi
3636
install:
37+
- sudo apt-get install fusefat
3738
- conda update --yes conda
3839
- conda create -n testenv --yes pip python=$TRAVIS_PYTHON_VERSION
3940
- source activate testenv
@@ -56,7 +57,7 @@ install:
5657
- pip install -r requirements.txt # finish remaining requirements
5758
- python setup.py install
5859
script:
59-
- python -W once:FSL:UserWarning:nipype `which nosetests` --with-doctest --with-cov --cover-package nipype --cov-config .coveragerc --logging-level=INFO
60+
- python -W once:FSL:UserWarning:nipype `which nosetests` --with-doctest --with-cov --cover-package nipype --cov-config .coveragerc --logging-level=DEBUG --verbosity=3
6061
after_success:
6162
- coveralls --config_file .coveragerc
6263
deploy:

CHANGES

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,13 @@
11
Next release
22
============
33

4+
* FIX: job execution on systems/approaches where locale is undefined (https://github.com/nipy/nipype/pull/1401)
5+
* FIX: Clean up byte/unicode issues using subprocess (https://github.com/nipy/nipype/pull/1394)
46
* FIX: Prevent crash when tvtk is loaded - ETS_TOOLKIT=null (https://github.com/nipy/nipype/pull/973)
57
* ENH: New interfaces in dipy: RESTORE, EstimateResponseSH, CSD and StreamlineTractography
68
(https://github.com/nipy/nipype/pull/1090)
79
* ENH: Added interfaces of AFNI (https://github.com/nipy/nipype/pull/1360,
8-
https://github.com/nipy/nipype/pull/1361)
10+
https://github.com/nipy/nipype/pull/1361, https://github.com/nipy/nipype/pull/1382)
911
* ENH: Provides a Nipype wrapper for antsJointFusion (https://github.com/nipy/nipype/pull/1351)
1012
* ENH: Added support for PETPVC (https://github.com/nipy/nipype/pull/1335)
1113
* ENH: Merge S3DataSink into DataSink, added AWS documentation (https://github.com/nipy/nipype/pull/1316)
@@ -21,6 +23,8 @@ Next release
2123
* API: Default model level for the bedpostx workflow has been set to "2" following FSL 5.0.9 lead
2224
* ENH: New interfaces for interacting with AWS S3: S3DataSink and S3DataGrabber (https://github.com/nipy/nipype/pull/1201)
2325
* ENH: Interfaces for MINC tools (https://github.com/nipy/nipype/pull/1304)
26+
* FIX: Use realpath to determine hard link source (https://github.com/nipy/nipype/pull/1388)
27+
* FIX: Correct linking/copying fallback behavior (https://github.com/nipy/nipype/pull/1391)
2428

2529
Release 0.11.0 (September 15, 2015)
2630
============

README.rst

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,10 @@ NIPYPE: Neuroimaging in Python: Pipelines and Interfaces
3434
:target: https://pypi.python.org/pypi/nipype/
3535
:alt: License
3636

37+
.. image:: https://img.shields.io/badge/gitter-join%20chat%20%E2%86%92-brightgreen.svg?style=flat
38+
:target: http://gitter.im/nipy/nipype
39+
:alt: Chat
40+
3741
Current neuroimaging software offer users an incredible opportunity to
3842
analyze data using a variety of different algorithms. However, this has
3943
resulted in a heterogeneous collection of specialized applications

circle.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ dependencies:
1212
- bash <(wget -q -O- http://neuro.debian.net/_files/neurodebian-travis.sh)
1313
override:
1414
# Install apt packages
15-
- sudo apt-get install -y fsl-core fsl-atlases fsl-mni152-templates fsl-feeds afni swig python-vtk xvfb
15+
- sudo apt-get install -y fsl-core fsl-atlases fsl-mni152-templates fsl-feeds afni swig python-vtk xvfb fusefat
1616
- echo 'source /etc/fsl/fsl.sh' >> $HOME/.profile
1717
- echo 'source /etc/afni/afni.sh' >> $HOME/.profile
1818
- mkdir -p ~/examples/ && ln -sf /usr/share/fsl-feeds/ ~/examples/feeds
@@ -29,7 +29,7 @@ dependencies:
2929
- pip install -e git+https://github.com/enthought/etsproxy.git#egg=etsproxy
3030
- pip install -e git+https://github.com/enthought/ets.git#egg=ets
3131
- gem install fakes3
32-
- 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
32+
- if [[ ! -d ~/examples/data ]]; then wget "https://dl.dropbox.com/s/jzgq2nupxyz36bp/nipype-tutorial.tar.bz2" && tar jxvf nipype-tutorial.tar.bz2 && mv nipype-tutorial/* ~/examples/; fi
3333
- 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
3434
- bash ~/nipype/tools/install_spm_mcr.sh
3535
- 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

doc/documentation.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ Documentation
99
:Release: |version|
1010
:Date: |today|
1111

12-
Previous versions: `0.10.0 <http://nipy.org/nipype/0.10.0>`_ `0.9.2 <http://nipy.org/nipype/0.9.2>`_
12+
Previous versions: `0.11.0 <http://nipy.org/nipype/0.11.0>`_ `0.10.0 <http://nipy.org/nipype/0.10.0>`_
1313

1414
.. container:: doc2
1515

doc/links_names.txt

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@
4646
.. _pylint: http://www.logilab.org/project/pylint
4747
.. _pyflakes: http://divmod.org/trac/wiki/DivmodPyflakes
4848
.. _virtualenv: http://pypi.python.org/pypi/virtualenv
49-
.. _git: http://git.or.cz/
49+
.. _git: https://git-scm.com/
5050
.. _flymake: http://flymake.sourceforge.net/
5151
.. _rope: http://rope.sourceforge.net/
5252
.. _pymacs: http://pymacs.progiciels-bpi.ca/pymacs.html
@@ -60,21 +60,21 @@
6060
.. _`python coverage tester`: http://nedbatchelder.com/code/modules/coverage.html
6161

6262
.. Other python projects
63-
.. _numpy: http://www.scipy.org/NumPy
63+
.. _numpy: http://www.numpy.org/
6464
.. _scipy: http://www.scipy.org
65-
.. _ipython: http://ipython.scipy.org
66-
.. _`ipython manual`: http://ipython.scipy.org/doc/manual/html
67-
.. _matplotlib: http://matplotlib.sourceforge.net
65+
.. _ipython: https://ipython.org
66+
.. _`ipython manual`: https://ipython.readthedocs.org/en/stable/
67+
.. _matplotlib: http://matplotlib.org/
6868
.. _ETS: http://code.enthought.com/projects/tool-suite.php
6969
.. _`Enthought Tool Suite`: http://code.enthought.com/projects/tool-suite.php
7070
.. _python: http://www.python.org
7171
.. _mayavi: http://mayavi.sourceforge.net/
72-
.. _sympy: http://code.google.com/p/sympy/
73-
.. _networkx: http://networkx.lanl.gov/
74-
.. _pythonxy: http://www.pythonxy.com/
72+
.. _sympy: http://www.sympy.org/
73+
.. _networkx: https://networkx.github.io/
74+
.. _pythonxy: https://python-xy.github.io/
7575
.. _EPD: http://www.enthought.com/products/epd.php
7676
.. _Traits: http://code.enthought.com/projects/traits/
77-
.. _Anaconda: https://store.continuum.io/cshop/anaconda/
77+
.. _Anaconda: https://www.continuum.io/downloads
7878
.. _Canopy: https://www.enthought.com/products/canopy/
7979

8080
.. Python imaging projects

doc/users/pipeline_tutorial.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ Step 0
6363
~~~~~~
6464

6565
Download and extract the `Pipeline tutorial data (429MB).
66-
<http://sourceforge.net/projects/nipy/files/nipype/nipype-0.2/nipype-tutorial.tar.bz2/download>`_
66+
<https://dl.dropbox.com/s/jzgq2nupxyz36bp/nipype-tutorial.tar.bz2>`_
6767

6868
(checksum: 56ed4b7e0aac5627d1724e9c10cd26a7)
6969

doc/users/plugins.rst

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -298,10 +298,11 @@ a custom template::
298298
In addition to overall workflow configuration, you can use node level
299299
configuration for OAR::
300300

301-
node.plugin_args = {'oarsub_args': '-l "nodes=1/cores=3"'}
301+
node.plugin_args = {'overwrite': True, 'oarsub_args': '-l "nodes=1/cores=3"'}
302302

303303
this would apply only to the node and is useful in situations, where a
304304
particular node might use more resources than other nodes in a workflow.
305+
You need to set the 'overwrite' flag to bypass the general settings-template you defined for the other nodes.
305306

306307

307308
``qsub`` emulation

examples/README

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
A dataset for use with these scripts can be downloaded from the nipype
22
website. At the time of writing, it's at:
33

4-
http://nipy.sourceforge.net/nipype/users/pipeline_tutorial.html
4+
http://nipy.org/nipype/users/pipeline_tutorial.html

nipype/interfaces/afni/__init__.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,5 +12,6 @@
1212
LFCD, Copy, Fourier, Allineate, Maskave, SkullStrip, TCat,
1313
Fim, BlurInMask, Autobox, TCorrMap, Bandpass, Retroicor,
1414
TCorrelate, TCorr1D, BrickStat, ROIStats, AutoTcorrelate,
15-
AFNItoNIFTI, Eval, Means, Hist, FWHMx)
15+
AFNItoNIFTI, Eval, Means, Hist, FWHMx, OutlierCount,
16+
QualityIndex)
1617
from .svm import (SVMTest, SVMTrain)

nipype/interfaces/afni/preprocess.py

Lines changed: 131 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,7 @@
1616

1717
from .base import (AFNICommandBase, AFNICommand, AFNICommandInputSpec, AFNICommandOutputSpec,
1818
Info, no_afni)
19-
from ..base import CommandLineInputSpec
20-
from ..base import (Directory, TraitedSpec,
19+
from ..base import (CommandLineInputSpec, CommandLine, Directory, TraitedSpec,
2120
traits, isdefined, File, InputMultiPath, Undefined)
2221
from ...external.six import string_types
2322
from ...utils.filemanip import (load_json, save_json, split_filename)
@@ -2817,3 +2816,133 @@ def _list_outputs(self):
28172816

28182817
outputs['fwhm'] = tuple(sout)
28192818
return outputs
2819+
2820+
2821+
class OutlierCountInputSpec(CommandLineInputSpec):
2822+
in_file = File(argstr='%s', mandatory=True, exists=True, position=-2, desc='input dataset')
2823+
mask = File(exists=True, argstr='-mask %s', xor=['autoclip', 'automask'],
2824+
desc='only count voxels within the given mask')
2825+
qthr = traits.Range(value=1e-3, low=0.0, high=1.0, argstr='-qthr %.5f',
2826+
desc='indicate a value for q to compute alpha')
2827+
2828+
autoclip = traits.Bool(False, usedefault=True, argstr='-autoclip', xor=['in_file'],
2829+
desc='clip off small voxels')
2830+
automask = traits.Bool(False, usedefault=True, argstr='-automask', xor=['in_file'],
2831+
desc='clip off small voxels')
2832+
2833+
fraction = traits.Bool(False, usedefault=True, argstr='-fraction',
2834+
desc='write out the fraction of masked voxels'
2835+
' which are outliers at each timepoint')
2836+
interval = traits.Bool(False, usedefault=True, argstr='-range',
2837+
desc='write out the median + 3.5 MAD of outlier'
2838+
' count with each timepoint')
2839+
save_outliers = traits.Bool(False, usedefault=True, desc='enables out_file option')
2840+
outliers_file = File(
2841+
name_template="%s_outliers", argstr='-save %s', name_source=["in_file"],
2842+
output_name='out_outliers', keep_extension=True, desc='output image file name')
2843+
2844+
polort = traits.Int(argstr='-polort %d',
2845+
desc='detrend each voxel timeseries with polynomials')
2846+
legendre = traits.Bool(False, usedefault=True, argstr='-legendre',
2847+
desc='use Legendre polynomials')
2848+
out_file = File(
2849+
name_template='%s_outliers', name_source=['in_file'], argstr='> %s',
2850+
keep_extension=False, position=-1, desc='capture standard output')
2851+
2852+
2853+
class OutlierCountOutputSpec(TraitedSpec):
2854+
out_outliers = File(exists=True, desc='output image file name')
2855+
out_file = File(
2856+
name_template='%s_tqual', name_source=['in_file'], argstr='> %s',
2857+
keep_extension=False, position=-1, desc='capture standard output')
2858+
2859+
2860+
class OutlierCount(CommandLine):
2861+
"""Create a 3D dataset from 2D image files using AFNI to3d command
2862+
2863+
For complete details, see the `to3d Documentation
2864+
<http://afni.nimh.nih.gov/pub/dist/doc/program_help/to3d.html>`_
2865+
2866+
Examples
2867+
========
2868+
2869+
>>> from nipype.interfaces import afni
2870+
>>> toutcount = afni.OutlierCount()
2871+
>>> toutcount.inputs.in_file = 'functional.nii'
2872+
>>> toutcount.cmdline #doctest: +ELLIPSIS
2873+
'3dToutcount functional.nii > functional_outliers'
2874+
>>> res = toutcount.run() #doctest: +SKIP
2875+
2876+
"""
2877+
2878+
_cmd = '3dToutcount'
2879+
input_spec = OutlierCountInputSpec
2880+
output_spec = OutlierCountOutputSpec
2881+
2882+
def _parse_inputs(self, skip=None):
2883+
if skip is None:
2884+
skip = []
2885+
2886+
if not self.inputs.save_outliers:
2887+
skip += ['outliers_file']
2888+
return super(OutlierCount, self)._parse_inputs(skip)
2889+
2890+
def _list_outputs(self):
2891+
outputs = self.output_spec().get()
2892+
if self.inputs.save_outliers:
2893+
outputs['out_outliers'] = op.abspath(self.inputs.outliers_file)
2894+
outputs['out_file'] = op.abspath(self.inputs.out_file)
2895+
return outputs
2896+
2897+
2898+
class QualityIndexInputSpec(CommandLineInputSpec):
2899+
in_file = File(argstr='%s', mandatory=True, exists=True, position=-2, desc='input dataset')
2900+
mask = File(exists=True, argstr='-mask %s', xor=['autoclip', 'automask'],
2901+
desc='compute correlation only across masked voxels')
2902+
spearman = traits.Bool(False, usedefault=True, argstr='-spearman',
2903+
desc='Quality index is 1 minus the Spearman (rank) '
2904+
'correlation coefficient of each sub-brick '
2905+
'with the median sub-brick. (default)')
2906+
quadrant = traits.Bool(False, usedefault=True, argstr='-quadrant',
2907+
desc='Similar to -spearman, but using 1 minus the '
2908+
'quadrant correlation coefficient as the '
2909+
'quality index.')
2910+
autoclip = traits.Bool(False, usedefault=True, argstr='-autoclip', xor=['mask'],
2911+
desc='clip off small voxels')
2912+
automask = traits.Bool(False, usedefault=True, argstr='-automask', xor=['mask'],
2913+
desc='clip off small voxels')
2914+
clip = traits.Float(argstr='-clip %f', desc='clip off values below')
2915+
2916+
interval = traits.Bool(False, usedefault=True, argstr='-range',
2917+
desc='write out the median + 3.5 MAD of outlier'
2918+
' count with each timepoint')
2919+
out_file = File(
2920+
name_template='%s_tqual', name_source=['in_file'], argstr='> %s',
2921+
keep_extension=False, position=-1, desc='capture standard output')
2922+
2923+
2924+
class QualityIndexOutputSpec(TraitedSpec):
2925+
out_file = File(desc='file containing the caputured standard output')
2926+
2927+
2928+
class QualityIndex(CommandLine):
2929+
"""Create a 3D dataset from 2D image files using AFNI to3d command
2930+
2931+
For complete details, see the `to3d Documentation
2932+
<http://afni.nimh.nih.gov/pub/dist/doc/program_help/to3d.html>`_
2933+
2934+
Examples
2935+
========
2936+
2937+
>>> from nipype.interfaces import afni
2938+
>>> tqual = afni.QualityIndex()
2939+
>>> tqual.inputs.in_file = 'functional.nii'
2940+
>>> tqual.cmdline #doctest: +ELLIPSIS
2941+
'3dTqual functional.nii > functional_tqual'
2942+
>>> res = tqual.run() #doctest: +SKIP
2943+
2944+
"""
2945+
2946+
_cmd = '3dTqual'
2947+
input_spec = QualityIndexInputSpec
2948+
output_spec = QualityIndexOutputSpec
Lines changed: 80 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,80 @@
1+
# AUTO-GENERATED by tools/checkspecs.py - DO NOT EDIT
2+
from ....testing import assert_equal
3+
from ..preprocess import OutlierCount
4+
5+
6+
def test_OutlierCount_inputs():
7+
input_map = dict(args=dict(argstr='%s',
8+
),
9+
autoclip=dict(argstr='-autoclip',
10+
usedefault=True,
11+
xor=['in_file'],
12+
),
13+
automask=dict(argstr='-automask',
14+
usedefault=True,
15+
xor=['in_file'],
16+
),
17+
environ=dict(nohash=True,
18+
usedefault=True,
19+
),
20+
fraction=dict(argstr='-fraction',
21+
usedefault=True,
22+
),
23+
ignore_exception=dict(nohash=True,
24+
usedefault=True,
25+
),
26+
in_file=dict(argstr='%s',
27+
mandatory=True,
28+
position=-2,
29+
),
30+
interval=dict(argstr='-range',
31+
usedefault=True,
32+
),
33+
legendre=dict(argstr='-legendre',
34+
usedefault=True,
35+
),
36+
mask=dict(argstr='-mask %s',
37+
xor=['autoclip', 'automask'],
38+
),
39+
out_file=dict(argstr='> %s',
40+
keep_extension=False,
41+
name_source=['in_file'],
42+
name_template='%s_outliers',
43+
position=-1,
44+
),
45+
outliers_file=dict(argstr='-save %s',
46+
keep_extension=True,
47+
name_source=['in_file'],
48+
name_template='%s_outliers',
49+
output_name='out_outliers',
50+
),
51+
polort=dict(argstr='-polort %d',
52+
),
53+
qthr=dict(argstr='-qthr %.5f',
54+
),
55+
save_outliers=dict(usedefault=True,
56+
),
57+
terminal_output=dict(nohash=True,
58+
),
59+
)
60+
inputs = OutlierCount.input_spec()
61+
62+
for key, metadata in list(input_map.items()):
63+
for metakey, value in list(metadata.items()):
64+
yield assert_equal, getattr(inputs.traits()[key], metakey), value
65+
66+
67+
def test_OutlierCount_outputs():
68+
output_map = dict(out_file=dict(argstr='> %s',
69+
keep_extension=False,
70+
name_source=['in_file'],
71+
name_template='%s_tqual',
72+
position=-1,
73+
),
74+
out_outliers=dict(),
75+
)
76+
outputs = OutlierCount.output_spec()
77+
78+
for key, metadata in list(output_map.items()):
79+
for metakey, value in list(metadata.items()):
80+
yield assert_equal, getattr(outputs.traits()[key], metakey), value

0 commit comments

Comments
 (0)