Issues with SDC in fMRIPrep version 23.1.3

Summary of what happened:

Hello,
I recently updated to fmriprep version 23.1.3 to fix an issue I was having in 23.0.2. However, I’m now having issues with distortion correction with 23.1.3. Previously, the summary html files for a subject had a section “B0 Field Mapping”, but that section is completely gone from the new reports. I don’t have the IntendedFor field set in the jsons, but I do have B0FieldIdentifier and B0FieldSource so my understanding is that IntendedFor shouldn’t be needed or even used by fmriprep. I don’t notice an error anywhere, it just seems to be not recognizing the field maps, so I’m not sure how to fix it.
Thanks for your help!

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

singularity run --cleanenv \
    -B ${bids_data}:/input \
    -B ${bids_derivatives}:/output \
    -B ${work_dir}:/work \
    -B ${freesurfer_dir}:/freesurfer \
    -B ${freesurfer_license}:/license.txt \
    -B ${fmriprep_filter}:/fmriprep_filter.json \
    ${fmriprep_image} \
    /input /output \
    participant \
    --fs-license-file /license.txt \
    --skip_bids_validation \
    --participant-label $sub_label \
    --bids-filter-file /fmriprep_filter.json \
    --work-dir /work \
    --fs-subjects-dir /freesurfer \
    --output-spaces fsaverage MNI152NLin6Asym fsLR func T1w fsnative \
    --nprocs 16 \
    --omp-nthreads 16 \
    --cifti-output 91k \
    --me-output-echos \
    --force-bbr \
    --ignore slicetiming \
    --dummy-scans 10 \
    --fd-spike-threshold 0.2

Version:

23.1.3

Environment (Docker, Singularity, custom installation):

Singularity

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

Yes

Relevant log outputs (up to 20 lines):

First few lines of the log from 23.0.2:

230809-10:05:47,576 nipype.workflow IMPORTANT:
	 Building fMRIPrep's workflow:
           * BIDS dataset path: /input.
           * Participant list: ['002'].
           * Run identifier: 20230809-094503_940b2a4f-28d6-463f-af58-3afac5dff9ba.
           * Output spaces: fsaverage:den-164k MNI152NLin6Asym:res-native fsLR func T1w fsnative.
           * Pre-run FreeSurfer's SUBJECTS_DIR: /output/sourcedata/freesurfer.
230809-10:06:17,972 nipype.workflow INFO:
	 B0 field inhomogeneity map will be estimated with  the following 50 estimators: [<EstimatorType.PEPOLAR: 2>, <EstimatorType.PEPOLAR: 2>, <EstimatorType.PEPOLAR: 2>, <EstimatorType.PEPOLAR: 2>, <EstimatorType.PEPOLAR: 2>, <EstimatorType.PEPOLAR: 2>, <EstimatorType.PEPOLAR: 2>, <EstimatorType.PEPOLAR: 2>, <EstimatorType.PEPOLAR: 2>, <EstimatorType.PEPOLAR: 2>, <EstimatorType.PEPOLAR: 2>, <EstimatorType.PEPOLAR: 2>, <EstimatorType.PEPOLAR: 2>, <EstimatorType.PEPOLAR: 2>, <EstimatorType.PEPOLAR: 2>, <EstimatorType.PEPOLAR: 2>, <EstimatorType.PEPOLAR: 2>, <EstimatorType.PEPOLAR: 2>, <EstimatorType.PEPOLAR: 2>, <EstimatorType.PEPOLAR: 2>, <EstimatorType.PEPOLAR: 2>, <EstimatorType.PEPOLAR: 2>, <EstimatorType.PEPOLAR: 2>, <EstimatorType.PEPOLAR: 2>, <EstimatorType.PEPOLAR: 2>, <EstimatorType.PEPOLAR: 2>, <EstimatorType.PEPOLAR: 2>, <EstimatorType.PEPOLAR: 2>, <EstimatorType.PEPOLAR: 2>, <EstimatorType.PEPOLAR: 2>, <EstimatorType.PEPOLAR: 2>, <EstimatorType.PEPOLAR: 2>, <EstimatorType.PEPOLAR: 2>, <EstimatorType.PEPOLAR: 2>, <EstimatorType.PEPOLAR: 2>, <EstimatorType.PEPOLAR: 2>, <EstimatorType.PEPOLAR: 2>, <EstimatorType.PEPOLAR: 2>, <EstimatorType.PEPOLAR: 2>, <EstimatorType.PEPOLAR: 2>, <EstimatorType.PEPOLAR: 2>, <EstimatorType.PEPOLAR: 2>, <EstimatorType.PEPOLAR: 2>, <EstimatorType.PEPOLAR: 2>, <EstimatorType.PEPOLAR: 2>, <EstimatorType.PEPOLAR: 2>, <EstimatorType.PEPOLAR: 2>, <EstimatorType.PEPOLAR: 2>, <EstimatorType.PEPOLAR: 2>, <EstimatorType.PEPOLAR: 2>].
