@@ -264,7 +264,7 @@ def _format_arg(self, name, trait_spec, value):
264
264
265
265
class SliceInputSpec (FSLCommandInputSpec ):
266
266
in_file = File (exists = True , argstr = "%s" , position = 0 , mandatory = True ,
267
- desc = "input filename" )
267
+ desc = "input filename" , copyfile = False )
268
268
out_base_name = traits .Str (argstr = "%s" , position = 1 , desc = "outputs prefix" )
269
269
270
270
@@ -311,18 +311,16 @@ def _list_outputs(self):
311
311
"""
312
312
outputs = self ._outputs ().get ()
313
313
ext = Info .output_type_to_ext (self .inputs .output_type )
314
+ suffix = '_slice_*' + ext
314
315
if isdefined (self .inputs .out_base_name ):
315
- outbase = self . inputs . out_base_name + '_slice_*'
316
- out_dir = os . getcwd ( )
316
+ fname_template = os . path . abspath (
317
+ self . inputs . out_base_name + suffix )
317
318
else :
318
- out_dir = os .path .dirname (self .inputs .in_file )
319
- in_base , _ = os .path .splitext (self .inputs .in_file )
320
- if '.gz' in self .inputs .in_file :
321
- in_base , _ = os .path .splitext (in_base )
322
-
323
- outbase = in_base + '_slice*'
324
- outputs ['out_files' ] = sorted (glob (os .path .join (out_dir ,
325
- outbase + ext )))
319
+ fname_template = fname_presuffix (self .inputs .in_file ,
320
+ suffix = suffix , use_ext = False )
321
+
322
+ outputs ['out_files' ] = sorted (glob (fname_template ))
323
+
326
324
return outputs
327
325
328
326
0 commit comments