1
1
# -*- coding: utf-8 -*-
2
2
# 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:
4
4
"""Afni preprocessing interfaces
5
5
6
6
Change directory to provide relative paths for doctests
@@ -2385,7 +2385,9 @@ class RetroicorInputSpec(AFNICommandInputSpec):
2385
2385
mandatory = True ,
2386
2386
exists = True ,
2387
2387
copyfile = False )
2388
- out_file = File (desc = 'output image file name' , argstr = '-prefix %s' , mandatory = True , position = 1 )
2388
+ out_file = File (name_template = '%s_retroicor' , name_source = ['in_file' ],
2389
+ desc = 'output image file name' ,
2390
+ argstr = '-prefix %s' , position = 1 )
2389
2391
card = File (desc = '1D cardiac data file for cardiac correction' ,
2390
2392
argstr = '-card %s' ,
2391
2393
position = - 2 ,
@@ -2439,6 +2441,7 @@ class Retroicor(AFNICommand):
2439
2441
>>> ret.inputs.in_file = 'functional.nii'
2440
2442
>>> ret.inputs.card = 'mask.1D'
2441
2443
>>> ret.inputs.resp = 'resp.1D'
2444
+ >>> ret.inputs.outputtype = 'NIFTI'
2442
2445
>>> res = ret.run() # doctest: +SKIP
2443
2446
"""
2444
2447
@@ -2447,6 +2450,13 @@ class Retroicor(AFNICommand):
2447
2450
output_spec = AFNICommandOutputSpec
2448
2451
2449
2452
2453
+ def _format_arg (self , name , trait_spec , value ):
2454
+ if name == 'in_file' :
2455
+ if not isdefined (self .inputs .card ) and not isdefined (self .inputs .resp ):
2456
+ return None
2457
+ return super (Retroicor , self )._format_arg (name , trait_spec , value )
2458
+
2459
+
2450
2460
class AFNItoNIFTIInputSpec (AFNICommandInputSpec ):
2451
2461
in_file = File (desc = 'input file to 3dAFNItoNIFTI' ,
2452
2462
argstr = '%s' ,
0 commit comments