@@ -372,8 +372,11 @@ class NormalizeInputSpec(SPMCommandInputSpec):
372
372
jobtype = traits .Enum ('estwrite' , 'est' , 'write' ,
373
373
desc = 'one of: est, write, estwrite (opt, estwrite)' ,
374
374
usedefault = True )
375
- apply_to_files = InputMultiPath (File (exists = True ), field = 'subj.resample' ,
376
- desc = 'files to apply transformation to (opt)' , copyfile = True )
375
+ apply_to_files = InputMultiPath (traits .Either (File (exists = True ),
376
+ traits .List (File (exists = True ))),
377
+ field = 'subj.resample' ,
378
+ desc = 'files to apply transformation to (opt)' ,
379
+ copyfile = True )
377
380
parameter_file = File (field = 'subj.matname' , mandatory = True ,
378
381
xor = ['source' , 'template' ],
379
382
desc = 'normalization parameter file*_sn.mat' , copyfile = False )
@@ -486,9 +489,13 @@ def _list_outputs(self):
486
489
elif 'write' in self .inputs .jobtype :
487
490
outputs ['normalized_files' ] = []
488
491
if isdefined (self .inputs .apply_to_files ):
489
- for imgf in filename_to_list (self .inputs .apply_to_files ):
490
- outputs ['normalized_files' ].append (fname_presuffix (imgf , prefix = self .inputs .out_prefix ))
491
-
492
+ filelist = filename_to_list (self .inputs .apply_to_files )
493
+ for f in filelist :
494
+ if isinstance (f , list ):
495
+ run = [fname_presuffix (in_f , prefix = self .inputs .out_prefix ) for in_f in f ]
496
+ else :
497
+ run = [fname_presuffix (f , prefix = self .inputs .out_prefix )]
498
+ outputs ['normalized_files' ].extend (run )
492
499
if isdefined (self .inputs .source ):
493
500
outputs ['normalized_source' ] = []
494
501
for imgf in filename_to_list (self .inputs .source ):
0 commit comments