230809-10:06:18,928 nipype.workflow INFO:
	 No single-band-reference found for sub-002_ses-01_task-rest_run-02_echo-1_bold.nii.gz.

First few lines of the log from 23.1.3:

230809-10:44:24,825 nipype.workflow IMPORTANT:
	 Building fMRIPrep's workflow:
           * BIDS dataset path: /input.
           * Participant list: ['002'].
           * Run identifier: 20230809-102327_51a943ea-b8a2-478d-bbd9-20f1a75cf5c6.
           * Output spaces: fsaverage:den-164k MNI152NLin6Asym:res-native fsLR func T1w fsnative.
           * Pre-run FreeSurfer's SUBJECTS_DIR: /freesurfer.
230809-10:44:40,747 nipype.workflow INFO:
	 No single-band-reference found for sub-002_ses-01_task-rest_run-02_echo-1_bold.nii.gz.

Screenshots / relevant information:

Example fmap json:

{
    "AcquisitionMatrixPE": 88,
    "AcquisitionNumber": 1,
    "AcquisitionTime": "16:11:38.265000",
    "B0FieldIdentifer": "002_01_rest02",
    "BandwidthPerPixelPhaseEncode": 46.382,
    "BaseResolution": 88,
    "BodyPartExamined": "BRAIN",
    "CoilCombinationMethod": "Sum of Squares",
    "ConsistencyInfo": "N4_VE11C_LATEST_20160120",
    "ConversionSoftware": "dcm2niix",
    "ConversionSoftwareVersion": "v1.0.20220720",
    "DerivedVendorReportedEchoSpacing": 0.000490002,
    "DeviceSerialNumber": "167004",
    "DwellTime": 2.3e-06,
    "EchoTime": 0.0286,
    "EchoTrainLength": 32,
    "EffectiveEchoSpacing": 0.000245001,
    "FlipAngle": 70,
    "ImageComments": "SENSE1",
    "ImageOrientationPatientDICOM": [
        0.999604,
        -0.0246041,
        -0.0136261,
        0.0116896,
        0.804098,
        -0.594381
    ],
    "ImageOrientationText": "Tra>Cor(-36.5)>Sag(-1.5)",
    "ImageType": [
        "ORIGINAL",
        "PRIMARY",
        "M",
        "ND",
        "MOSAIC"
    ],
    "ImagingFrequency": 123.262,
    "InPlanePhaseEncodingDirectionDICOM": "COL",
    "IntendedFor": [],
    "MRAcquisitionType": "2D",
    "MagneticFieldStrength": 3,
    "Manufacturer": "Siemens",
    "ManufacturersModelName": "Prisma_fit",
    "MatrixCoilMode": "GRAPPA",
    "Modality": "MR",
    "NonlinearGradientCorrection": true,
    "ParallelReductionFactorInPlane": 2,
    "PartialFourier": 0.75,
    "PatientPosition": "HFS",
    "PercentPhaseFOV": 100,
    "PercentSampling": 100,
    "PhaseEncodingDirection": "j-",
    "PhaseEncodingSteps": 65,
    "PhaseResolution": 1,
    "PixelBandwidth": 2470,
    "ProcedureStepDescription": "CRANEO^FUNCIONAL",
    "ProtocolName": "RS2_AP_SE",
    "PulseSequenceDetails": "%CustomerSeq%\\cmrr_mbep2d_se",
    "ReceiveCoilActiveElements": "HC1-7;NC1",
    "ReceiveCoilName": "HeadNeck_64",
    "ReconMatrixPE": 88,
    "RefLinesPE": 24,
    "RepetitionTime": 2.92,
    "SAR": 0.124249,
    "ScanOptions": "PFP\\FS",
    "ScanningSequence": "EP",
    "SequenceName": "epse2d1_88",
    "SequenceVariant": "SK",
    "SeriesDescription": "RS2_AP_SE",
    "SeriesNumber": 18,
    "ShimSetting": [
        67,
        -11205,
        -6999,
        518,
        -17,
        -91,
        -45,
        54
    ],
    "SliceThickness": 3,
    "SliceTiming": [
        1.45,
        0,
        1.505,
        0.055,
        1.5625,
        0.1125,
        1.6175,
        0.1675,
        1.6725,
        0.2225,
        1.73,
        0.28,
        1.785,
        0.335,
        1.84,
        0.39,
        1.895,
        0.4475,
        1.9525,
        0.5025,
        2.0075,
        0.5575,
        2.0625,
        0.6125,
        2.12,
        0.67,
        2.175,
        0.725,
        2.23,
        0.78,
        2.2875,
        0.8375,
        2.3425,
        0.8925,
        2.3975,
        0.9475,
        2.4525,
        1.005,
        2.51,
        1.06,
        2.565,
        1.115,
        2.62,
        1.17,
        2.6775,
        1.2275,
        2.7325,
        1.2825,
        2.7875,
        1.3375,
        2.845,
        1.395
    ],
    "SoftwareVersions": "syngo MR E11",
    "SpacingBetweenSlices": 3,
    "StationName": "MRC35414",
    "TotalReadoutTime": 0.010535043000000001,
    "TxRefAmp": 247.336
}

