Skip to content

Commit b7d2a19

Browse files
author
Shoshana Berleant
committed
Merge branch 'master' of https://github.com/nipy/nipype into raise_from
2 parents 11f5b3b + 124a850 commit b7d2a19

File tree

7 files changed

+23
-25
lines changed

7 files changed

+23
-25
lines changed

CHANGES

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
Release 0.12.0-rc1 (April 20, 2016)
22
============
33

4+
* ENH: Added grad_dev input to fsl.dti.bedpostx5 interface(https://github.com/nipy/nipype/pull/1493)
45
* ENH: ResourceMultiProc plugin to support resource allocation (https://github.com/nipy/nipype/pull/1372)
56
* ENH: Added dcm2niix interface (https://github.com/nipy/nipype/pull/1435)
67
* ENH: Add nipype_crash_search command (https://github.com/nipy/nipype/pull/1422)

nipype/__init__.py

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -55,26 +55,10 @@ def test(self, label='fast', verbose=1, extra_argv=['--exe'],
5555
test = _NoseTester().test
5656
del nosetester
5757

58-
59-
def _test_local_install():
60-
""" Warn the user that running with nipy being
61-
imported locally is a bad idea.
62-
"""
63-
if os.getcwd() == os.sep.join(
64-
os.path.abspath(__file__).split(os.sep)[:-2]):
65-
import warnings
66-
warnings.warn('Running the tests from the install directory may '
67-
'trigger some failures')
68-
69-
_test_local_install()
70-
7158
# Set up package information function
7259
from .pkg_info import get_pkg_info as _get_pkg_info
7360
get_info = lambda: _get_pkg_info(os.path.dirname(__file__))
7461

75-
# Cleanup namespace
76-
del _test_local_install
77-
7862
# If this file is exec after being imported, the following lines will
7963
# fail
8064
try:

nipype/interfaces/fsl/dti.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -265,6 +265,7 @@ class BEDPOSTX5InputSpec(FSLXCommandInputSpec):
265265
usedefault=True, position=1, argstr='%s')
266266
gradnonlin = traits.Bool(False, argstr='-g', desc=('consider gradient '
267267
'nonlinearities, default off'))
268+
grad_dev = File(exists=True, desc='grad_dev file, if gradnonlin, -g is True')
268269
use_gpu = traits.Bool(False, desc='Use the GPU version of bedpostx')
269270

270271

@@ -348,6 +349,10 @@ def _run_interface(self, runtime):
348349
os.path.join(subjectdir, 'bvals'))
349350
copyfile(self.inputs.bvecs,
350351
os.path.join(subjectdir, 'bvecs'))
352+
if isdefined(self.inputs.grad_dev):
353+
_, _, ext = split_filename(self.inputs.grad_dev)
354+
copyfile(self.inputs.grad_dev,
355+
os.path.join(subjectdir, 'grad_dev' + ext))
351356

352357
retval = super(BEDPOSTX5, self)._run_interface(runtime)
353358

nipype/interfaces/fsl/epi.py

Lines changed: 14 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -314,11 +314,9 @@ class ApplyTOPUPInputSpec(FSLCommandInputSpec):
314314
encoding_file = File(exists=True, mandatory=True,
315315
desc='name of text file with PE directions/times',
316316
argstr='--datain=%s')
317-
in_index = traits.List(traits.Int, argstr='--inindex=%s', sep=',',
318-
mandatory=True,
319-
desc=('comma separated list of indicies into '
320-
'--datain of the input image (to be '
321-
'corrected)'))
317+
in_index = traits.List(
318+
traits.Int, argstr='--inindex=%s', sep=',',
319+
desc='comma separated list of indices corresponding to --datain')
322320
in_topup_fieldcoef = File(exists=True, argstr="--topup=%s", copyfile=False,
323321
requires=['in_topup_movpar'],
324322
desc=('topup file containing the field '
@@ -360,7 +358,6 @@ class ApplyTOPUP(FSLCommand):
360358
>>> applytopup = ApplyTOPUP()
361359
>>> applytopup.inputs.in_files = ["epi.nii", "epi_rev.nii"]
362360
>>> applytopup.inputs.encoding_file = "topup_encoding.txt"
363-
>>> applytopup.inputs.in_index = [1,2]
364361
>>> applytopup.inputs.in_topup_fieldcoef = "topup_fieldcoef.nii.gz"
365362
>>> applytopup.inputs.in_topup_movpar = "topup_movpar.txt"
366363
>>> applytopup.inputs.output_type = "NIFTI_GZ"
@@ -374,6 +371,17 @@ class ApplyTOPUP(FSLCommand):
374371
input_spec = ApplyTOPUPInputSpec
375372
output_spec = ApplyTOPUPOutputSpec
376373

374+
def _parse_inputs(self, skip=None):
375+
if skip is None:
376+
skip = []
377+
378+
# If not defined, assume index are the first N entries in the
379+
# parameters file, for N input images.
380+
if not isdefined(self.inputs.in_index):
381+
self.inputs.in_index = list(range(1, len(self.inputs.in_files) + 1))
382+
383+
return super(ApplyTOPUP, self)._parse_inputs(skip=skip)
384+
377385
def _format_arg(self, name, spec, value):
378386
if name == 'in_topup_fieldcoef':
379387
return spec.argstr % value.split('_fieldcoef')[0]

nipype/interfaces/fsl/tests/test_auto_ApplyTOPUP.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,6 @@ def test_ApplyTOPUP_inputs():
2222
sep=',',
2323
),
2424
in_index=dict(argstr='--inindex=%s',
25-
mandatory=True,
2625
sep=',',
2726
),
2827
in_topup_fieldcoef=dict(argstr='--topup=%s',

nipype/interfaces/fsl/tests/test_auto_BEDPOSTX5.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ def test_BEDPOSTX5_inputs():
3636
),
3737
fudge=dict(argstr='-w %d',
3838
),
39+
grad_dev=dict(),
3940
gradnonlin=dict(argstr='-g',
4041
),
4142
ignore_exception=dict(nohash=True,

nipype/interfaces/io.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2458,8 +2458,8 @@ class JSONFileGrabber(IOBase):
24582458
{'param1': 'overrideMe', 'param3': 1.0}
24592459
>>> jsonSource.inputs.in_file = 'jsongrabber.txt'
24602460
>>> res = jsonSource.run()
2461-
>>> pprint.pprint(res.outputs.get()) # doctest: +NORMALIZE_WHITESPACE
2462-
{'param1': 'exampleStr', 'param2': 4, 'param3': 1.0}
2461+
>>> pprint.pprint(res.outputs.get()) # doctest: +NORMALIZE_WHITESPACE, +ELLIPSIS
2462+
{'param1': ...'exampleStr', 'param2': 4, 'param3': 1.0}
24632463
24642464
24652465
"""

0 commit comments

Comments
 (0)