Skip to content

Commit 3c3d2e9

Browse files
authored
Merge pull request #2237 from nipy/oesteban-patch-2
Use name_source in ConcatenateLTA
2 parents 66411f4 + c4b27dd commit 3c3d2e9

File tree

2 files changed

+6
-9
lines changed

2 files changed

+6
-9
lines changed

nipype/interfaces/freesurfer/preprocess.py

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2387,8 +2387,8 @@ class ConcatenateLTAInputSpec(FSTraitedSpec):
23872387
File(exists=True), 'identity.nofile', argstr='%s', position=-2,
23882388
mandatory=True, desc='maps dst1(src2) to dst2')
23892389
out_file = File(
2390-
'concat.lta', usedefault=True, position=-1, argstr='%s',
2391-
hash_files=False,
2390+
position=-1, argstr='%s', hash_files=False, name_source=['in_lta1'],
2391+
name_template='%s_concat', keep_extension=True,
23922392
desc='the combined LTA maps: src1 to dst2 = LTA2*LTA1')
23932393

23942394
# Inversion and transform type
@@ -2434,7 +2434,7 @@ class ConcatenateLTA(FSCommand):
24342434
>>> conc_lta.inputs.in_lta1 = 'lta1.lta'
24352435
>>> conc_lta.inputs.in_lta2 = 'lta2.lta'
24362436
>>> conc_lta.cmdline # doctest: +ALLOW_UNICODE
2437-
'mri_concatenate_lta lta1.lta lta2.lta concat.lta'
2437+
'mri_concatenate_lta lta1.lta lta2.lta lta1_concat.lta'
24382438
24392439
You can use 'identity.nofile' as the filename for in_lta2, e.g.:
24402440
@@ -2459,8 +2459,3 @@ def _format_arg(self, name, spec, value):
24592459
if name == 'out_type':
24602460
value = {'VOX2VOX': 0, 'RAS2RAS': 1}[value]
24612461
return super(ConcatenateLTA, self)._format_arg(name, spec, value)
2462-
2463-
def _list_outputs(self):
2464-
outputs = self.output_spec().get()
2465-
outputs['out_file'] = os.path.abspath(self.inputs.out_file)
2466-
return outputs

nipype/interfaces/freesurfer/tests/test_auto_ConcatenateLTA.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,10 @@ def test_ConcatenateLTA_inputs():
2828
),
2929
out_file=dict(argstr='%s',
3030
hash_files=False,
31+
keep_extension=True,
32+
name_source=['in_lta1'],
33+
name_template='%s_concat',
3134
position=-1,
32-
usedefault=True,
3335
),
3436
out_type=dict(argstr='-out_type %d',
3537
),

0 commit comments

Comments
 (0)