Skip to content

Commit 179ed74

Browse files
authored
Merge branch 'master' into fix/py2functions
2 parents 18edf55 + 4b587d6 commit 179ed74

Some content is hidden

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

60 files changed

+3474
-137
lines changed

.zenodo.json

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -518,6 +518,11 @@
518518
"affiliation": "MIT, HMS",
519519
"name": "Ghosh, Satrajit",
520520
"orcid": "0000-0002-5312-6729"
521+
},
522+
{
523+
"affiliation": "University of Amsterdam",
524+
"name": "Lukas Snoek",
525+
"orcid": "0000-0001-8972-204X"
521526
}
522527
],
523528
"keywords": [
-150 KB
Loading

doc/images/nipype_architecture_overview2.svg

Lines changed: 1 addition & 1 deletion
Loading

nipype/algorithms/confounds.py

Lines changed: 242 additions & 35 deletions
Large diffs are not rendered by default.

nipype/algorithms/tests/test_auto_ACompCor.py

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,13 @@ def test_ACompCor_inputs():
77
input_map = dict(components_file=dict(usedefault=True,
88
),
99
header_prefix=dict(),
10+
high_pass_cutoff=dict(usedefault=True,
11+
),
1012
ignore_exception=dict(nohash=True,
1113
usedefault=True,
1214
),
15+
ignore_initial_volumes=dict(usedefault=True,
16+
),
1317
mask_files=dict(),
1418
mask_index=dict(requires=['mask_files'],
1519
xor=['merge_method'],
@@ -19,11 +23,16 @@ def test_ACompCor_inputs():
1923
),
2024
num_components=dict(usedefault=True,
2125
),
26+
pre_filter=dict(usedefault=True,
27+
),
2228
realigned_file=dict(mandatory=True,
2329
),
2430
regress_poly_degree=dict(usedefault=True,
2531
),
26-
use_regress_poly=dict(usedefault=True,
32+
repetition_time=dict(),
33+
save_pre_filter=dict(),
34+
use_regress_poly=dict(deprecated='0.15.0',
35+
new_name='pre_filter',
2736
),
2837
)
2938
inputs = ACompCor.input_spec()
@@ -35,6 +44,7 @@ def test_ACompCor_inputs():
3544

3645
def test_ACompCor_outputs():
3746
output_map = dict(components_file=dict(),
47+
pre_filter_file=dict(),
3848
)
3949
outputs = ACompCor.output_spec()
4050

nipype/algorithms/tests/test_auto_TCompCor.py

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,13 @@ def test_TCompCor_inputs():
77
input_map = dict(components_file=dict(usedefault=True,
88
),
99
header_prefix=dict(),
10+
high_pass_cutoff=dict(usedefault=True,
11+
),
1012
ignore_exception=dict(nohash=True,
1113
usedefault=True,
1214
),
15+
ignore_initial_volumes=dict(usedefault=True,
16+
),
1317
mask_files=dict(),
1418
mask_index=dict(requires=['mask_files'],
1519
xor=['merge_method'],
@@ -21,11 +25,16 @@ def test_TCompCor_inputs():
2125
),
2226
percentile_threshold=dict(usedefault=True,
2327
),
28+
pre_filter=dict(usedefault=True,
29+
),
2430
realigned_file=dict(mandatory=True,
2531
),
2632
regress_poly_degree=dict(usedefault=True,
2733
),
28-
use_regress_poly=dict(usedefault=True,
34+
repetition_time=dict(),
35+
save_pre_filter=dict(),
36+
use_regress_poly=dict(deprecated='0.15.0',
37+
new_name='pre_filter',
2938
),
3039
)
3140
inputs = TCompCor.input_spec()
@@ -38,6 +47,7 @@ def test_TCompCor_inputs():
3847
def test_TCompCor_outputs():
3948
output_map = dict(components_file=dict(),
4049
high_variance_masks=dict(),
50+
pre_filter_file=dict(),
4151
)
4252
outputs = TCompCor.output_spec()
4353

nipype/algorithms/tests/test_compcor.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ def test_compcor_no_regress_poly(self):
8080
self.run_cc(CompCor(realigned_file=self.realigned_file,
8181
mask_files=self.mask_files,
8282
mask_index=0,
83-
use_regress_poly=False),
83+
pre_filter=False),
8484
[['0.4451946442', '-0.7683311482'],
8585
['-0.4285129505', '-0.0926034137'],
8686
['0.5721540256', '0.5608764842'],

nipype/info.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@ def get_nipype_gitversion():
105105
PYTEST_MIN_VERSION = '3.0'
106106
FUTURE_MIN_VERSION = '0.16.0'
107107
SIMPLEJSON_MIN_VERSION = '3.8.0'
108-
PROV_MIN_VERSION = '1.5.0'
108+
PROV_VERSION = '1.5.0'
109109
CLICK_MIN_VERSION = '6.6.0'
110110

111111
NAME = 'nipype'
@@ -136,7 +136,7 @@ def get_nipype_gitversion():
136136
'traits>=%s' % TRAITS_MIN_VERSION,
137137
'future>=%s' % FUTURE_MIN_VERSION,
138138
'simplejson>=%s' % SIMPLEJSON_MIN_VERSION,
139-
'prov>=%s' % PROV_MIN_VERSION,
139+
'prov==%s' % PROV_VERSION,
140140
'click>=%s' % CLICK_MIN_VERSION,
141141
'funcsigs',
142142
'pytest>=%s' % PYTEST_MIN_VERSION,

nipype/interfaces/afni/__init__.py

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,10 @@
1515
Maskave, Means, OutlierCount,
1616
QualityIndex, ROIStats, Retroicor,
1717
Seg, SkullStrip, TCorr1D, TCorrMap, TCorrelate,
18-
TShift, Volreg, Warp, QwarpPlusMinus)
18+
TShift, Volreg, Warp, QwarpPlusMinus, Qwarp)
1919
from .svm import (SVMTest, SVMTrain)
20-
from .utils import (AFNItoNIFTI, Autobox, BrickStat, Calc, Copy, Edge3,
21-
Eval, FWHMx,
22-
MaskTool, Merge, Notes, Refit, Resample, TCat, TStat, To3D,
23-
Unifize, ZCutUp, GCOR,)
20+
from .utils import (AFNItoNIFTI, Autobox, Axialize, BrickStat, Calc, Cat, Copy,
21+
Edge3, Eval, FWHMx, MaskTool, Merge, Notes, NwarpApply,
22+
Refit, Resample, TCat, TStat, To3D, Unifize, ZCutUp, GCOR,
23+
Zcat, Zeropad)
24+
from .model import (Deconvolve, Remlfit)

nipype/interfaces/afni/base.py

Lines changed: 49 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,8 @@
1010
from sys import platform
1111

1212
from ... import logging
13-
from ...utils.filemanip import split_filename
13+
from ...utils.filemanip import split_filename, fname_presuffix
14+
1415
from ..base import (
1516
CommandLine, traits, CommandLineInputSpec, isdefined, File, TraitedSpec)
1617
from ...external.due import BibTeX
@@ -70,7 +71,7 @@ def version():
7071
return tuple(v)
7172

7273
@classmethod
73-
def outputtype_to_ext(cls, outputtype):
74+
def output_type_to_ext(cls, outputtype):
7475
"""Get the file extension for the given output type.
7576
7677
Parameters
@@ -217,7 +218,7 @@ def set_default_output_type(cls, outputtype):
217218

218219
def _overload_extension(self, value, name=None):
219220
path, base, _ = split_filename(value)
220-
return os.path.join(path, base + Info.outputtype_to_ext(self.inputs.outputtype))
221+
return os.path.join(path, base + Info.output_type_to_ext(self.inputs.outputtype))
221222

222223
def _list_outputs(self):
223224
outputs = super(AFNICommand, self)._list_outputs()
@@ -231,6 +232,51 @@ def _list_outputs(self):
231232
outputs[name] = outputs[name] + "+orig.BRIK"
232233
return outputs
233234

235+
def _gen_fname(self, basename, cwd=None, suffix=None, change_ext=True,
236+
ext=None):
237+
"""Generate a filename based on the given parameters.
238+
239+
The filename will take the form: cwd/basename<suffix><ext>.
240+
If change_ext is True, it will use the extentions specified in
241+
<instance>intputs.output_type.
242+
243+
Parameters
244+
----------
245+
basename : str
246+
Filename to base the new filename on.
247+
cwd : str
248+
Path to prefix to the new filename. (default is os.getcwd())
249+
suffix : str
250+
Suffix to add to the `basename`. (defaults is '' )
251+
change_ext : bool
252+
Flag to change the filename extension to the FSL output type.
253+
(default True)
254+
255+
Returns
256+
-------
257+
fname : str
258+
New filename based on given parameters.
259+
260+
"""
261+
262+
if basename == '':
263+
msg = 'Unable to generate filename for command %s. ' % self.cmd
264+
msg += 'basename is not set!'
265+
raise ValueError(msg)
266+
if cwd is None:
267+
cwd = os.getcwd()
268+
if ext is None:
269+
ext = Info.output_type_to_ext(self.inputs.outputtype)
270+
if change_ext:
271+
if suffix:
272+
suffix = ''.join((suffix, ext))
273+
else:
274+
suffix = ext
275+
if suffix is None:
276+
suffix = ''
277+
fname = fname_presuffix(basename, suffix=suffix,
278+
use_ext=False, newpath=cwd)
279+
return fname
234280

235281
def no_afni():
236282
""" Checks if AFNI is available """

0 commit comments

Comments
 (0)