Skip to content

mask_filepath overwritten with fmriprep pipeline when defining Fmri event type #219

Description

@MarieStLaurent

Description

I attempted to instantiate a Study class to process an fmriprep dataset (4d BOLD volumes). At the moment, the mask_filepath param becomes overwritten even when I specify it manually when instantiating Fmri event types:

fmri_row: dict[str, tp.Any] = {
"type": "Fmri",
"start": 0.0,
"duration": float(n_TRs) * tr_s,
"frequency": 1.0 / tr_s,
"filepath": bold_path,
"mask_filepath": bold_path.replace("preproc_bold.", "brain_mask."),
"confounds_filepath": bold_path.replace(
f"_space-{self.space}_desc-preproc_bold.nii.gz",
"_desc-confounds_timeseries.tsv"),
"space": self.space,
"preproc": "fmriprep",
}

Specifically, *space-MNI152NLin2009cAsym_desc-brain_mask.nii.gz (which follows BIDS convention) become overwritten with **space-MNI152NLin2009cAsym_desc-preproc_mask.nii.gz, a type of file that does not exist in the dset repository (and which does not follow BIDS conventions). I have to modify the mask_filepath column manually in the study' events dataframe before passing it to the segmenter to avoid missing file errors.

Steps to reproduce

N/A

Environment

  • OS: ubunto
  • Python version: 3.12.3
  • neuralset version (pip show neuralset): 0.2.3
  • Relevant package versions: nilearn 0.14.0

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions