@@ -3596,31 +3596,41 @@ def _list_outputs(self):
3596
3596
else :
3597
3597
ext = prefix [ext_ind :]
3598
3598
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
+
3599
3603
outputs ['warped_source' ] = fname_presuffix (
3600
- prefix , suffix = suffix , use_ext = False ) + ext
3604
+ prefix , suffix = suffix , use_ext = False , newpath = out_dir ) + ext
3601
3605
if not self .inputs .nowarp :
3602
3606
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
3604
3609
if self .inputs .iwarp :
3605
3610
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
3607
3613
if isdefined (self .inputs .out_weight_file ):
3608
3614
outputs ['weights' ] = os .path .abspath (self .inputs .out_weight_file )
3609
3615
3610
3616
if self .inputs .plusminus :
3611
3617
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
3613
3620
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
3615
3623
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
3617
3626
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
3619
3629
return outputs
3620
3630
3621
3631
def _gen_filename (self , name ):
3622
3632
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' )
3624
3634
3625
3635
3626
3636
class QwarpPlusMinusInputSpec (QwarpInputSpec ):
0 commit comments