fMRIprep gives single preprocessed BOLD image for for multiple ePI runs in the same session

Hello!
I have multiple fMRI runs (L>>R phase encoding direction) per participant within the same session and single opposite phase encoding direction (R>>L) image in the fmap directory intended for “pepolar” topup method. This is the file structure in the participant’s bids directory (This participant performed only 2/4 phases of the task):

sub-pilote4/
├── anat
│ ├── sub-pilote4_mp2rage-uni_T1w.josn
│ └── sub-pilote4_mp2rage-uni_T1w.nii
├── fmap
│ ├── sub-pilote4_b1-map_LR_gre.json
│ ├── sub-pilote4_b1-map_LR_gre.nii.gz
│ ├── sub-pilote4_b1-map_RL_run-01_gre.json
│ ├── sub-pilote4_b1-map_RL_run-01_gre.nii.gz
│ ├── sub-pilote4_b1-map_RL_run-02_gre.json
│ ├── sub-pilote4_b1-map_RL_run-02_gre.nii.gz
│ ├── sub-pilote4_GRE-fieldmap-1_gre.json
│ ├── sub-pilote4_GRE-fieldmap-1_gre.nii.gz
│ ├── sub-pilote4_GRE-fieldmap-2_gre.json
│ ├── sub-pilote4_GRE-fieldmap-2_gre.nii.gz
│ ├── sub-pilote4_GRE-fieldmap-2Ph_gre.json
│ ├── sub-pilote4_GRE-fieldmap-2Ph_gre.nii.gz
│ ├── sub-pilote4_TOPUP_LR_epi.json
│ ├── sub-pilote4_TOPUP_LR_epi.nii.gz
│ ├── sub-pilote4_TOPUP_RL_epi.json
│ └── sub-pilote4_TOPUP_RL_epi.nii.gz
└── func
├── sub-pilote4_task-Interception-Phase1_bold.json
├── sub-pilote4_task-Interception-Phase1_bold.nii.gz
├── sub-pilote4_task-Interception-Phase2_bold.json
└── sub-pilote4_task-Interception-Phase2_bold.nii.gz

I’m encountering 2 problems:

  1. fmriprep is unable to apply topup even though the Intended for field in the corresponding JSON file mentions the scan names with forward slashes:
"IntendedFor": [
        "func/sub-pilote4_task-Interception-Phase1_bold.nii.gz",
        "func/sub-pilote4_task-Interception-Phase2_bold.nii.gz"
    ]

the link to the documentation mentioned in this post gives a 404 error message. I don’t know if I am missing something here?

  1. The bigger problem after manually applying topup is that for 2 EPI runs, fMRIprep is giving a single output image and removes the phase no information from the output file name. But in the single-subject workflow directory, it creates separate workflows for both the runs, and during execution as well I can see that it is running steps from workflows of each run separately. This output func directory looks like this:

    /derivatives/fmriprep-21.0.1/sub-pilote4/func/

├── sub-pilote4_task-Interception_desc-CompCorA_mask.nii.gz
├── sub-pilote4_task-Interception_desc-CompCorC_mask.nii.gz
├── sub-pilote4_task-Interception_desc-CompCorT_mask.nii.gz
├── sub-pilote4_task-Interception_desc-CompCorW_mask.nii.gz
├── sub-pilote4_task-Interception_desc-confounds_timeseries.json
├── sub-pilote4_task-Interception_desc-confounds_timeseries.tsv
├── sub-pilote4_task-Interception_from-scanner_to-T1w_mode-image_xfm.txt
├── sub-pilote4_task-Interception_from-T1w_to-scanner_mode-image_xfm.txt
├── sub-pilote4_task-Interception_space-T1w_boldref.nii.gz
├── sub-pilote4_task-Interception_space-T1w_desc-brain_mask.json
├── sub-pilote4_task-Interception_space-T1w_desc-brain_mask.nii.gz
├── sub-pilote4_task-Interception_space-T1w_desc-preproc_bold.json
└── sub-pilote4_task-Interception_space-T1w_desc-preproc_bold.nii.gz

This is the command that I’m using, and it has worked properly generating respective number of output images in the past.

singularity run -e /home/kpunjabi/containers/nipreps_fmriprep_21.0.1.sif
/work/7T/bids /work/7T/derivatives/fmriprep-21.0.1/
participant --participant-label pilote4
-w /work/7T/derivatives/fmriprep-temp
–output-spaces T1w --skull-strip-t1w skip
–topup-max-vols 10
–fd-spike-threshold 0.5 --dvars-spike-threshold 2.0 --bold2t1w-dof 9
–return-all-components --skip_bids_validation --mem-mb 50000 --omp-nthreads 10 --nthreads 12
–fs-no-reconall --fs-subjects-dir /work/7T/derivatives/freesurfer --fs-license-file /work/7T/code/license.txt

Thanks
-Khushboo

The problem is almost certainly that you do not have valid BIDS data. Your task label is Interception-Phase1/Interception-Phase2, which contains a non-alphanumeric character (hyphen).

fMRIPrep is a BIDS App and assumes that the dataset has been validated as BIDS. We bundled the validator to make it easier to diagnose problems. I do not recommend using --skip-bids-validation.

Thanks @effigies! There were indeed some discrepancies in my naming scheme when I used dcm2bids.