Corresponding example bold json:

{
    "AcquisitionMatrixPE": 88,
    "AcquisitionNumber": 1,
    "AcquisitionTime": "16:12:11.267500",
    "B0FieldSource": "002_01_rest02",
    "BandwidthPerPixelPhaseEncode": 42.882,
    "BaseResolution": 88,
    "BodyPartExamined": "BRAIN",
    "CoilCombinationMethod": "Sum of Squares",
    "ConsistencyInfo": "N4_VE11C_LATEST_20160120",
    "ConversionSoftware": "dcm2niix",
    "ConversionSoftwareVersion": "v1.0.20220720",
    "DerivedVendorReportedEchoSpacing": 0.000529996,
    "DeviceSerialNumber": "167004",
    "DwellTime": 2.3e-06,
    "EchoNumber": 1,
    "EchoTime": 0.0106,
    "EchoTrainLength": 32,
    "EffectiveEchoSpacing": 0.000264998,
    "FlipAngle": 70,
    "ImageComments": "Unaliased MB4/PE4/LB SENSE1",
    "ImageOrientationPatientDICOM": [
        0.999604,
        -0.0246041,
        -0.0136261,
        0.0116896,
        0.804098,
        -0.594381
    ],
    "ImageOrientationText": "Tra>Cor(-36.5)>Sag(-1.5)",
    "ImageType": [
        "ORIGINAL",
        "PRIMARY",
        "M",
        "MB",
        "TE1",
        "ND",
        "MOSAIC"
    ],
    "ImagingFrequency": 123.262,
    "InPlanePhaseEncodingDirectionDICOM": "COL",
    "MRAcquisitionType": "2D",
    "MagneticFieldStrength": 3,
    "Manufacturer": "Siemens",
    "ManufacturersModelName": "Prisma_fit",
    "MatrixCoilMode": "GRAPPA",
    "Modality": "MR",
    "MultibandAccelerationFactor": 4,
    "NonlinearGradientCorrection": true,
    "ParallelReductionFactorInPlane": 2,
    "PartialFourier": 0.75,
    "PatientPosition": "HFS",
    "PercentPhaseFOV": 100,
    "PercentSampling": 100,
    "PhaseEncodingDirection": "j-",
    "PhaseEncodingSteps": 65,
    "PhaseResolution": 1,
    "PixelBandwidth": 2470,
    "ProcedureStepDescription": "CRANEO^FUNCIONAL",
    "ProtocolName": "RS2",
    "PulseSequenceDetails": "%CustomerSeq%\\cmrr_mbep2d_bold",
    "ReceiveCoilActiveElements": "HC1-7;NC1",
    "ReceiveCoilName": "HeadNeck_64",
    "ReconMatrixPE": 88,
    "RefLinesPE": 16,
    "RepetitionTime": 1.5,
    "SAR": 0.079801,
    "ScanOptions": "PFP\\FS",
    "ScanningSequence": "EP",
    "SequenceName": "epfid2d5_88",
    "SequenceVariant": "SK\\SS",
    "SeriesDescription": "RS2",
    "SeriesNumber": 21,
    "ShimSetting": [
        67,
        -11205,
        -6999,
        518,
        -17,
        -91,
        -45,
        54
    ],
    "SliceThickness": 3,
    "SliceTiming": [
        0,
        0.7975,
        0.115,
        0.9125,
        0.23,
        1.025,
        0.3425,
        1.14,
        0.4575,
        1.2525,
        0.57,
        1.3675,
        0.685,
        0,
        0.7975,
        0.115,
        0.9125,
        0.23,
        1.025,
        0.3425,
        1.14,
        0.4575,
        1.2525,
        0.57,
        1.3675,
        0.685,
        0,
        0.7975,
        0.115,
        0.9125,
        0.23,
        1.025,
        0.3425,
        1.14,
        0.4575,
        1.2525,
        0.57,
        1.3675,
        0.685,
        0,
        0.7975,
        0.115,
        0.9125,
        0.23,
        1.025,
        0.3425,
        1.14,
        0.4575,
        1.2525,
        0.57,
        1.3675,
        0.685
    ],
    "SoftwareVersions": "syngo MR E11",
    "SpacingBetweenSlices": 3,
    "StationName": "MRC35414",
    "TaskName": "Rest",
    "TotalReadoutTime": 0.011394914,
    "TxRefAmp": 247.336
}

Hi @rmiller, and welcome to neurostars!

Thanks for the detailed report! I can’t immediately see a problem here, but can you try the following?

  1. Add "B0FieldIdentifier": : "002_01_rest02", to your BOLD json
  2. Make sure your BIDS filter file isn’t ignore fmaps
  3. If 1+2 do not work, just use IntendedFor instead, e.g., add
"IntendedFor": ["ses-01/func/ub-002_ses-01_task-rest_run-02_echo-1_bold.nii.gz"]

to the fmap json (adding other BOLD files in the list as needed).

Best,
Steven

Hi @Steven, thanks for your response and sorry for the delay.

I was able to solve the issue. I tried your suggestion of adding the "B0FieldIdentifier" field to the BOLD json (it gives me an error about not supporting complex PEPOLAR schemes), but this made me notice that somehow I had introduced a typo into my FM jsons at some point. The two versions of fmriprep were handling the error differently, which is why I didn’t catch it at first.

I now have both "B0FieldIdentifier" and "B0FieldSource" set correctly in my image jsons and everything seems to be working.

Thanks again for your help and sorry for the silly error!
Ry