Skip to content

Commit

Permalink
fewer confounds
Browse files Browse the repository at this point in the history
  • Loading branch information
JasperVanDenBosch committed Sep 20, 2023
1 parent 194e626 commit 635e452
Show file tree
Hide file tree
Showing 2 changed files with 110 additions and 176 deletions.
274 changes: 100 additions & 174 deletions demos/demo_fmri.ipynb

Large diffs are not rendered by default.

12 changes: 10 additions & 2 deletions src/rsatoolbox/io/fmriprep.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,9 +57,17 @@ def get_mask(self) -> NDArray:
mask_file = self.boldFile.get_mri_sibling(desc='brain', suffix='mask')
return mask_file.get_data().astype(bool)

def get_confounds(self) -> DataFrame:
def get_confounds(self, cf_names: Optional[List[str]]=None) -> DataFrame:
"""_summary_
Returns:
DataFrame: _description_
"""
cf_names = cf_names or ['global_signal', 'csf', 'white_matter',
'trans_x', 'trans_y', 'trans_z', 'rot_x', 'rot_y', 'rot_z']
confounds_file = self.boldFile.get_table_sibling(desc='confounds', suffix='timeseries')
return confounds_file.get_frame()
df = confounds_file.get_frame()
return df[cf_names]

def get_parcellation(self):
parc_file = self.boldFile.get_mri_sibling(desc='aparcaseg', suffix='dseg')
Expand Down

0 comments on commit 635e452

Please sign in to comment.