Fmriprep not applying SDC with fieldmaps

Summary of what happened:

Hello,

I’m trying to preprocess multi-echo functional data. Part of what I’d like to do is apply SDC using two fieldmaps that were collected in opposite phase encoding directions (PA / AP). I’ve made sure to include all the necessary information in their .json files (e.g., “IntendedFor”, “TotalReadoutTimes”), but it doesn’t seem like fmriprep is recognizing these fieldmaps. For instance, in other posts, I’ve seen the outputs of B0 field inhomogeneity map will be estimated, which I do not get when I run my script (I also have run the script in its entire and found no SDC applied in the .html summary output). Any insight as to why this is not working would be much appreciated.

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

cmd="${SINGULARITY_CMD} \
/data /data/${DERIVS_DIR} participant \
--participant-label 001 \
-w /work/ \
-vv \
--omp-nthreads 8 --nthreads 12 --mem_mb 30000 \
--output-spaces MNI152NLin2009cAsym:res-native  \
--me-t2s-fit-method curvefit \
--fs-subjects-dir /fsdir \
--skip_bids_validation  \
--me-output-echos

Version:

23.1.4

Environment (Docker, Singularity, custom installation):

Singularity

BIDS Validated folder structure

├── anat
│   ├──sub-001_run-01_T1w.nii.gz
│   ├──sub-001_run-01_T1w.json
│   ├──sub-001_run-02_T1w.nii.gz
│   ├──sub-001_run-02_T1w.json
├── func
│   ├── sub-001_task-muskid_echo-1_bold.json
│   ├── sub-001_task-muskid_echo-2_bold.json
│   ├── sub-001_task-muskid_echo-3_bold.json
│   ├── sub-001_task-muskid_echo-1_bold.nii.gz
│   ├── sub-001_task-muskid_echo-2_bold.nii.gz
│   ├── sub-001_task-muskid_echo-3_bold.nii.gz
│   ├── sub-001_task-muskid_echo-1_sbref.nii.gz
│   ├── sub-001_task-muskid_echo-1_sbref.nii.gz
│   ├── sub-001_task-muskid_echo-2_sbref.nii.gz
│   ├── sub-001_task-muskid_echo-1_sbref.json
│   ├── sub-001_task-muskid_echo-2_sbref.json
│   ├── sub-001_task-muskid_echo-3_sbref.json
│   ├── sub-001_task-stressBase_echo-1_bold.nii.gz
│   ├── sub-001_task-stressBase_echo-2_bold.nii.gz
│   ├── sub-001_task-stressBase_echo-3_bold.nii.gz
│   ├── sub-001_task-stressBase_echo-1_bold.json
│   ├── sub-001_task-stressBase_echo-2_bold.json
│   ├── sub-001_task-stressBase_echo-3_bold.json
│   ├── sub-001_task-stressBase_echo-1_sbref.nii.gz
│   ├── sub-001_task-stressBase_echo-2_sbref.nii.gz
│   ├── sub-001_task-stressBase_echo-3_sbref.nii.gz
│   ├── sub-001_task-stressBase_echo-1_sbref.json
│   ├── sub-001_task-stressBase_echo-2_sbref.json
│   ├── sub-001_task-stressBase_echo-3_sbref.json
│   ├── sub-001_task-stress1_echo-1_bold.nii.gz
│   ├── sub-001_task-stress1_echo-2_bold.nii.gz
│   ├── sub-001_task-stress1_echo-3_bold.nii.gz
│   ├── sub-001_task-stress1_echo-1_bold.json
│   ├── sub-001_task-stress1_echo-2_bold.json
│   ├── sub-001_task-stress1_echo-3_bold.json
│   ├── sub-001_task-stress1_echo-1_sbref.nii.gz
│   ├── sub-001_task-stress1_echo-2_sbref.nii.gz
│   ├── sub-001_task-stress1_echo-3_sbref.nii.gz
│   ├── sub-001_task-stress1_echo-1_sbref.json
│   ├── sub-001_task-stress1_echo-2_sbref.json
│   ├── sub-001_task-stress1_echo-3_sbref.json
│   ├── sub-001_task-stress2_echo-1_bold.nii.gz
│   ├── sub-001_task-stress2_echo-2_bold.nii.gz
│   ├── sub-001_task-stress2_echo-3_bold.nii.gz
│   ├── sub-001_task-stress2_echo-1_bold.json
│   ├── sub-001_task-stress2_echo-2_bold.json
│   ├── sub-001_task-stress2_echo-3_bold.json
│   ├── sub-001_task-stress2_echo-1_sbref.nii.gz
│   ├── sub-001_task-stress2_echo-2_sbref.nii.gz
│   ├── sub-001_task-stress2_echo-3_sbref.nii.gz
│   ├── sub-001_task-stress2_echo-1_sbref.json
│   ├── sub-001_task-stress2_echo-2_sbref.json
│   ├── sub-001_task-stress2_echo-3_sbref.json
│   ├── sub-001_task-stress3_echo-1_bold.nii.gz
│   ├── sub-001_task-stress3_echo-2_bold.nii.gz
│   ├── sub-001_task-stress3_echo-3_bold.nii.gz
│   ├── sub-001_task-stress3_echo-1_bold.json
│   ├── sub-001_task-stress3_echo-2_bold.json
│   ├── sub-001_task-stress3_echo-3_bold.json
│   ├── sub-001_task-stress3_echo-1_sbref.nii.gz
│   ├── sub-001_task-stress3_echo-2_sbref.nii.gz
│   ├── sub-001_task-stress3_echo-3_sbref.nii.gz
│   ├── sub-001_task-stress3_echo-1_sbref.json
│   ├── sub-001_task-stress3_echo-2_sbref.json
│   ├── sub-001_task-stress3_echo-3_sbref.json
├── fmap
│   ├── sub-001_dir-AP_epi.json
│   ├── sub-001_dir-AP_epi.nii.gz
│   ├── sub-001_dir-PA_epi.json
│   ├──sub-001_dir-PA_epi.nii.gz
├── dwi
│   ├── sub-001_dwi.bval
│   ├── sub-001_dwi.bvec
│   ├── sub-001_dwi.json
│   ├── sub-001_dwi.nii.gz

