11# -*- coding: utf-8 -*-
22# emacs: -*- mode: python; py-indent-offset: 4; indent-tabs-mode: nil -*-
3- # vi: set ft = python sts = 4 ts = 4 sw = 4 et:
3+ # vi: set ft= python sts= 4 ts= 4 sw= 4 et:
44"""Afni preprocessing interfaces
55
66 Change directory to provide relative paths for doctests
@@ -2384,7 +2384,9 @@ class RetroicorInputSpec(AFNICommandInputSpec):
23842384 mandatory = True ,
23852385 exists = True ,
23862386 copyfile = False )
2387- out_file = File (desc = 'output image file name' , argstr = '-prefix %s' , mandatory = True , position = 1 )
2387+ out_file = File (name_template = '%s_retroicor' , name_source = ['in_file' ],
2388+ desc = 'output image file name' ,
2389+ argstr = '-prefix %s' , position = 1 )
23882390 card = File (desc = '1D cardiac data file for cardiac correction' ,
23892391 argstr = '-card %s' ,
23902392 position = - 2 ,
@@ -2438,6 +2440,7 @@ class Retroicor(AFNICommand):
24382440 >>> ret.inputs.in_file = 'functional.nii'
24392441 >>> ret.inputs.card = 'mask.1D'
24402442 >>> ret.inputs.resp = 'resp.1D'
2443+ >>> ret.inputs.outputtype = 'NIFTI'
24412444 >>> res = ret.run() # doctest: +SKIP
24422445 """
24432446
@@ -2446,6 +2449,13 @@ class Retroicor(AFNICommand):
24462449 output_spec = AFNICommandOutputSpec
24472450
24482451
2452+ def _format_arg (self , name , trait_spec , value ):
2453+ if name == 'in_file' :
2454+ if not isdefined (self .inputs .card ) and not isdefined (self .inputs .resp ):
2455+ return None
2456+ return super (Retroicor , self )._format_arg (name , trait_spec , value )
2457+
2458+
24492459class AFNItoNIFTIInputSpec (AFNICommandInputSpec ):
24502460 in_file = File (desc = 'input file to 3dAFNItoNIFTI' ,
24512461 argstr = '%s' ,
0 commit comments