Skip to content

Commit da38676

Browse files
committed
Merge pull request #13 from satra/enh/denoise
Enh/denoise
2 parents 2ed1344 + fe29433 commit da38676

File tree

8 files changed

+39
-13
lines changed

8 files changed

+39
-13
lines changed

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

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

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
# AUTO-GENERATED by tools/checkspecs.py - DO NOT EDIT
2+
from ...testing import assert_equal
3+
from ..mesh import TVTKBaseInterface
4+
5+
6+
def test_TVTKBaseInterface_inputs():
7+
input_map = dict(ignore_exception=dict(nohash=True,
8+
usedefault=True,
9+
),
10+
)
11+
inputs = TVTKBaseInterface.input_spec()
12+
13+
for key, metadata in list(input_map.items()):
14+
for metakey, value in list(metadata.items()):
15+
yield assert_equal, getattr(inputs.traits()[key], metakey), value
16+

nipype/interfaces/ants/tests/test_auto_Registration.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@ def test_Registration_inputs():
4444
),
4545
interpolation_parameters=dict(),
4646
invert_initial_moving_transform=dict(requires=['initial_moving_transform'],
47+
usedefault=True,
4748
xor=['initial_moving_transform_com'],
4849
),
4950
metric=dict(mandatory=True,

nipype/interfaces/base.py

Lines changed: 13 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1270,6 +1270,10 @@ def _process(drain=0):
12701270
result['merged'] = [r[1] for r in temp]
12711271
if output == 'allatonce':
12721272
stdout, stderr = proc.communicate()
1273+
if stdout and isinstance(stdout, bytes):
1274+
stdout = stdout.decode()
1275+
if stderr and isinstance(stderr, bytes):
1276+
stderr = stderr.decode()
12731277
result['stdout'] = str(stdout).split('\n')
12741278
result['stderr'] = str(stderr).split('\n')
12751279
result['merged'] = ''
@@ -1556,7 +1560,7 @@ def _filename_from_source(self, name, chain=None):
15561560

15571561
trait_spec = self.inputs.trait(name)
15581562
retval = getattr(self.inputs, name)
1559-
1563+
source_ext = None
15601564
if not isdefined(retval) or "%s" in retval:
15611565
if not trait_spec.name_source:
15621566
return retval
@@ -1585,7 +1589,7 @@ def _filename_from_source(self, name, chain=None):
15851589

15861590
# special treatment for files
15871591
try:
1588-
_, base, _ = split_filename(source)
1592+
_, base, source_ext = split_filename(source)
15891593
except AttributeError:
15901594
base = source
15911595
else:
@@ -1594,14 +1598,17 @@ def _filename_from_source(self, name, chain=None):
15941598

15951599
chain.append(name)
15961600
base = self._filename_from_source(ns, chain)
1601+
if isdefined(base):
1602+
_, _, source_ext = split_filename(base)
15971603

15981604
chain = None
15991605
retval = name_template % base
16001606
_, _, ext = split_filename(retval)
1601-
if trait_spec.keep_extension and ext:
1602-
return retval
1603-
return self._overload_extension(retval, name)
1604-
1607+
if trait_spec.keep_extension and (ext or source_ext):
1608+
if (ext is None or not ext) and source_ext:
1609+
retval = retval + source_ext
1610+
else:
1611+
retval = self._overload_extension(retval, name)
16051612
return retval
16061613

16071614
def _gen_filename(self, name):

nipype/interfaces/fsl/model.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -252,7 +252,7 @@ def _create_ev_files(
252252
element=count,
253253
ctype=ctype, val=val)
254254
ev_txt += "\n"
255-
255+
256256
for fconidx in ftest_idx:
257257
fval=0
258258
if con[0] in con_map.keys() and fconidx in con_map[con[0]]:

0 commit comments

Comments
 (0)