.json file content:

dir-PA

{
    "Modality": "MR",
    "MagneticFieldStrength": 3,
    "ImagingFrequency": 123.260649,
    "Manufacturer": "Siemens",
    "ManufacturersModelName": "Prisma",
    "InstitutionName": "Northeastern University",
    "InstitutionalDepartmentName": "Radiology",
    "InstitutionAddress": "Columbus Ave 805,Boston,MA,US,02115",
    "DeviceSerialNumber": "166030",
    "StationName": "AWP166030",
    "BodyPartExamined": "BRAIN",
    "PatientPosition": "HFS",
    "ProcedureStepDescription": "TEAM_KathiosLopez^1036_TEAMTEAM",
    "SoftwareVersions": "syngo MR E11",
    "MRAcquisitionType": "2D",
    "SeriesDescription": "fmap_run-02_acq-4x2me3res2p4_dir-PA",
    "ProtocolName": "fmap_run-02_acq-4x2me3res2p4_dir-PA",
    "ScanningSequence": "EP",
    "SequenceVariant": "SK",
    "ScanOptions": "FS",
    "SequenceName": "epse2d1_88",
    "ImageType": [
        "ORIGINAL",
        "PRIMARY",
        "M",
        "ND",
        "MOSAIC"
    ],
    "NonlinearGradientCorrection": false,
    "SeriesNumber": 18,
    "AcquisitionTime": "15:01:13.722500",
    "AcquisitionNumber": 1,
    "SliceThickness": 2.4,
    "SpacingBetweenSlices": 2.4,
    "SAR": 0.0712541,
    "EchoTime": 0.03,
    "RepetitionTime": 8,
    "FlipAngle": 90,
    "PartialFourier": 1,
    "BaseResolution": 88,
    "ShimSetting": [
        248,
        -3367,
        -7369,
        476,
        -113,
        -158,
        -104,
        8
    ],
    "TxRefAmp": 230.827,
    "PhaseResolution": 1,
    "ReceiveCoilName": "HeadNeck_64",
    "ReceiveCoilActiveElements": "HC1-7",
    "PulseSequenceDetails": "%CustomerSeq%\\cmrr_mbep2d_se",
    "WipMemBlock": "5abe0c8d-5c62-4967-82e0-fd165a237f54||Sequence: R016 ve11c/master r/e634e98; Dec 19 2017 11:22:56 by eja",
    "RefLinesPE": 24,
    "CoilCombinationMethod": "Sum of Squares",
    "ConsistencyInfo": "N4_VE11C_LATEST_20160120",
    "MatrixCoilMode": "GRAPPA",
    "PercentPhaseFOV": 100,
    "PercentSampling": 100,
    "EchoTrainLength": 43,
    "PhaseEncodingSteps": 87,
    "AcquisitionMatrixPE": 88,
    "ReconMatrixPE": 88,
    "BandwidthPerPixelPhaseEncode": 46.382,
    "ParallelReductionFactorInPlane": 2,
    "EffectiveEchoSpacing": 0.000245001,
    "DerivedVendorReportedEchoSpacing": 0.000490002,
    "TotalReadoutTime": 0.0213151,
    "PixelBandwidth": 2585,
    "DwellTime": 2.2e-06,
    "PhaseEncodingDirection": "j",
    "SliceTiming": [
        3.99,
        0,
        4.1425,
        0.1525,
        4.2975,
        0.3075,
        4.45,
        0.46,
        4.6025,
        0.6125,
        4.7575,
        0.7675,
        4.91,
        0.92,
        5.065,
        1.075,
        5.2175,
        1.2275,
        5.37,
        1.38,
        5.525,
        1.535,
        5.6775,
        1.6875,
        5.83,
        1.84,
        5.985,
        1.995,
        6.1375,
        2.1475,
        6.2925,
        2.3025,
        6.445,
        2.455,
        6.5975,
        2.6075,
        6.7525,
        2.7625,
        6.905,
        2.915,
        7.06,
        3.07,
        7.2125,
        3.2225,
        7.365,
        3.375,
        7.52,
        3.53,
        7.6725,
        3.6825,
        7.825,
        3.835
    ],
    "ImageOrientationPatientDICOM": [
        0.999716,
        -0.00620068,
        -0.0230203,
        0.00401315,
        0.995575,
        -0.0938838
    ],
    "ImageOrientationText": "Tra>Cor(-5.4)>Sag(-1.3)",
    "InPlanePhaseEncodingDirectionDICOM": "COL",
    "BidsGuess": [
        "fmap",
        "_acq-epse2p2_dir-PA_run-18_epi"
    ],
    "ConversionSoftware": "dcm2niix",
    "ConversionSoftwareVersion": "v1.0.20240202",
    "Dcm2bidsVersion": "2.1.7",
    "IntendedFor": [
        "func/sub-001_task-stressBase_echo-1_bold.nii.gz",
        "func/sub-001_task-stressBase_echo-1_sbref.nii.gz",
        "func/sub-001_task-stressBase_echo-2_bold.nii.gz",
        "func/sub-001_task-stressBase_echo-2_sbref.nii.gz",
        "func/sub-001_task-stressBase_echo-3_bold.nii.gz",
        "func/sub-001_task-stressBase_echo-3_sbref.nii.gz",
        "func/sub-001_task-muskid_echo-1_bold.nii.gz",
        "func/sub-001_task-muskid_echo-1_sbref.nii.gz",
        "func/sub-001_task-muskid_echo-2_bold.nii.gz",
        "func/sub-001_task-muskid_echo-2_sbref.nii.gz",
        "func/sub-001_task-muskid_echo-3_bold.nii.gz",
        "func/sub-001_task-muskid_echo-3_sbref.nii.gz",
        "func/sub-001_task-stress1_echo-1_bold.nii.gz",
        "func/sub-001_task-stress1_echo-1_sbref.nii.gz",
        "func/sub-001_task-stress1_echo-2_bold.nii.gz",
        "func/sub-001_task-stress1_echo-2_sbref.nii.gz",
        "func/sub-001_task-stress1_echo-3_bold.nii.gz",
        "func/sub-001_task-stress1_echo-3_sbref.nii.gz",
        "func/sub-001_task-stress2_echo-1_bold.nii.gz",
        "func/sub-001_task-stress2_echo-1_sbref.nii.gz",
        "func/sub-001_task-stress2_echo-2_bold.nii.gz",
        "func/sub-001_task-stress2_echo-2_sbref.nii.gz",
        "func/sub-001_task-stress2_echo-3_bold.nii.gz",
        "func/sub-001_task-stress2_echo-3_sbref.nii.gz",
        "func/sub-001_task-stress3_echo-1_bold.nii.gz",
        "func/sub-001_task-stress3_echo-1_sbref.nii.gz",
        "func/sub-001_task-stress3_echo-2_bold.nii.gz",
        "func/sub-001_task-stress3_echo-2_sbref.nii.gz",
        "func/sub-001_task-stress3_echo-3_bold.nii.gz",
        "func/sub-001_task-stress3_echo-3_sbref.nii.gz"
    ]
}

