Skip to content

Commit

Permalink
[FIX] Update load_aroma so the correct file is being read in (#599)
Browse files Browse the repository at this point in the history
  • Loading branch information
kahinimehta authored Oct 20, 2022
1 parent 9000864 commit 46c71f7
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 7 deletions.
3 changes: 1 addition & 2 deletions xcp_d/interfaces/regression.py
Original file line number Diff line number Diff line change
Expand Up @@ -73,18 +73,17 @@ def _run_interface(self, runtime):
if self.inputs.custom_confounds and exists(self.inputs.custom_confounds):
confound = load_confound_matrix(
original_file=self.inputs.original_file,
datafile=self.inputs.in_file,
custom_confounds=self.inputs.custom_confounds,
confound_tsv=self.inputs.confounds,
params=self.inputs.params,
)
else: # No custom confounds
confound = load_confound_matrix(
original_file=self.inputs.original_file,
datafile=self.inputs.in_file,
confound_tsv=self.inputs.confounds,
params=self.inputs.params,
)

# for testing, let's write out the confounds file:
confounds_file_output_name = fname_presuffix(
self.inputs.confounds,
Expand Down
8 changes: 3 additions & 5 deletions xcp_d/utils/confounds.py
Original file line number Diff line number Diff line change
Expand Up @@ -300,14 +300,12 @@ def square_confound(confound):

@fill_doc
def load_confound_matrix(
datafile, original_file, params, custom_confounds=None, confound_tsv=None
original_file, params, custom_confounds=None, confound_tsv=None
):
"""Load a subset of the confounds associated with a given file.
Parameters
----------
datafile : str
BOLD file whose confounds we want.
original_file :
File used to find confounds json.
%(params)s
Expand Down Expand Up @@ -386,13 +384,13 @@ def load_confound_matrix(
confound = pd.concat([derivative_rot_trans, acompcor, cosine], axis=1)
elif params == "aroma": # Get the WM, CSF, and aroma values
whitematter_csf = load_wm_csf(confoundtsv)
aroma = load_aroma(datafile=datafile)
aroma = load_aroma(datafile=original_file)
confound = pd.concat([whitematter_csf, aroma], axis=1)
elif (
params == "aroma_gsr"
): # Get the WM, CSF, and aroma values, as well as global signal
whitematter_csf = load_wm_csf(confoundtsv)
aroma = load_aroma(datafile=datafile)
aroma = load_aroma(datafile=original_file)
global_signal = load_global_signal(confoundtsv)
confound = pd.concat([whitematter_csf, aroma, global_signal], axis=1)
elif (
Expand Down

0 comments on commit 46c71f7

Please sign in to comment.