Error: 'Sophisticated PEPOLAR schemes are unsupported' in fMRIPrep when populating IntendedFor field

Summary of what happened:

Hello everyone,

I’m running into an error when attempting to process certain sessions through fMRIPrep (version 24.1.0) using Singularity.

I run sessions individually using filter files. Interestingly, these sessions ran through fMRIPrep successfully before I tried populating the IntendedFor field in the fmap files. Here’s what I’m doing:

  • I am populating the IntendedFor field by listing all functional files for the session in the field. However, I’m unsure if this is the correct approach.
  • I notice that the sessions that run correctly have the IntendedFor field populated as shown below (with the subject ID and task names anonymized):
"IntendedFor": [
    "ses-V4/func/sub-XXXX20_ses-V4_task-A_dir-AP_bold.nii.gz",
    "ses-V4/func/sub-XXXX20_ses-V4_task-A_dir-AP_sbref.nii.gz",
    "ses-V4/func/sub-XXXX20_ses-V4_task-A_dir-PA_bold.nii.gz",
    "ses-V4/func/sub-XXXX20_ses-V4_task-A_dir-PA_sbref.nii.gz",
    "ses-V4/func/sub-XXXX20_ses-V4_task-B_dir-PA_bold.nii.gz",
    "ses-V4/func/sub-XXXX20_ses-V4_task-C_dir-AP_run-01_bold.nii.gz",
    "ses-V4/func/sub-XXXX20_ses-V4_task-C_dir-AP_run-01_sbref.nii.gz",
    "ses-V4/func/sub-XXXX20_ses-V4_task-C_dir-AP_run-02_bold.nii.gz",
    "ses-V4/func/sub-XXXX20_ses-V4_task-C_dir-AP_run-02_sbref.nii.gz",
    "ses-V4/func/sub-XXXX20_ses-V4_task-C_dir-PA_run-01_bold.nii.gz",
    "ses-V4/func/sub-XXXX20_ses-V4_task-C_dir-PA_run-01_sbref.nii.gz",
    "ses-V4/func/sub-XXXX20_ses-V4_task-C_dir-PA_run-02_bold.nii.gz",
    "ses-V4/func/sub-XXXX20_ses-V4_task-C_dir-PA_run-02_sbref.nii.gz"
]

The key file in this setup is:

ses-V4/func/sub-XXXX20_ses-V4_task-B_dir-PA_bold.nii.gz

For the sessions that are throwing errors, they either have a run-01 and run-02 version of this file, or they do not have this file at all.

Can anyone shed light on what might be going wrong or what adjustments I need to make to the IntendedFor field? Is this field being populated correctly, and could this be causing the issue? I would appreciate any insights on resolving the error!

I’m happy to provide additional information if needed. Thank you in advance!

Command used (and if a helper script was used, a link to the helper script or the command generated):

singularity run --cleanenv \
    -B <filepaths> \
    $fmriprep \
    ${bidsD} ${derD} participant \
    --participant-label sub-${subject} \
    --output-spaces fsaverage fsnative T1w MNI152NLin2009cAsym \
    --longitudinal \
    --work-dir ${workD} \
    --cifti-output \
    --dummy-scans 3 \
    --fs-license-file ${fsLicense} \
    --ignore slicetiming \
    --md-only-boilerplate \
    --mem_mb 30000 \
    --bids-filter-file ${filterFile} \
    --fs-subjects-dir ${derD}/freesufer

Version:

24.1.0

Environment (Docker, Singularity / Apptainer, custom installation):

Singularity

Data formatted according to a validatable standard? Please provide the output of the validator:

bids-validator@1.8.1-dev.0

1: [ERR] The number of volumes in this scan does not match the number of volumes in the corresponding .bvec and .bval files. (code: 29 - VOLUME_COUNT_MISMATCH)  
		./sub-XXXX08/ses-V1/dwi/sub-XXXX08_ses-V1_acq-dir99_dir-PA_run-01_dwi.nii.gz  
		./sub-XXXX34/ses-V2/dwi/sub-XXXX34_ses-V2_acq-dir99_dir-PA_run-01_dwi.nii.gz  

	Please visit https://neurostars.org/search?q=VOLUME_COUNT_MISMATCH for existing conversations about this issue.

