fMRIPrep Susceptibility distortion correction: No output

Summary of what happened:

I am using fMRIPrep-23.1.3, I am running into the problem of not having an output of fmap correction.
After reading to through similar topics, I have made sure that I have IntendedFor in the fmap jsons. I don’t run into BIDS compatibility errors. It is to note that I have fmaps acquired on two days.

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

#!/bin/bash
# Load fMRIPrep environment (assuming it's installed via a module)
ml StdEnv/2020
module load fmriprep/23.1.3
export REQUESTS_CA_BUNDLE="/opt/conda/envs/fmriprep/lib/python3.10/site-packages/certifi/cacert.pem"
export TEMPLATEFLOW_HOME="/panfs/accrepfs.vampire/data/booth_lab/LTS_Data/preproc_fMRIprep/templateflow"


WORK_DIR="/panfs/accrepfs.vampire/data/booth_lab/LTS_Data/preproc_fMRIprep/fmriprep_logs"

# Define variables
BIDS_DIR="/panfs/accrepfs.vampire/data/booth_lab/LTS_Data/preproc_fMRIprep/data"     # Path to your BIDS formatted dataset
OUTPUT_DIR="/panfs/accrepfs.vampire/data/booth_lab/LTS_Data/preproc_fMRIprep/data/derivatives"          # Path to output directory
#SUBJECT_ID="$1"                   # Change subject ID as needed
SUBJECT_ID="sub-6103"
FS_LICENSE="/panfs/accrepfs.vampire/data/booth_lab/LTS_Data/preproc_fMRIprep/data/derivatives/license.txt"  # FreeSurfer license file path



# Run fMRIPrep
fmriprep "${BIDS_DIR}" "${OUTPUT_DIR}" \
  participant \
  --participant-label "${SUBJECT_ID}" \
  --fs-license-file "${FS_LICENSE}" \
  --fs-no-reconall \
  --output-spaces  MNIInfant:cohort-11:res-2\
  --ignore slicetiming \
  --work-dir "${WORK_DIR}" \
  --nthreads 8 \
  --mem_mb 64000 \
  --low-mem \
  --verbose

# Check for errors
if [ $? -ne 0 ]; then
  echo "fMRIPrep encountered an error for subject ${SUBJECT_ID}. Check output for details."
  exit 1
fi

echo "fMRIPrep successfully completed for subject ${SUBJECT_ID}."

Version:

23.1.3

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

HPC system module

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

PASTE VALIDATOR OUTPUT HERE

Relevant log outputs (up to 20 lines):

PASTE LOG OUTPUT HERE

Screenshots / relevant information:

Data folder structure for one subject


Hi @Avantika_Mathur, and welcome to neurostars!

In the future please fill out the remainder of the Software Support post template, and provide text instead of screenshots of code when possible.

Does this persist in the most recent version? I would suggest to use apptainer/docker containers.

Do you also have B0FieldIdentifier / B0FieldSource defined in your jsons? If so, that overrides IntendedFor even if the B0* fields are defined incorrectly.

What are the contents of your dataset_description.json?

Best,
Steven

I can try using the latest version, and see if the error persists. We have the software installed over our HPC system (see below), so I could load the 25.1.1 version.
No I don’t have B0FieldIdentifier / B0FieldSource in the jsons.

[mathura@cn1482 ~]$ module spider fmriprep

----------------------------------------------------------------------------
  fmriprep:
----------------------------------------------------------------------------
    Description:
      fMRIPrep is a NiPreps (NeuroImaging PREProcessing toolS) application
      (www.nipreps.org) for the preprocessing of task-based and
      resting-state functional MRI (fMRI). 

     Versions:
        fmriprep/23.0.2
        fmriprep/23.1.3
        fmriprep/25.1.1

----------------------------------------------------------------------------
  For detailed information about a specific "fmriprep" package (including how to load the modules) use the module's full name.
  Note that names that have a trailing (E) are extensions provided by other modules.
  For example:

     $ module spider fmriprep/25.1.1
----------------------------------------------------------------------------

The dataset description is as follows

 {
    "Name": "fMRIPrep - fMRI PREProcessing workflow",
    "BIDSVersion": "1.4.0",
    "DatasetType": "derivative",
    "GeneratedBy": [
        {
            "Name": "fMRIPrep",
            "Version": "23.1.3",
            "CodeURL": "https://github.com/nipreps/fmriprep/archive/23.1.3.tar.gz"
        }
    ],
    "HowToAcknowledge": "Please cite our paper (https://doi.org/10.1038/s41592-018-0235-4), and include the generated citation boilerplate within the Methods section of the text."
}

The population I am analyzing is 3.5-5 year old, NiBabies seem to be < 2.

Thanks

Hi @Avantika_Mathur,

In the future, please format your code text as code with the </> in the text editor (or surround with tickmarks). You can see I edited your above post for you this time,