dir-AP:

{
    "Modality": "MR",
    "MagneticFieldStrength": 3,
    "ImagingFrequency": 123.260649,
    "Manufacturer": "Siemens",
    "ManufacturersModelName": "Prisma",
    "InstitutionName": "Northeastern University",
    "InstitutionalDepartmentName": "Radiology",
    "InstitutionAddress": "Columbus Ave 805,Boston,MA,US,02115",
    "DeviceSerialNumber": "166030",
    "StationName": "AWP166030",
    "BodyPartExamined": "BRAIN",
    "PatientPosition": "HFS",
    "ProcedureStepDescription": "TEAM_KathiosLopez^1036_TEAMTEAM",
    "SoftwareVersions": "syngo MR E11",
    "MRAcquisitionType": "2D",
    "SeriesDescription": "fmap_run-02_acq-4x2me3res2p4_dir-AP",
    "ProtocolName": "fmap_run-02_acq-4x2me3res2p4_dir-AP",
    "ScanningSequence": "EP",
    "SequenceVariant": "SK",
    "ScanOptions": "FS",
    "SequenceName": "epse2d1_88",
    "ImageType": [
        "ORIGINAL",
        "PRIMARY",
        "M",
        "ND",
        "MOSAIC"
    ],
    "NonlinearGradientCorrection": false,
    "SeriesNumber": 17,
    "AcquisitionTime": "15:00:56.682500",
    "AcquisitionNumber": 1,
    "SliceThickness": 2.4,
    "SpacingBetweenSlices": 2.4,
    "SAR": 0.0712541,
    "EchoTime": 0.03,
    "RepetitionTime": 8,
    "FlipAngle": 90,
    "PartialFourier": 1,
    "BaseResolution": 88,
    "ShimSetting": [
        248,
        -3367,
        -7369,
        476,
        -113,
        -158,
        -104,
        8
    ],
    "TxRefAmp": 230.827,
    "PhaseResolution": 1,
    "ReceiveCoilName": "HeadNeck_64",
    "ReceiveCoilActiveElements": "HC1-7",
    "PulseSequenceDetails": "%CustomerSeq%\\cmrr_mbep2d_se",
    "WipMemBlock": "c8bdc7f0-521a-49a8-b24f-ac29f2598fb3||Sequence: R016 ve11c/master r/e634e98; Dec 19 2017 11:22:56 by eja",
    "RefLinesPE": 24,
    "CoilCombinationMethod": "Sum of Squares",
    "ConsistencyInfo": "N4_VE11C_LATEST_20160120",
    "MatrixCoilMode": "GRAPPA",
    "PercentPhaseFOV": 100,
    "PercentSampling": 100,
    "EchoTrainLength": 43,
    "PhaseEncodingSteps": 87,
    "AcquisitionMatrixPE": 88,
    "ReconMatrixPE": 88,
    "BandwidthPerPixelPhaseEncode": 46.382,
    "ParallelReductionFactorInPlane": 2,
    "EffectiveEchoSpacing": 0.000245001,
    "DerivedVendorReportedEchoSpacing": 0.000490002,
    "TotalReadoutTime": 0.0213151,
    "PixelBandwidth": 2585,
    "DwellTime": 2.2e-06,
    "PhaseEncodingDirection": "j-",
    "SliceTiming": [
        3.99,
        0,
        4.1425,
        0.1525,
        4.2975,
        0.3075,
        4.45,
        0.46,
        4.6025,
        0.6125,
        4.7575,
        0.7675,
        4.91,
        0.92,
        5.065,
        1.075,
        5.2175,
        1.2275,
        5.37,
        1.38,
        5.525,
        1.535,
        5.6775,
        1.6875,
        5.8325,
        1.8425,
        5.985,
        1.995,
        6.1375,
        2.1475,
        6.2925,
        2.3025,
        6.445,
        2.455,
        6.5975,
        2.6075,
        6.7525,
        2.7625,
        6.905,
        2.915,
        7.06,
        3.07,
        7.2125,
        3.2225,
        7.365,
        3.375,
        7.52,
        3.53,
        7.6725,
        3.6825,
        7.8275,
        3.8375
    ],
    "ImageOrientationPatientDICOM": [
        0.999716,
        -0.00620068,
        -0.0230203,
        0.00401315,
        0.995575,
        -0.0938838
    ],
    "ImageOrientationText": "Tra>Cor(-5.4)>Sag(-1.3)",
    "InPlanePhaseEncodingDirectionDICOM": "COL",
    "BidsGuess": [
        "fmap",
        "_acq-epse2p2_dir-AP_run-17_epi"
    ],
    "ConversionSoftware": "dcm2niix",
    "ConversionSoftwareVersion": "v1.0.20240202",
    "Dcm2bidsVersion": "2.1.7",
    "IntendedFor": [
        "func/sub-001_task-stressBase_echo-1_bold.nii.gz",
        "func/sub-001_task-stressBase_echo-1_sbref.nii.gz",
        "func/sub-001_task-stressBase_echo-2_bold.nii.gz",
        "func/sub-001_task-stressBase_echo-2_sbref.nii.gz",
        "func/sub-001_task-stressBase_echo-3_bold.nii.gz",
        "func/sub-001_task-stressBase_echo-3_sbref.nii.gz",
        "func/sub-001_task-muskid_echo-1_bold.nii.gz",
        "func/sub-001_task-muskid_echo-1_sbref.nii.gz",
        "func/sub-001_task-muskid_echo-2_bold.nii.gz",
        "func/sub-001_task-muskid_echo-2_sbref.nii.gz",
        "func/sub-001_task-muskid_echo-3_bold.nii.gz",
        "func/sub-001_task-muskid_echo-3_sbref.nii.gz",
        "func/sub-001_task-stress1_echo-1_bold.nii.gz",
        "func/sub-001_task-stress1_echo-1_sbref.nii.gz",
        "func/sub-001_task-stress1_echo-2_bold.nii.gz",
        "func/sub-001_task-stress1_echo-2_sbref.nii.gz",
        "func/sub-001_task-stress1_echo-3_bold.nii.gz",
        "func/sub-001_task-stress1_echo-3_sbref.nii.gz",
        "func/sub-001_task-stress2_echo-1_bold.nii.gz",
        "func/sub-001_task-stress2_echo-1_sbref.nii.gz",
        "func/sub-001_task-stress2_echo-2_bold.nii.gz",
        "func/sub-001_task-stress2_echo-2_sbref.nii.gz",
        "func/sub-001_task-stress2_echo-3_bold.nii.gz",
        "func/sub-001_task-stress2_echo-3_sbref.nii.gz",
        "func/sub-001_task-stress3_echo-1_bold.nii.gz",
        "func/sub-001_task-stress3_echo-1_sbref.nii.gz",
        "func/sub-001_task-stress3_echo-2_bold.nii.gz",
        "func/sub-001_task-stress3_echo-2_sbref.nii.gz",
        "func/sub-001_task-stress3_echo-3_bold.nii.gz",
        "func/sub-001_task-stress3_echo-3_sbref.nii.gz"
    ]
}

