Skip to content

Commit dd31756

Browse files
committed
Merge branch 'master' into enh/JSONFileInterface
Conflicts: CHANGES
2 parents c525a1b + e6b46ba commit dd31756

File tree

4 files changed

+26
-20
lines changed

4 files changed

+26
-20
lines changed

CHANGES

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ Next release
22
============
33

44
* ENH: New io interfaces for JSON files reading/writing (https://github.com/nipy/nipype/pull/1020)
5+
* ENH: Updated antsIntroduction to handle RA and RI registrations (https://github.com/nipy/nipype/pull/1009)
56
* ENH: Updated N4BiasCorrection input spec to include weight image and spline order. Made
67
argument formatting consistent. Cleaned ants.segmentation according to PEP8.
78
(https://github.com/nipy/nipype/pull/990/files)
@@ -12,6 +13,7 @@ Next release
1213
* FIX: Corrected Freesurfer SegStats _list_outputs to avoid error if summary_file is
1314
undefined (issue #994)(https://https://github.com/nipy/nipype/pull/996)
1415
* FIX: OpenfMRI support and FSL 5.0.7 changes (https://github.com/nipy/nipype/pull/1006)
16+
* FIX: Output prefix in SPM Normalize with modulation (https://github.com/nipy/nipype/pull/1023)
1517

1618
Release 0.10.0 (October 10, 2014)
1719
============

nipype/interfaces/ants/legacy.py

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -94,16 +94,21 @@ class antsIntroduction(ANTSCommand):
9494

9595
def _list_outputs(self):
9696
outputs = self._outputs().get()
97+
transmodel = self.inputs.transformation_model
98+
99+
# When transform is set as 'RI'/'RA', wrap fields should not be expected
100+
# The default transformation is GR, which outputs the wrap fields
101+
if not isdefined(transmodel) or (isdefined(transmodel) and transmodel not in ['RI', 'RA']):
102+
outputs['warp_field'] = os.path.join(os.getcwd(),
103+
self.inputs.out_prefix +
104+
'Warp.nii.gz')
105+
outputs['inverse_warp_field'] = os.path.join(os.getcwd(),
106+
self.inputs.out_prefix +
107+
'InverseWarp.nii.gz')
97108

98109
outputs['affine_transformation'] = os.path.join(os.getcwd(),
99110
self.inputs.out_prefix +
100111
'Affine.txt')
101-
outputs['warp_field'] = os.path.join(os.getcwd(),
102-
self.inputs.out_prefix +
103-
'Warp.nii.gz')
104-
outputs['inverse_warp_field'] = os.path.join(os.getcwd(),
105-
self.inputs.out_prefix +
106-
'InverseWarp.nii.gz')
107112
outputs['input_file'] = os.path.join(os.getcwd(),
108113
self.inputs.out_prefix +
109114
'repaired.nii.gz')

nipype/interfaces/base.py

Lines changed: 6 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -757,17 +757,12 @@ def _get_trait_desc(self, inputs, name, spec):
757757

758758
manhelpstr = ['\t%s' % name]
759759

760-
try:
761-
setattr(inputs, name, None)
762-
except TraitError as excp:
763-
def_val = ''
764-
if getattr(spec, 'usedefault'):
765-
def_arg = getattr(spec, 'default_value')()[1]
766-
def_val = ', nipype default value: %s' % str(def_arg)
767-
line = "(%s%s)" % (excp.info, def_val)
768-
manhelpstr = wrap(line, 70,
769-
initial_indent=manhelpstr[0]+': ',
770-
subsequent_indent='\t\t ')
760+
type_info = spec.full_info(inputs, name, None)
761+
default = ', nipype default value: %s' % spec.default_value()[1]
762+
line = "(%s%s)" % (type_info, default if spec.usedefault else '')
763+
manhelpstr = wrap(line, 70,
764+
initial_indent=manhelpstr[0]+': ',
765+
subsequent_indent='\t\t ')
771766

772767
if desc:
773768
for line in desc.split('\n'):

nipype/interfaces/spm/preprocess.py

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -497,20 +497,24 @@ def _list_outputs(self):
497497
outputs['normalized_files'] = self.inputs.apply_to_files
498498
outputs['normalized_source'] = self.inputs.source
499499
elif 'write' in self.inputs.jobtype:
500+
if isdefined(self.inputs.write_preserve) and self.inputs.write_preserve:
501+
prefixNorm = ''.join(['m', self.inputs.out_prefix])
502+
else:
503+
prefixNorm = self.inputs.out_prefix
500504
outputs['normalized_files'] = []
501505
if isdefined(self.inputs.apply_to_files):
502506
filelist = filename_to_list(self.inputs.apply_to_files)
503507
for f in filelist:
504508
if isinstance(f, list):
505-
run = [fname_presuffix(in_f, prefix=self.inputs.out_prefix) for in_f in f]
509+
run = [fname_presuffix(in_f, prefix=prefixNorm) for in_f in f]
506510
else:
507-
run = [fname_presuffix(f, prefix=self.inputs.out_prefix)]
511+
run = [fname_presuffix(f, prefix=prefixNorm)]
508512
outputs['normalized_files'].extend(run)
509513
if isdefined(self.inputs.source):
510514
outputs['normalized_source'] = []
511515
for imgf in filename_to_list(self.inputs.source):
512516
outputs['normalized_source'].append(fname_presuffix(imgf,
513-
prefix=self.inputs.out_prefix))
517+
prefix=prefixNorm))
514518

515519
return outputs
516520

0 commit comments

Comments
 (0)