Sorry should have been clearer. I am looking for the dataset description of your raw BIDS dataset.

Best,
Steven

The dataset description is as follows. The data is not published yet, but the following could be the dataset description

{
    "Name": "A fMRI neuroimaging dataset of children",
    "BIDSVersion": "2.2.5",
    "DatasetType": "raw",
    "License": "CC0",
    "Authors": [
            "Avery Vess",
            "Avantika Mathur",
            "James R. Booth"
        ],
    "Acknowledgements": "This project was supported by National Institute of Health grant awarded to James R Booth." ,
    "HowToAcknowledge": "Please cite this paper: URL placeholder",
        "Funding": [
            "NIH"
        ],
        "EthicsApprovals": [
            "This study was approved by the Vanderbilt Institutional Review Board"
        ],
        "ReferencesAndLinks": [""],
        "DatasetDOI": ""
    }

Hi @Avantika_Mathur,

Good, just making sure it wasn’t set to derivative by accident, which makes fieldmap correction not work.

Can you provide the tree folder structure for one subject’s raw data and BIDS validator report for the raw dataset?

Best,
Steven


I am attaching a screenshot of dataset structure here. How do I generate and send you the BIDS validator report. I do have a json generated from BIDS Validator link , will that work?

Sure.

Can you also provide the full contents of the fmap jsons?

Also follow up after you tested with most recent version.

Thanks for helping out with this, I changed the fMRIprep to fmriprep/25.1.1 and used the dataset description as above, but still don’t get an output for susceptibility distortion correction ( * Susceptibility distortion correction: None appears in the final html report). It runs and generates the final report and all the files without producing any error. Content for sub-6081_ses-1_acq-D1S0501_dir-AP_epi.json is as follows:

{
	"Modality": "MR",
	"MagneticFieldStrength": 3,
	"ImagingFrequency": 127.75912,
	"Manufacturer": "Philips",
	"ManufacturersModelName": "Ingenia Elition X",
	"InstitutionName": "VANDERBILT INSTITUTE OF IMAGING",
	"InstitutionalDepartmentName": "MRI DEPT.",
	"InstitutionAddress": "1161 21ST AVE. SOUTH",
	"DeviceSerialNumber": "45051",
	"StationName": "PHILIPS-8G70R22",
	"BodyPartExamined": "BRAIN",
	"PatientPosition": "HFS",
	"SoftwareVersions": "5.7.1\\5.7.1.0",
	"MRAcquisitionType": "2D",
	"SeriesDescription": "TOPUP_APP",
	"ProtocolName": "WIP TOPUP_APP",
	"ScanningSequence": "SE",
	"SequenceVariant": "SK",
	"ScanOptions": "FS",
	"PulseSequenceName": "SEEPI",
	"ImageType": ["ORIGINAL", "PRIMARY", "T2", "NONE"],
	"SeriesNumber": 501,
	"AcquisitionTime": "14:22:57.310000",
	"AcquisitionNumber": 5,
	"PhilipsRescaleSlope": 2.10525,
	"PhilipsRescaleIntercept": 0,
	"PhilipsScaleSlope": 0.0224536,
	"UsePhilipsFloatNotDisplayScaling": 1,
	"SliceThickness": 2.25,
	"SpacingBetweenSlices": 2.25,
	"EchoTime": 0.034229,
	"RepetitionTime": 1.71597,
	"MTState": false,
	"FlipAngle": 90,
	"CoilString": "MULTI COIL",
	"PercentPhaseFOV": 100,
	"PercentSampling": 100,
	"EchoTrainLength": 47,
	"PhaseEncodingSteps": 94,
	"FrequencyEncodingSteps": 96,
	"PhaseEncodingStepsOutOfPlane": 1,
	"AcquisitionMatrixPE": 94,
	"ReconMatrixPE": 96,
	"ParallelReductionFactorInPlane": 2,
	"ParallelAcquisitionTechnique": "SENSE",
	"WaterFatShift": 12.8374,
	"EffectiveEchoSpacing": 0.000304606,
	"TotalReadoutTime": 0.0289376,
	"AcquisitionDuration": 6.86387,
	"PixelBandwidth": 2153.55,
	"PhaseEncodingDirection": "j-",
	"ImageOrientationPatientDICOM": [
		0.992705,
		-0.0919653,
		-0.0779642,
		0.101512,
		0.986441,
		0.128952	],
	"InPlanePhaseEncodingDirectionDICOM": "COL",
	"ConversionSoftware": "dcm2niix",
	"ConversionSoftwareVersion": "v1.0.20230411",
	"AcqusitionDate":"07-10-2025",
	"IntendedFor": [
        "ses-1/func/sub-6081_ses-1_task-PhonPicts_acq-D1S0701_run-01_bold.nii.gz",
        "ses-1/func/sub-6081_ses-1_task-PhonPicts_acq-D1S0801_run-01_bold.nii.gz",
		"ses-1/func/sub-6081_ses-1_task-PhonPicts_acq-D1S0901_run-02_bold.nii.gz",
		"ses-1/func/sub-6081_ses-1_task-SemPicts_acq-D1S0301_run-01_bold.nii.gz",
		"ses-1/func/sub-6081_ses-1_task-SemPicts_acq-D1S0401_run-02_bold.nii.gz"
    ]
}

