@@ -3596,31 +3596,41 @@ def _list_outputs(self):
35963596 else :
35973597 ext = prefix [ext_ind :]
35983598 suffix = ''
3599+
3600+ # All outputs should be in the same directory as the prefix
3601+ out_dir = os .path .dirname (os .path .abspath (prefix ))
3602+
35993603 outputs ['warped_source' ] = fname_presuffix (
3600- prefix , suffix = suffix , use_ext = False ) + ext
3604+ prefix , suffix = suffix , use_ext = False , newpath = out_dir ) + ext
36013605 if not self .inputs .nowarp :
36023606 outputs ['source_warp' ] = fname_presuffix (
3603- prefix , suffix = '_WARP' + suffix , use_ext = False ) + ext
3607+ prefix , suffix = '_WARP' + suffix , use_ext = False ,
3608+ newpath = out_dir ) + ext
36043609 if self .inputs .iwarp :
36053610 outputs ['base_warp' ] = fname_presuffix (
3606- prefix , suffix = '_WARPINV' + suffix , use_ext = False ) + ext
3611+ prefix , suffix = '_WARPINV' + suffix , use_ext = False ,
3612+ newpath = out_dir ) + ext
36073613 if isdefined (self .inputs .out_weight_file ):
36083614 outputs ['weights' ] = os .path .abspath (self .inputs .out_weight_file )
36093615
36103616 if self .inputs .plusminus :
36113617 outputs ['warped_source' ] = fname_presuffix (
3612- prefix , suffix = '_PLUS' + suffix , use_ext = False ) + ext
3618+ prefix , suffix = '_PLUS' + suffix , use_ext = False ,
3619+ newpath = out_dir ) + ext
36133620 outputs ['warped_base' ] = fname_presuffix (
3614- prefix , suffix = '_MINUS' + suffix , use_ext = False ) + ext
3621+ prefix , suffix = '_MINUS' + suffix , use_ext = False ,
3622+ newpath = out_dir ) + ext
36153623 outputs ['source_warp' ] = fname_presuffix (
3616- prefix , suffix = '_PLUS_WARP' + suffix , use_ext = False ) + ext
3624+ prefix , suffix = '_PLUS_WARP' + suffix , use_ext = False ,
3625+ newpath = out_dir ) + ext
36173626 outputs ['base_warp' ] = fname_presuffix (
3618- prefix , suffix = '_MINUS_WARP' + suffix , use_ext = False ) + ext
3627+ prefix , suffix = '_MINUS_WARP' + suffix , use_ext = False ,
3628+ newpath = out_dir ) + ext
36193629 return outputs
36203630
36213631 def _gen_filename (self , name ):
36223632 if name == 'out_file' :
3623- return self ._gen_fname (self .inputs .source_file , suffix = '_QW' )
3633+ return self ._gen_fname (self .inputs .in_file , suffix = '_QW' )
36243634
36253635
36263636class QwarpPlusMinusInputSpec (QwarpInputSpec ):
0 commit comments