2: [ERR] You have to define 'TaskName' for this file. (code: 50 - TASK_NAME_MUST_DEFINE)  
		./sub-XXXX02/ses-V1/func/sub-XXXX02_ses-V1_task-A_dir-AP_run-01_bold.nii.gz  
		./sub-XXXX02/ses-V1/func/sub-XXXX02_ses-V1_task-A_dir-AP_run-02_bold.nii.gz  
		./sub-XXXX02/ses-V1/func/sub-XXXX02_ses-V1_task-A_dir-AP_run-03_bold.nii.gz  
		./sub-XXXX02/ses-V1/func/sub-XXXX02_ses-V1_task-A_dir-AP_run-04_bold.nii  
		./sub-XXXX02/ses-V1/func/sub-XXXX02_ses-V1_task-A_dir-PA_run-01_bold.nii.gz  
		./sub-XXXX02/ses-V1/func/sub-XXXX02_ses-V1_task-A_dir-PA_run-02_bold.nii.gz  
		./sub-XXXX02/ses-V1/func/sub-XXXX02_ses-V1_task-A_dir-PA_run-03_bold.nii.gz  
		./sub-XXXX02/ses-V1/func/sub-XXXX02_ses-V1_task-B_dir-PA_run-01_bold.nii.gz  
		./sub-XXXX02/ses-V1/func/sub-XXXX02_ses-V1_task-B_dir-PA_run-02_bold.nii.gz  
		./sub-XXXX02/ses-V1/func/sub-XXXX02_ses-V1_task-C_dir-AP_run-01_bold.nii.gz  
		... and 826 more files having this issue (Use --verbose to see them all).  

	Please visit https://neurostars.org/search?q=TASK_NAME_MUST_DEFINE for existing conversations about this issue.

3: [ERR] A stimulus file was declared but not found in the dataset. (code: 52 - STIMULUS_FILE_MISSING)  
		./sub-XXXX16/ses-V1/func/sub-XXXX16_ses-V1_task-A_dir-AP_events.tsv  
			@ line: 2 character: 3  
			Evidence: red_arrow.jpg  
		./sub-XXXX16/ses-V1/func/sub-XXXX16_ses-V1_task-A_dir-AP_events.tsv  
			@ line: 5 character: 3  
			Evidence: green_arrow.jpg  
		./sub-XXXX16/ses-V1/func/sub-XXXX16_ses-V1_task-A_dir-AP_events.tsv  
			@ line: 18 character: 3  
			Evidence: grey_doublearrow.jpg  
		./sub-XXXX16/ses-V2/func/sub-XXXX16_ses-V2_task-A_dir-AP_events.tsv  
			@ line: 2 character: 3  
			Evidence: red_arrow.jpg  
		./sub-XXXX16/ses-V2/func/sub-XXXX16_ses-V2_task-A_dir-AP_events.tsv  
			@ line: 5 character: 3  
			Evidence: green_arrow.jpg  
		./sub-XXXX16/ses-V2/func/sub-XXXX16_ses-V2_task-A_dir-AP_events.tsv  
			@ line: 18 character: 3  
			Evidence: grey_doublearrow.jpg  
		./sub-XXXX16/ses-V3/func/sub-XXXX16_ses-V3_task-A_dir-AP_events.tsv  
			@ line: 2 character: 3  
			Evidence: green_arrow.jpg  
		./sub-XXXX16/ses-V3/func/sub-XXXX16_ses-V3_task-A_dir-AP_events.tsv  
			@ line: 4 character: 3  
			Evidence: red_arrow.jpg  
		./sub-XXXX16/ses-V3/func/sub-XXXX16_ses-V3_task-A_dir-AP_events.tsv  
			@ line: 8 character: 3  
			Evidence: grey_doublearrow.jpg  

	Please visit https://neurostars.org/search?q=STIMULUS_FILE_MISSING for existing conversations about this issue.

