10
10
... '../../testing/data'))
11
11
>>> os.chdir(datadir)
12
12
"""
13
+
13
14
from __future__ import print_function , division , unicode_literals , absolute_import
14
15
from ..base import (TraitedSpec , CommandLineInputSpec , CommandLine ,
15
16
File , Directory , traits )
@@ -26,7 +27,7 @@ class ICA_AROMAInputSpec(CommandLineInputSpec):
26
27
in_file = File (exists = True , mandatory = True ,
27
28
argstr = '-i %s' , xor = ['feat_dir' ],
28
29
desc = 'volume to be denoised' )
29
- out_dir = Directory ('out' , mandatory = True ,
30
+ out_dir = Directory ('out' , genfile = True ,
30
31
argstr = '-o %s' ,
31
32
desc = 'output directory' )
32
33
mask = File (exists = True , argstr = '-m %s' , xor = ['feat_dir' ],
@@ -103,12 +104,20 @@ class ICA_AROMA(CommandLine):
103
104
104
105
def _list_outputs (self ):
105
106
outputs = self .output_spec ().get ()
106
- out_dir = os .path .abspath (self .inputs .out_dir )
107
- outputs ['out_dir' ] = out_dir
108
-
107
+ if isdefined (self .inputs .out_dir ):
108
+ outputs ['out_dir' ] = os .path .abspath (self .inputs .out_dir )
109
+ else :
110
+ outputs ['out_dir' ] = self ._gen_filename ('out_dir' )
111
+ out_dir = outputs ['out_dir' ]
112
+
109
113
if self .inputs .denoise_type in ('aggr' , 'both' ):
110
114
outputs ['aggr_denoised_file' ] = os .path .join (out_dir , 'denoised_func_data_aggr.nii.gz' )
111
115
if self .inputs .denoise_type in ('nonaggr' , 'both' ):
112
116
outputs ['nonaggr_denoised_file' ] = os .path .join (out_dir , 'denoised_func_data_nonaggr.nii.gz' )
113
-
114
117
return outputs
118
+
119
+ def _gen_filename (self , name ):
120
+ if name == 'out_dir' :
121
+ return os .getcwd ()
122
+
123
+
0 commit comments