@@ -820,16 +820,16 @@ def _format_arg(self, name, spec, value):
820
820
return super (MCFLIRT , self )._format_arg (name , spec , value )
821
821
822
822
def _list_outputs (self ):
823
- cwd = os .getcwd ()
824
823
outputs = self ._outputs ().get ()
825
824
826
825
outputs ['out_file' ] = self ._gen_outfilename ()
826
+ output_dir = os .path .dirname (outputs ['out_file' ])
827
827
828
828
if isdefined (self .inputs .stats_imgs ) and self .inputs .stats_imgs :
829
829
outputs ['variance_img' ] = self ._gen_fname (
830
- outputs ['out_file' ] + '_variance.ext' , cwd = cwd )
830
+ outputs ['out_file' ] + '_variance.ext' , cwd = output_dir )
831
831
outputs ['std_img' ] = self ._gen_fname (
832
- outputs ['out_file' ] + '_sigma.ext' , cwd = cwd )
832
+ outputs ['out_file' ] + '_sigma.ext' , cwd = output_dir )
833
833
834
834
# The mean image created if -stats option is specified ('meanvol')
835
835
# is missing the top and bottom slices. Therefore we only expose the
@@ -839,11 +839,11 @@ def _list_outputs(self):
839
839
840
840
if isdefined (self .inputs .mean_vol ) and self .inputs .mean_vol :
841
841
outputs ['mean_img' ] = self ._gen_fname (
842
- outputs ['out_file' ] + '_mean_reg.ext' , cwd = cwd )
842
+ outputs ['out_file' ] + '_mean_reg.ext' , cwd = output_dir )
843
843
844
844
if isdefined (self .inputs .save_mats ) and self .inputs .save_mats :
845
845
_ , filename = os .path .split (outputs ['out_file' ])
846
- matpathname = os .path .join (cwd , filename + '.mat' )
846
+ matpathname = os .path .join (output_dir , filename + '.mat' )
847
847
_ , _ , _ , timepoints = load (self .inputs .in_file ).shape
848
848
outputs ['mat_file' ] = []
849
849
for t in range (timepoints ):
0 commit comments