4: [ERR] Bold scans must be 4 dimensional. (code: 54 - BOLD_NOT_4D)  
		./sub-XXXX39/ses-V2/func/sub-XXXX39_ses-V2_task-C_dir-AP_run-02_bold.nii.gz  
			Evidence: header field "dim" = 3,104,104,72  
		./sub-XXXX41/ses-V3/func/sub-XXXX41_ses-V3_task-A_dir-AP_bold.nii.gz  
			Evidence: header field "dim" = 3,104,104,72  

	Please visit https://neurostars.org/search?q=BOLD_NOT_4D for existing conversations about this issue.

5: [ERR] NIfTI file's header is missing time dimension information. (code: 75 - NIFTI_PIXDIM4)  
		./sub-XXXX39/ses-V2/func/sub-XXXX39_ses-V2_task-C_dir-AP_run-02_bold.nii.gz  
		./sub-XXXX41/ses-V3/func/sub-XXXX41_ses-V3_task-A_dir-AP_bold.nii.gz  

	Please visit https://neurostars.org/search?q=NIFTI_PIXDIM4 for existing conversations about this issue.

1: [WARN] Task scans should have a corresponding events.tsv file. If this is a resting state scan you can ignore this warning or rename the task to include the word "rest". (code: 25 - EVENTS_TSV_MISSING)  
		./sub-XXXX02/ses-V1/func/sub-XXXX02_ses-V1_task-A_dir-AP_run-01_bold.nii.gz  
		./sub-XXXX02/ses-V1/func/sub-XXXX02_ses-V1_task-A_dir-AP_run-02_bold.nii.gz  
		./sub-XXXX02/ses-V1/func/sub-XXXX02_ses-V1_task-A_dir-AP_run-03_bold.nii.gz  
		./sub-XXXX02/ses-V1/func/sub-XXXX02_ses-V1_task-A_dir-PA_run-01_bold.nii.gz  
		./sub-XXXX02/ses-V1/func/sub-XXXX02_ses-V1_task-A_dir-PA_run-02_bold.nii.gz  
		./sub-XXXX02/ses-V1/func/sub-XXXX02_ses-V1_task-A_dir-PA_run-03_bold.nii.gz  
		./sub-XXXX02/ses-V1/func/sub-XXXX02_ses-V1_task-B_dir-PA_run-01_bold.nii.gz  
		./sub-XXXX02/ses-V1/func/sub-XXXX02_ses-V1_task-B_dir-PA_run-02_bold.nii.gz  
		./sub-XXXX02/ses-V2/func/sub-XXXX02_ses-V2_task-A_dir-AP_bold.nii.gz  
		... and 332 more files having this issue (Use --verbose to see them all).  

	Please visit https://neurostars.org/search?q=EVENTS_TSV_MISSING for existing conversations about this issue.

2: [WARN] Not all subjects contain the same files. Each subject should contain the same number of files with the same naming unless some files are known to be missing. (code: 38 - INCONSISTENT_SUBJECTS)  
		./sub-XXXX02/ses-V1/dwi/sub-XXXX02_ses-V1_acq-dir98_dir-AP_dwi.bval  
			Evidence: Subject: sub-XXXX02; Missing file: sub-XXXX02_ses-V1_acq-dir98_dir-AP_dwi.bval  
		./sub-XXXX02/ses-V1/dwi/sub-XXXX02_ses-V1_acq-dir98_dir-AP_dwi.bvec  
			Evidence: Subject: sub-XXXX02; Missing file: sub-XXXX02_ses-V1_acq-dir98_dir-AP_dwi.bvec  
		./sub-XXXX02/ses-V1/dwi/sub-XXXX02_ses-V1_acq-dir98_dir-AP_dwi.json  
			Evidence: Subject: sub-XXXX02; Missing file: sub-XXXX02_ses-V1_acq-dir98_dir-AP_dwi.json  
		./sub-XXXX02/ses-V1/dwi/sub-XXXX02_s

