@@ -218,7 +218,9 @@ class AllineateInputSpec(AFNICommandInputSpec):
218
218
out_file = File (
219
219
desc = 'output file from 3dAllineate' ,
220
220
argstr = '-prefix %s' ,
221
- genfile = True ,
221
+ name_template = '%s_allineate' ,
222
+ name_source = 'in_file' ,
223
+ hash_files = False ,
222
224
xor = ['allcostx' ])
223
225
out_param_file = File (
224
226
argstr = '-1Dparam_save %s' ,
@@ -424,11 +426,11 @@ class AllineateInputSpec(AFNICommandInputSpec):
424
426
_dirs = ['X' , 'Y' , 'Z' , 'I' , 'J' , 'K' ]
425
427
nwarp_fixmot = traits .List (
426
428
traits .Enum (* _dirs ),
427
- argstr = '-nwarp_fixmot%s' ,
429
+ argstr = '-nwarp_fixmot%s... ' ,
428
430
desc = 'To fix motion along directions.' )
429
431
nwarp_fixdep = traits .List (
430
432
traits .Enum (* _dirs ),
431
- argstr = '-nwarp_fixdep%s' ,
433
+ argstr = '-nwarp_fixdep%s... ' ,
432
434
desc = 'To fix non-linear warp dependency along directions.' )
433
435
verbose = traits .Bool (
434
436
argstr = '-verb' , desc = 'Print out verbose progress reports.' )
@@ -465,31 +467,29 @@ class Allineate(AFNICommand):
465
467
'3dAllineate -source functional.nii -prefix functional_allineate.nii -1Dmatrix_apply cmatrix.mat'
466
468
>>> res = allineate.run() # doctest: +SKIP
467
469
468
- >>> from nipype.interfaces import afni
469
470
>>> allineate = afni.Allineate()
470
471
>>> allineate.inputs.in_file = 'functional.nii'
471
472
>>> allineate.inputs.reference = 'structural.nii'
472
473
>>> allineate.inputs.allcostx = 'out.allcostX.txt'
473
474
>>> allineate.cmdline
474
475
'3dAllineate -source functional.nii -base structural.nii -allcostx |& tee out.allcostX.txt'
475
476
>>> res = allineate.run() # doctest: +SKIP
477
+
478
+ >>> allineate = afni.Allineate()
479
+ >>> allineate.inputs.in_file = 'functional.nii'
480
+ >>> allineate.inputs.reference = 'structural.nii'
481
+ >>> allineate.inputs.nwarp_fixmot = ['X', 'Y']
482
+ >>> allineate.cmdline
483
+ '3dAllineate -source functional.nii -nwarp_fixmotX -nwarp_fixmotY -prefix functional_allineate -base structural.nii'
484
+ >>> res = allineate.run() # doctest: +SKIP
476
485
"""
477
486
478
487
_cmd = '3dAllineate'
479
488
input_spec = AllineateInputSpec
480
489
output_spec = AllineateOutputSpec
481
490
482
- def _format_arg (self , name , trait_spec , value ):
483
- if name == 'nwarp_fixmot' or name == 'nwarp_fixdep' :
484
- arg = ' ' .join ([trait_spec .argstr % v for v in value ])
485
- return arg
486
- return super (Allineate , self )._format_arg (name , trait_spec , value )
487
-
488
491
def _list_outputs (self ):
489
- outputs = self .output_spec ().get ()
490
-
491
- if self .inputs .out_file :
492
- outputs ['out_file' ] = op .abspath (self .inputs .out_file )
492
+ outputs = super (Allineate , self )._list_outputs ()
493
493
494
494
if self .inputs .out_weight_file :
495
495
outputs ['out_weight_file' ] = op .abspath (
@@ -512,16 +512,10 @@ def _list_outputs(self):
512
512
outputs ['out_param_file' ] = op .abspath (
513
513
self .inputs .out_param_file )
514
514
515
- if isdefined (self .inputs .allcostx ):
516
- outputs ['allcostX' ] = os .path .abspath (
517
- os .path .join (os .getcwd (), self .inputs .allcostx ))
515
+ if self .inputs .allcostx :
516
+ outputs ['allcostX' ] = os .path .abspath (self .inputs .allcostx )
518
517
return outputs
519
518
520
- def _gen_filename (self , name ):
521
- if name == 'out_file' :
522
- return self ._list_outputs ()[name ]
523
- return None
524
-
525
519
526
520
class AutoTcorrelateInputSpec (AFNICommandInputSpec ):
527
521
in_file = File (
0 commit comments