Skip to content

Commit dc36fc9

Browse files
committed
Merge branch 'master' into enh/AntsForFMBworkflow
Conflicts: CHANGES
2 parents a15cbc6 + 5e05ffe commit dc36fc9

File tree

356 files changed

+625
-859
lines changed

Some content is hidden

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

356 files changed

+625
-859
lines changed

.travis.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@ cache:
22
- apt
33
language: python
44
python:
5-
- 2.6
65
- 2.7
76
env:
87
- INSTALL_DEB_DEPENDECIES=true

CHANGES

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,10 @@ Next release
33

44
* ENH: Improved FieldMap-Based (FMB) workflow for correction of susceptibility distortions in EPI seqs.
55
(https://github.com/nipy/nipype/pull/1019)
6+
* ENH: Dropped support for now 7 years old Python 2.6 (https://github.com/nipy/nipype/pull/1069)
7+
* FIX: terminal_output is not mandatory anymore (https://github.com/nipy/nipype/pull/1070)
8+
* ENH: Added "nipype_cmd" tool for running interfaces from the command line (https://github.com/nipy/nipype/pull/795)
9+
* FIX: Fixed Camino output naming (https://github.com/nipy/nipype/pull/1061)
610
* ENH: Add the average distance to ErrorMap (https://github.com/nipy/nipype/pull/1039)
711
* ENH: Inputs with name_source can be now chained in cascade (https://github.com/nipy/nipype/pull/938)
812
* ENH: Improve JSON interfaces: default settings when reading and consistent output creation

bin/nipype_cmd

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
#!/usr/bin/env python
2+
# emacs: -*- mode: python; py-indent-offset: 4; indent-tabs-mode: nil -*-
3+
# vi: set ft=python sts=4 ts=4 sw=4 et:
4+
import sys
5+
from nipype.utils.nipype_cmd import main
6+
7+
if __name__ == '__main__':
8+
main(sys.argv)

doc/users/index.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@
3737
saving_workflows
3838
spmmcr
3939
mipav
40+
nipypecmd
4041

4142

4243

doc/users/install.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@ recommendations.
107107
Must Have
108108
~~~~~~~~~
109109

110-
Python_ 2.6 - 2.7
110+
Python_ 2.7
111111

112112
Nibabel_ 1.0 - 1.4
113113
Neuroimaging file i/o library

doc/users/nipypecmd.rst

Lines changed: 68 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,68 @@
1+
.. _nipypecmd:
2+
3+
============================================================
4+
Running Nipype Interfaces from the command line (nipype_cmd)
5+
============================================================
6+
7+
The primary use of Nipype_ is to build automated non-interactive pipelines.
8+
However, sometimes there is a need to run some interfaces quickly from the command line.
9+
This is especially useful when running Interfaces wrapping code that does not have
10+
command line equivalents (nipy or SPM). Being able to run Nipype interfaces opens new
11+
possibilities such as inclusion of SPM processing steps in bash scripts.
12+
13+
To run Nipype Interafces you need to use the nipype_cmd tool that should already be installed.
14+
The tool allows you to list Interfaces available in a certain package:
15+
16+
.. testcode::
17+
18+
19+
$nipype_cmd nipype.interfaces.nipy
20+
21+
Available Interfaces:
22+
SpaceTimeRealigner
23+
Similarity
24+
ComputeMask
25+
FitGLM
26+
EstimateContrast
27+
FmriRealign4d
28+
29+
After selecting a particular Interface you can learn what inputs it requires:
30+
31+
.. testcode::
32+
33+
34+
$nipype_cmd nipype.interfaces.nipy ComputeMask --help
35+
36+
usage:nipype_cmd nipype.interfaces.nipy ComputeMask [-h] [--M M] [--cc CC]
37+
[--ignore_exception IGNORE_EXCEPTION]
38+
[--m M]
39+
[--reference_volume REFERENCE_VOLUME]
40+
mean_volume
41+
42+
Run ComputeMask
43+
44+
positional arguments:
45+
mean_volume mean EPI image, used to compute the threshold for the
46+
mask
47+
48+
optional arguments:
49+
-h, --help show this help message and exit
50+
--M M upper fraction of the histogram to be discarded
51+
--cc CC Keep only the largest connected component
52+
--ignore_exception IGNORE_EXCEPTION
53+
Print an error message instead of throwing an
54+
exception in case the interface fails to run
55+
--m M lower fraction of the histogram to be discarded
56+
--reference_volume REFERENCE_VOLUME
57+
reference volume used to compute the mask. If none is
58+
give, the mean volume is used.
59+
60+
Finally you can run run the Interface:
61+
62+
.. testcode::
63+
64+
$nipype_cmd nipype.interfaces.nipy ComputeMask mean.nii.gz
65+
66+
All that from the command line without having to start python interpreter manually.
67+
68+
.. include:: ../links_names.txt

examples/fmri_ants_openfmri.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -241,7 +241,7 @@ def create_reg_workflow(name='registration'):
241241

242242
warpmean = pe.Node(ants.ApplyTransforms(),
243243
name='warpmean')
244-
warpmean.inputs.input_image_type = 3
244+
warpmean.inputs.input_image_type = 0
245245
warpmean.inputs.interpolation = 'Linear'
246246
warpmean.inputs.invert_transform_flags = [False, False]
247247
warpmean.inputs.terminal_output = 'file'
@@ -257,7 +257,7 @@ def create_reg_workflow(name='registration'):
257257
warpall = pe.MapNode(ants.ApplyTransforms(),
258258
iterfield=['input_image'],
259259
name='warpall')
260-
warpall.inputs.input_image_type = 3
260+
warpall.inputs.input_image_type = 0
261261
warpall.inputs.interpolation = 'Linear'
262262
warpall.inputs.invert_transform_flags = [False, False]
263263
warpall.inputs.terminal_output = 'file'
@@ -449,7 +449,7 @@ def create_fs_reg_workflow(name='registration'):
449449
Transform the mean image. First to anatomical and then to target
450450
"""
451451
warpmean = Node(ants.ApplyTransforms(), name='warpmean')
452-
warpmean.inputs.input_image_type = 3
452+
warpmean.inputs.input_image_type = 0
453453
warpmean.inputs.interpolation = 'Linear'
454454
warpmean.inputs.invert_transform_flags = [False, False]
455455
warpmean.inputs.terminal_output = 'file'
@@ -464,7 +464,7 @@ def create_fs_reg_workflow(name='registration'):
464464
warpall = pe.MapNode(ants.ApplyTransforms(),
465465
iterfield=['input_image'],
466466
name='warpall')
467-
warpall.inputs.input_image_type = 3
467+
warpall.inputs.input_image_type = 0
468468
warpall.inputs.interpolation = 'Linear'
469469
warpall.inputs.invert_transform_flags = [False, False]
470470
warpall.inputs.terminal_output = 'file'

nipype/algorithms/metrics.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -572,7 +572,7 @@ def _run_interface(self, runtime):
572572
nb.Nifti1Image(errmap.astype(np.float32), nii_ref.get_affine(),
573573
hdr).to_filename(self._out_file)
574574

575-
return runtime
575+
return runtime
576576

577577
def _list_outputs(self):
578578
outputs = self.output_spec().get()

nipype/algorithms/tests/test_auto_ErrorMap.py

Lines changed: 0 additions & 33 deletions
This file was deleted.

nipype/algorithms/tests/test_auto_Overlap.py

Lines changed: 0 additions & 46 deletions
This file was deleted.

nipype/algorithms/tests/test_errormap.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ def test_errormap():
3232
errmap.inputs.in_ref = os.path.join(tempdir, 'alan.nii.gz')
3333
errmap.out_map = os.path.join(tempdir, 'out_map.nii.gz')
3434
result = errmap.run()
35-
yield assert_equal, result.outputs.distance, 1.125
35+
yield assert_equal, result.outputs.distance, 1.125
3636

3737
# Square metric
3838
errmap.inputs.metric = 'sqeuclidean'
@@ -42,9 +42,9 @@ def test_errormap():
4242
# Linear metric
4343
errmap.inputs.metric = 'euclidean'
4444
result = errmap.run()
45-
yield assert_equal, result.outputs.distance, 0.875
45+
yield assert_equal, result.outputs.distance, 0.875
4646

47-
# Masked
47+
# Masked
4848
errmap.inputs.mask = os.path.join(tempdir, 'mask.nii.gz')
4949
result = errmap.run()
5050
yield assert_equal, result.outputs.distance, 1.0

nipype/interfaces/afni/tests/test_auto_AFNICommand.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,7 @@ def test_AFNICommand_inputs():
1616
name_template='%s_afni',
1717
),
1818
outputtype=dict(),
19-
terminal_output=dict(mandatory=True,
20-
nohash=True,
19+
terminal_output=dict(nohash=True,
2120
),
2221
)
2322
inputs = AFNICommand.input_spec()

nipype/interfaces/afni/tests/test_auto_AFNItoNIFTI.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,7 @@ def test_AFNItoNIFTI_inputs():
2121
name_template='%s.nii',
2222
),
2323
outputtype=dict(),
24-
terminal_output=dict(mandatory=True,
25-
nohash=True,
24+
terminal_output=dict(nohash=True,
2625
),
2726
)
2827
inputs = AFNItoNIFTI.input_spec()

nipype/interfaces/afni/tests/test_auto_Allineate.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -83,8 +83,7 @@ def test_Allineate_inputs():
8383
),
8484
source_mask=dict(argstr='-source_mask %s',
8585
),
86-
terminal_output=dict(mandatory=True,
87-
nohash=True,
86+
terminal_output=dict(nohash=True,
8887
),
8988
two_best=dict(argstr='-twobest %d',
9089
),

nipype/interfaces/afni/tests/test_auto_AutoTcorrelate.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,7 @@ def test_AutoTcorrelate_inputs():
3333
outputtype=dict(),
3434
polort=dict(argstr='-polort %d',
3535
),
36-
terminal_output=dict(mandatory=True,
37-
nohash=True,
36+
terminal_output=dict(nohash=True,
3837
),
3938
)
4039
inputs = AutoTcorrelate.input_spec()

nipype/interfaces/afni/tests/test_auto_Autobox.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,7 @@ def test_Autobox_inputs():
2323
outputtype=dict(),
2424
padding=dict(argstr='-npad %d',
2525
),
26-
terminal_output=dict(mandatory=True,
27-
nohash=True,
26+
terminal_output=dict(nohash=True,
2827
),
2928
)
3029
inputs = Autobox.input_spec()

nipype/interfaces/afni/tests/test_auto_Automask.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,7 @@ def test_Automask_inputs():
3131
name_template='%s_mask',
3232
),
3333
outputtype=dict(),
34-
terminal_output=dict(mandatory=True,
35-
nohash=True,
34+
terminal_output=dict(nohash=True,
3635
),
3736
)
3837
inputs = Automask.input_spec()

nipype/interfaces/afni/tests/test_auto_Bandpass.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,8 +54,7 @@ def test_Bandpass_inputs():
5454
position=1,
5555
),
5656
outputtype=dict(),
57-
terminal_output=dict(mandatory=True,
58-
nohash=True,
57+
terminal_output=dict(nohash=True,
5958
),
6059
tr=dict(argstr='-dt %f',
6160
),

nipype/interfaces/afni/tests/test_auto_BlurInMask.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,8 +38,7 @@ def test_BlurInMask_inputs():
3838
outputtype=dict(),
3939
preserve=dict(argstr='-preserve',
4040
),
41-
terminal_output=dict(mandatory=True,
42-
nohash=True,
41+
terminal_output=dict(nohash=True,
4342
),
4443
)
4544
inputs = BlurInMask.input_spec()

nipype/interfaces/afni/tests/test_auto_BrickStat.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,7 @@ def test_BrickStat_inputs():
2626
name_template='%s_afni',
2727
),
2828
outputtype=dict(),
29-
terminal_output=dict(mandatory=True,
30-
nohash=True,
29+
terminal_output=dict(nohash=True,
3130
),
3231
)
3332
inputs = BrickStat.input_spec()

nipype/interfaces/afni/tests/test_auto_Calc.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,8 +37,7 @@ def test_Calc_inputs():
3737
),
3838
stop_idx=dict(requires=['start_idx'],
3939
),
40-
terminal_output=dict(mandatory=True,
41-
nohash=True,
40+
terminal_output=dict(nohash=True,
4241
),
4342
)
4443
inputs = Calc.input_spec()

nipype/interfaces/afni/tests/test_auto_Copy.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,7 @@ def test_Copy_inputs():
2121
name_template='%s_copy',
2222
),
2323
outputtype=dict(),
24-
terminal_output=dict(mandatory=True,
25-
nohash=True,
24+
terminal_output=dict(nohash=True,
2625
),
2726
)
2827
inputs = Copy.input_spec()

nipype/interfaces/afni/tests/test_auto_Despike.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,7 @@ def test_Despike_inputs():
2121
name_template='%s_despike',
2222
),
2323
outputtype=dict(),
24-
terminal_output=dict(mandatory=True,
25-
nohash=True,
24+
terminal_output=dict(nohash=True,
2625
),
2726
)
2827
inputs = Despike.input_spec()

nipype/interfaces/afni/tests/test_auto_Detrend.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,7 @@ def test_Detrend_inputs():
2121
name_template='%s_detrend',
2222
),
2323
outputtype=dict(),
24-
terminal_output=dict(mandatory=True,
25-
nohash=True,
24+
terminal_output=dict(nohash=True,
2625
),
2726
)
2827
inputs = Detrend.input_spec()

0 commit comments

Comments
 (0)