@@ -78,6 +78,7 @@ def __init__(
78
78
if output_spec is None :
79
79
output_spec = self ._prepare_output_spec ()
80
80
self .output_spec = output_spec
81
+ self .bindings = []
81
82
82
83
super (BoshTask , self ).__init__ (
83
84
name = name ,
@@ -146,15 +147,20 @@ def _prepare_output_spec(self):
146
147
"help_string" : output ["description" ],
147
148
"mandatory" : not output ["optional" ],
148
149
}
149
- fields .append ((name , File , mdata ))
150
+ # TODO NOW: temp. default value
151
+ fields .append (
152
+ (name , attr .ib (type = File , default = "test_brain.nii.gz" , metadata = mdata ))
153
+ )
150
154
151
155
spec = SpecInfo (name = "Outputs" , fields = fields , bases = (ShellOutSpec ,))
152
156
return spec
153
157
154
158
def _command_args_single (self , state_ind , ind = None ):
155
159
"""Get command line arguments for a single state"""
156
160
input_filepath = self ._input_file (state_ind = state_ind , ind = ind )
157
- cmd_list = self .inputs .executable + [input_filepath ] + self .inputs .args
161
+ cmd_list = (
162
+ self .inputs .executable + [input_filepath ] + self .inputs .args + self .bindings
163
+ )
158
164
return cmd_list
159
165
160
166
def _input_file (self , state_ind , ind = None ):
@@ -166,10 +172,12 @@ def _input_file(self, state_ind, ind=None):
166
172
value = getattr (self .inputs , f .name )[state_ind [f"{ self .name } .{ f .name } " ]]
167
173
else :
168
174
value = getattr (self .inputs , f .name )
169
- if is_local_file (f ):
170
- value = str (value )
171
175
# adding to the json file if specified by the user
172
176
if value is not attr .NOTHING and value != "NOTHING" :
177
+ if is_local_file (f ):
178
+ self .bindings .extend (["-v" , f"{ value .parent } :{ value .parent } :ro" ])
179
+ value = str (value )
180
+
173
181
input_json [f .name ] = value
174
182
175
183
filename = self .cache_dir / f"{ self .name } -{ ind } .json"
0 commit comments