and content for sub-6081_ses-1_acq-D1S0601_dir-PA_epi.json is as follows

{
	"Modality": "MR",
	"MagneticFieldStrength": 3,
	"ImagingFrequency": 127.75912,
	"Manufacturer": "Philips",
	"ManufacturersModelName": "Ingenia Elition X",
	"InstitutionName": "VANDERBILT INSTITUTE OF IMAGING",
	"InstitutionalDepartmentName": "MRI DEPT.",
	"InstitutionAddress": "1161 21ST AVE. SOUTH",
	"DeviceSerialNumber": "45051",
	"StationName": "PHILIPS-8G70R22",
	"BodyPartExamined": "BRAIN",
	"PatientPosition": "HFS",
	"SoftwareVersions": "5.7.1\\5.7.1.0",
	"MRAcquisitionType": "2D",
	"SeriesDescription": "TOPUP_APA",
	"ProtocolName": "WIP TOPUP_APA",
	"ScanningSequence": "SE",
	"SequenceVariant": "SK",
	"ScanOptions": "FS",
	"PulseSequenceName": "SEEPI",
	"ImageType": ["ORIGINAL", "PRIMARY", "T2", "NONE"],
	"SeriesNumber": 601,
	"AcquisitionTime": "14:23:6.690000",
	"AcquisitionNumber": 6,
	"PhilipsRescaleSlope": 1.47643,
	"PhilipsRescaleIntercept": 0,
	"PhilipsScaleSlope": 0.0224536,
	"UsePhilipsFloatNotDisplayScaling": 1,
	"SliceThickness": 2.25,
	"SpacingBetweenSlices": 2.25,
	"EchoTime": 0.034229,
	"RepetitionTime": 1.71879,
	"MTState": false,
	"FlipAngle": 90,
	"CoilString": "MULTI COIL",
	"PercentPhaseFOV": 100,
	"PercentSampling": 100,
	"EchoTrainLength": 47,
	"PhaseEncodingSteps": 94,
	"FrequencyEncodingSteps": 96,
	"PhaseEncodingStepsOutOfPlane": 1,
	"AcquisitionMatrixPE": 94,
	"ReconMatrixPE": 96,
	"ParallelReductionFactorInPlane": 2,
	"ParallelAcquisitionTechnique": "SENSE",
	"WaterFatShift": 12.835,
	"EffectiveEchoSpacing": 0.00030455,
	"TotalReadoutTime": 0.0289323,
	"AcquisitionDuration": 6.87516,
	"PixelBandwidth": 2153.55,
	"PhaseEncodingDirection": "j",
	"ImageOrientationPatientDICOM": [
		0.992705,
		-0.0919653,
		-0.0779642,
		0.101512,
		0.986441,
		0.128952	],
	"InPlanePhaseEncodingDirectionDICOM": "COL",
	"ConversionSoftware": "dcm2niix",
	"ConversionSoftwareVersion": "v1.0.20230411",
	"AcqusitionDate":"07-10-2025",
	"IntendedFor": [
        "ses-1/func/sub-6081_ses-1_task-PhonPicts_acq-D1S0701_run-01_bold.nii.gz",
        "ses-1/func/sub-6081_ses-1_task-PhonPicts_acq-D1S0801_run-01_bold.nii.gz",
		"ses-1/func/sub-6081_ses-1_task-PhonPicts_acq-D1S0901_run-02_bold.nii.gz",
		"ses-1/func/sub-6081_ses-1_task-SemPicts_acq-D1S0301_run-01_bold.nii.gz",
		"ses-1/func/sub-6081_ses-1_task-SemPicts_acq-D1S0401_run-02_bold.nii.gz"
    ]
}

Moreover, I am unable to append the json from BIDS validator here as it surpass the character limit. Is it possible to attach is as file.

Hi @Avantika_Mathur,

Please format your code output (such as the JSONs) as code using the </> button in the text editor, or surround them by tickmarks (`). You can see I edited your post for you this time.

The JSONs look fine to me. Any chance you can share a single subject’s worth of data to see if I can replicate error?

Yes you can attach files. If they don’t allow jsons you can save it as a .txt.

Best,
Steven

Thanks again, what will be the best way to share the data with you.

Google drive, dropbox, something like that. steven.meisler@pennmedicine.upenn.edu

Hi @Avantika_Mathur,

Your BOLD jsons do not have PhaseEncodingDirection or TotalReadoutTime defined.

Best,
Steven