es-V1_acq-dir99_dir-AP_dwi.bval  
			Evidence: Subject: sub-XXXX02; Missing file: sub-XXXX02_ses-V1_acq-dir99_dir-AP_dwi.bval  
		./sub-XXXX02/ses-V1/dwi/sub-XXXX02_ses-V1_acq-dir99_dir-AP_dwi.bvec  
			Evidence: Subject: sub-XXXX02; Missing file: sub-XXXX02_ses-V1_acq-dir99_dir-AP_dwi.bvec  

	Please visit https://neurostars.org/search?q=INCONSISTENT_SUBJECTS for existing conversations about this issue.

Relevant log outputs (up to 20 lines):

"Sophisticated PEPOLAR schemes are unsupported."

Screenshots / relevant information:

Types of fieldmap and the tree directory structure output for a failing subject. ses-V2 failed, the other sessions worked.

./ses-V1/fmap
./ses-V1/fmap/sub-XXXX20_ses-V1_acq-D_dir-AP_epi.json
./ses-V1/fmap/sub-XXXX20_ses-V1_acq-D_dir-AP_epi.nii.gz
./ses-V1/fmap/sub-XXXX20_ses-V1_acq-D_dir-PA_epi.json
./ses-V1/fmap/sub-XXXX20_ses-V1_acq-D_dir-PA_epi.nii.gz
./ses-V1/fmap/sub-XXXX20_ses-V1_acq-func_dir-AP_run-01_epi.json
./ses-V1/fmap/sub-XXXX20_ses-V1_acq-func_dir-AP_run-01_epi.nii.gz
./ses-V1/fmap/sub-XXXX20_ses-V1_acq-func_dir-AP_run-02_epi.json
./ses-V1/fmap/sub-XXXX20_ses-V1_acq-func_dir-AP_run-02_epi.nii.gz
./ses-V1/fmap/sub-XXXX20_ses-V1_acq-func_dir-PA_run-01_epi.json
./ses-V1/fmap/sub-XXXX20_ses-V1_acq-func_dir-PA_run-01_epi.nii.gz
./ses-V1/fmap/sub-XXXX20_ses-V1_acq-func_dir-PA_run-02_epi.json
./ses-V1/fmap/sub-XXXX20_ses-V1_acq-func_dir-PA_run-02_epi.nii.gz
./ses-V2/fmap
./ses-V2/fmap/sub-XXXX20_ses-V2_acq-D_dir-AP_run-01_epi.json
./ses-V2/fmap/sub-XXXX20_ses-V2_acq-D_dir-AP_run-01_epi.nii.gz
./ses-V2/fmap/sub-XXXX20_ses-V2_acq-D_dir-AP_run-02_epi.json
./ses-V2/fmap/sub-XXXX20_ses-V2_acq-D_dir-AP_run-02_epi.nii.gz
./ses-V2/fmap/sub-XXXX20_ses-V2_acq-D_dir-PA_run-01_epi.json
./ses-V2/fmap/sub-XXXX20_ses-V2_acq-D_dir-PA_run-01_epi.nii.gz
./ses-V2/fmap/sub-XXXX20_ses-V2_acq-D_dir-PA_run-02_epi.json
./ses-V2/fmap/sub-XXXX20_ses-V2_acq-D_dir-PA_run-02_epi.nii.gz
./ses-V2/fmap/sub-XXXX20_ses-V2_acq-func_dir-AP_run-01_epi.json
./ses-V2/fmap/sub-XXXX20_ses-V2_acq-func_dir-AP_run-01_epi.nii.gz
./ses-V2/fmap/sub-XXXX20_ses-V2_acq-func_dir-AP_run-02_epi.json
./ses-V2/fmap/sub-XXXX20_ses-V2_acq-func_dir-AP_run-02_epi.nii.gz
./ses-V2/fmap/sub-XXXX20_ses-V2_acq-func_dir-PA_run-01_epi.json
./ses-V2/fmap/sub-XXXX20_ses-V2_acq-func_dir-PA_run-01_epi.nii.gz
./ses-V2/fmap/sub-XXXX20_ses-V2_acq-func_dir-PA_run-02_epi.json
./ses-V2/fmap/sub-XXXX20_ses-V2_acq-func_dir-PA_run-02_epi.nii.gz
./ses-V3/fmap
./ses-V3/fmap/sub-XXXX20_ses-V3_acq-D_dir-AP_epi.json
./ses-V3/fmap/sub-XXXX20_ses-V3_acq-D_dir-AP_epi.nii.gz
./ses-V3/fmap/sub-XXXX20_ses-V3_acq-D_dir-PA_epi.json
./ses-V3/fmap/sub-XXXX20_ses-V3_acq-D_dir-PA_epi.nii.gz
./ses-V3/fmap/sub-XXXX20_ses-V3_acq-func_dir-AP_run-01_epi.json
./ses-V3/fmap/sub-XXXX20_ses-V3_acq-func_dir-AP_run-01_epi.nii.gz
./ses-V3/fmap/sub-XXXX20_ses-V3_acq-func_dir-AP_run-02_epi.json
./ses-V3/fmap/sub-XXXX20_ses-V3_acq-func_dir-AP_run-02_epi.nii.gz
./ses-V3/fmap/sub-XXXX20_ses-V3_acq-func_dir-PA_run-01_epi.json
./ses-V3/fmap/sub-XXXX20_ses-V3_acq-func_dir-PA_run-01_epi.nii.gz
./ses-V3/fmap/sub-XXXX20_ses-V3_acq-func_dir-PA_run-02_epi.json
./ses-V3/fmap/sub-XXXX20_ses-V3_acq-func_dir-PA_run-02_epi.nii.gz
./ses-V4/fmap
./ses-V4/fmap/sub-XXXX20_ses-V4_acq-D_dir-AP_epi.json
./ses-V4/fmap/sub-XXXX20_ses-V4_acq-D_dir-AP_epi.nii.gz
./ses-V4/fmap/sub-XXXX20_ses-V4_acq-D_dir-PA_epi.json
./ses-V4/fmap/sub-XXXX20_ses-V4_acq-D_dir-PA_epi.nii.gz
./ses-V4/fmap/sub-XXXX20_ses-V4_acq-func_dir-AP_run-01_epi.json
./ses-V4/fmap/sub-XXXX20_ses-V4_acq-func_dir-AP_run-01_epi.nii.gz
./ses-V4/fmap/sub-XXXX20_ses-V4_acq-func_dir-AP_run-02_epi.json
./ses-V4/fmap/sub-XXXX20_ses-V4_acq-func_dir-AP_run-02_epi.nii.gz
./ses-V4/fmap/sub-XXXX20_ses-V4_acq-func_dir-PA_run-01_epi.json
./ses-V4/fmap/sub-XXXX20_ses-V4_acq-func_dir-PA_run-01_epi.nii.gz
./ses-V4/fmap/sub-XXXX20_ses-V4_acq-func_dir-PA_run-02_epi.json
./ses-V4/fmap/sub-XXXX20_ses-V4_acq-func_dir-PA_run-02_epi.nii.gz

Let me know if you need further adjustments!


Hi @swwalsh1,
In the future, please use the software support post template, you can see I added it back in for you and edited your post this time. More info would help us debug, some of which is prompted by the post template:

  1. Command you used.
  2. Types of fieldmap and the tree directory structure output for a failing subject.
  3. BIDS validator output.

You can also try using the B0FieldIdentifier/B0FieldSource method if that is easier for you to understand.

Best,
Steven

Hi @swwalsh1,

Thanks for the extra info. I would start by correcting the BIDS validation errors, at the very least errors 2, 4 and 5 are relevant for fmriprep.

It looks like you have two BOLD-correcting fieldmap pairs per session for this subject. Each BOLD image should only have one AP/PA pair associated with it. If you are putting all BOLDs into each IntendedFor that could explain the error. Additionally, the IntendedFor only needs to link to the BOLD, not sbref as well.

Best,
Steven

Thank you, Steven! I just want to make sure I’m understanding correctly: should the IntendedFor field have just two files: one AP BOLD, and one PA BOLD?

Thanks,
Shane

It has as many BOLDS as you want so apply the fmap to. I don’t know enough about your study to know what pairings make sense. But two fmaps of the same kind (eg, two pepolar pairs) cannot be applied to the same BOLD.