Skip to content

Commit 1245365

Browse files
name template for outputs of BestLinReg
1 parent beb5eb2 commit 1245365

File tree

1 file changed

+10
-38
lines changed

1 file changed

+10
-38
lines changed

nipype/interfaces/minc/minc.py

Lines changed: 10 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -3099,13 +3099,21 @@ class BestLinRegInputSpec(CommandLineInputSpec):
30993099
desc='output xfm file',
31003100
genfile=True,
31013101
argstr='%s',
3102-
position=-2,)
3102+
position=-2,
3103+
name_source=['source'],
3104+
hash_files=False,
3105+
name_template='%s_bestlinreg.xfm',
3106+
keep_extension=False)
31033107

31043108
output_mnc = File(
31053109
desc='output mnc file',
31063110
genfile=True,
31073111
argstr='%s',
3108-
position=-1,)
3112+
position=-1,
3113+
name_source=['source'],
3114+
hash_files=False,
3115+
name_template='%s_bestlinreg.mnc',
3116+
keep_extension=False)
31093117

31103118
verbose = traits.Bool(
31113119
desc='Print out log messages. Default: False.',
@@ -3155,42 +3163,6 @@ class BestLinReg(CommandLine):
31553163
output_spec = BestLinRegOutputSpec
31563164
_cmd = 'bestlinreg'
31573165

3158-
def _gen_filename(self, name):
3159-
if name == 'output_mnc':
3160-
output_mnc = self.inputs.output_mnc
3161-
3162-
if isdefined(output_mnc):
3163-
return os.path.abspath(output_mnc)
3164-
else:
3165-
return aggregate_filename(
3166-
[self.inputs.source, self.inputs.target], 'bestlinreg_output')
3167-
elif name == 'output_xfm':
3168-
output_xfm = self.inputs.output_xfm
3169-
3170-
if isdefined(output_xfm):
3171-
return os.path.abspath(output_xfm)
3172-
else:
3173-
return aggregate_filename(
3174-
[
3175-
self.inputs.source,
3176-
self.inputs.target],
3177-
'bestlinreg_output') + 'output_xfm.xfm' # FIXME, tidy up
3178-
else:
3179-
raise NotImplemented
3180-
3181-
def _list_outputs(self):
3182-
outputs = self.output_spec().get()
3183-
outputs['output_mnc'] = os.path.abspath(
3184-
self._gen_filename('output_mnc'))
3185-
outputs['output_xfm'] = os.path.abspath(
3186-
self._gen_filename('output_xfm'))
3187-
return outputs
3188-
3189-
3190-
"""
3191-
"$isomodel_base.mnc", $fitfiles[$f], $modxfm[$f]);
3192-
"""
3193-
31943166

31953167
class NlpFitInputSpec(CommandLineInputSpec):
31963168
source = File(

0 commit comments

Comments
 (0)