From fd941ffd274b932db972d698b91ecf475b9eabf9 Mon Sep 17 00:00:00 2001 From: Chris Markiewicz Date: Tue, 27 Sep 2022 11:21:35 -0400 Subject: [PATCH] Update fmriprep/interfaces/confounds.py --- fmriprep/interfaces/confounds.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/fmriprep/interfaces/confounds.py b/fmriprep/interfaces/confounds.py index 58e305835..105f48cd8 100644 --- a/fmriprep/interfaces/confounds.py +++ b/fmriprep/interfaces/confounds.py @@ -171,10 +171,10 @@ def _run_interface(self, runtime): a_orig = a_comp_cor["component"] a_new = [f"a_comp_cor_{i:02d}" for i in range(len(a_orig))] - final_components = components.rename(columns=dict(zip(c_orig, c_new))) - final_components.rename(columns=dict(zip(w_orig, w_new)), inplace=True) - final_components.rename(columns=dict(zip(a_orig, a_new)), inplace=True) - final_components.to_csv(self._results["components_file"], sep='\t', index=False) + final_components = components.rename(columns=dict(zip(c_orig, c_new))) + final_components.rename(columns=dict(zip(w_orig, w_new)), inplace=True) + final_components.rename(columns=dict(zip(a_orig, a_new)), inplace=True) + final_components.to_csv(self._results["components_file"], sep='\t', index=False) metadata.loc[c_comp_cor.index, "component"] = c_new metadata.loc[w_comp_cor.index, "component"] = w_new