@@ -219,6 +219,7 @@ class AllineateInputSpec(AFNICommandInputSpec):
219
219
desc = 'output file from 3dAllineate' ,
220
220
argstr = '-prefix %s' ,
221
221
genfile = True ,
222
+ hash_files = False ,
222
223
xor = ['allcostx' ])
223
224
out_param_file = File (
224
225
argstr = '-1Dparam_save %s' ,
@@ -485,25 +486,30 @@ def _format_arg(self, name, trait_spec, value):
485
486
return arg
486
487
return super (Allineate , self )._format_arg (name , trait_spec , value )
487
488
489
+ def _gen_outfilename (self ):
490
+ out_file = self .inputs .out_file
491
+ if not isdefined (out_file ) and isdefined (self .inputs .in_file ) and not isdefined (self .inputs .allcostx ):
492
+ out_file = op .abspath (self ._gen_fname (self .inputs .in_file ,op .dirname (self .inputs .in_file ),suffix = '_allineate' ))
493
+ return out_file
494
+
488
495
def _list_outputs (self ):
489
496
outputs = self .output_spec ().get ()
490
497
491
- if self .inputs .out_file :
492
- outputs ['out_file' ] = op .abspath (self .inputs .out_file )
498
+ outputs ['out_file' ] = self ._gen_outfilename ()
493
499
494
- if self .inputs .out_weight_file :
500
+ if isdefined ( self .inputs .out_weight_file ) :
495
501
outputs ['out_weight_file' ] = op .abspath (
496
502
self .inputs .out_weight_file )
497
503
498
- if self .inputs .out_matrix :
504
+ if isdefined ( self .inputs .out_matrix ) :
499
505
path , base , ext = split_filename (self .inputs .out_matrix )
500
506
if ext .lower () not in ['.1d' , '.1D' ]:
501
507
outputs ['out_matrix' ] = self ._gen_fname (
502
508
self .inputs .out_matrix , suffix = '.aff12.1D' )
503
509
else :
504
510
outputs ['out_matrix' ] = op .abspath (self .inputs .out_matrix )
505
511
506
- if self .inputs .out_param_file :
512
+ if isdefined ( self .inputs .out_param_file ) :
507
513
path , base , ext = split_filename (self .inputs .out_param_file )
508
514
if ext .lower () not in ['.1d' , '.1D' ]:
509
515
outputs ['out_param_file' ] = self ._gen_fname (
@@ -519,7 +525,7 @@ def _list_outputs(self):
519
525
520
526
def _gen_filename (self , name ):
521
527
if name == 'out_file' :
522
- return self ._list_outputs ()[ name ]
528
+ return self ._gen_outfilename ()
523
529
return None
524
530
525
531
0 commit comments