Hi @nickathios, and welcome to neurostars!

What does the BIDS validation report say? What happens if you remove the SBREFs from your IntendedFor fields?

Best,
Steven

Hi @Steven,

Thanks for the reply! Removing the SBREFs didn’t change the output of the preprocessing unfortunately. Here’s the output of the BIDS validation:

Making sure the input data is BIDS compliant (warnings can be ignored in most cases).
bids-validator@1.11.0
(node:2441) Warning: Closing directory handle on garbage collection
(Use `node --trace-warnings ...` to show where the warning was created)
	e[33m1: [WARN] The recommended file /README is missing. See Section 03 (Modality agnostic files) of the BIDS specification. (code: 101 - README_FILE_MISSING)e[39m

e[36m	Please visit https://neurostars.org/search?q=README_FILE_MISSING for existing conversations about this issue.e[39m

	e[33m2: [WARN] The Authors field of dataset_description.json should contain an array of fields - with one author per field. This was triggered because there are no authors, which will make DOI registration from dataset metadata impossible. (code: 113 - NO_AUTHORS)e[39m

e[36m	Please visit https://neurostars.org/search?q=NO_AUTHORS for existing conversations about this issue.e[39m

        e[34me[4mSummary:e[24me[39m                e[34me[4mAvailable Tasks:e[24me[39m        e[34me[4mAvailable Modalities:e[24me[39m 
        73 Files, 3.48GB                                MRI                   
        1 - Subject                                                           
        1 - Session                          

Hmm, I’m not sure then, sorry. Maybe it’s something to do with multiecho data?

Actually, @nickathios, can you see if this error persists in the latest version, 23.2.1? This might have been fixed in FIX: Connect EPI-to-fieldmap transform by effigies · Pull Request #3099 · nipreps/fmriprep · GitHub.

Best,
Steven

Hi @Steven, thanks again for getting back to me. I actually tried running the preprocessing with the --force-syn flag, which actually didn’t run. This led me to a similar post in which the solution was simply removing "DatasetType": "derivative" from my dataset_description.json. Fortunately, this worked for me! Thanks again for your input.

1 Like