fMRIPrep not detecting fieldmap

Summary of what happened:

I am running fmriprep version 24.0.1 on singularity and fmriprep does not detect the fieldmaps. All steps mentioned below have been applied (exactly the same) on data from a different study and it worked perfectly.

For this particular study, the only difference is that voxel size of fieldmaps does not match voxel size of BOLD data. Not sure if that’s what is causing fmriprep to skip the fmaps, but I was told by the person who built our sequence that this should not be the problem.

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

singularity exec --cleanenv -B /path/hidden:/base_dir -B /path/hidden/singularity_images/mytemplateflowdir:/opt/templateflow /path/hidden/singularity_images/fmriprep-24.0.1.sif \
fmriprep -v /base_dir/experiments/sips/data/bids /base_dir/experiments/studyhidden/data/fmriprep/fmriprep_24.0.1 \
    participant  \
    --participant-label ${sub} \
    --fs-license-file /base_dir/freesurfer/license.txt \
    --omp-nthreads 16 --n_cpus 16 \
    --slice-time-ref 0.5 \
    --ignore slicetiming \
    --dummy-scans 0 \
    --fs-no-reconall \
    --bold2anat-dof 12 --fd-spike-threshold 0.5 \
    --output-spaces MNI152NLin2009cAsym \
     -w /base_dir/experiments/studyhidden/data/fmriprep/fmriprep_24.0.1/fmriprep_wf \
     --stop-on-first-crash

Version:

fmriprep-24.0.1

Environment (Docker, Singularity / Apptainer, 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):

I deleted some of the intermediate lines to make sure it’s not too much over 20 lines

260415-15:18:23,823 cli INFO:
	 Telemetry system to collect crashes and errors is enabled - thanks for your feedback!. Use option ``--notrack`` to opt out.
260415-15:18:24,759 cli INFO:
	 Making sure the input data is BIDS compliant (warnings can be ignored in most cases).
bids-validator@1.14.6
	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[39me[24m 
        49 Files, 1.29GB                                MRI                   
        4 - Subjects                                                          
        1 - Session                                                           


e[36m	If you have any questions, please post on https://neurostars.org/tags/bids.e[39m
260415-15:18:45,429 nipype.workflow IMPORTANT:
	 Running fMRIPrep version 24.0.1

        
260415-15:18:45,518 nipype.workflow IMPORTANT:
	 Building fMRIPrep's workflow:
           * BIDS dataset path: /base_dir/experiments/studyhidden/data/bids.
           * Participant list: ['006'].
           * Run identifier: 20260415-151821_715f8792-e47d-4197-a509-8d5751c94cec.
           * Output spaces: MNI152NLin2009cAsym:res-native.
           * Pre-run FreeSurfer's SUBJECTS_DIR: /base_dir/experiments/studyhidden/data/fmriprep/fmriprep_24.0.1/sourcedata/freesurfer.
260415-15:18:46,519 nipype.workflow INFO:
	 ANAT Stage 1: Adding template workflow
260415-15:18:47,353 nipype.workflow INFO:
	 ANAT Stage 2: Preparing brain extraction workflow
260415-15:18:47,534 nipype.workflow INFO:
	 ANAT Stage 3: Preparing segmentation workflow
260415-15:18:47,544 nipype.workflow INFO:
	 ANAT Stage 4: Preparing normalization workflow for ['MNI152NLin2009cAsym']
260415-15:18:47,564 nipype.workflow INFO:
	 ANAT Skipping Stages 5+
260415-15:18:48,140 nipype.workflow INFO:
	 No single-band-reference found for sub-006_task-subliminal_run-01_bold.nii.gz.
260415-15:18:48,277 nipype.workflow INFO:
	 Stage 1: Adding HMC boldref workflow
260415-15:18:48,291 nipype.workflow INFO:
	 Stage 2: Adding motion correction workflow
260415-15:18:48,308 nipype.workflow INFO:
	 Stage 3: Adding coregistration boldref workflow
260415-15:18:48,709 nipype.workflow INFO:
	 No single-band-reference found for sub-006_task-subliminal_run-02_bold.nii.gz.
260415-15:18:48,805 nipype.workflow INFO:
	 Stage 1: Adding HMC boldref workflow
260415-15:18:48,817 nipype.workflow INFO:
	 Stage 2: Adding motion correction workflow
260415-15:18:48,826 nipype.workflow INFO:
	 Stage 3: Adding coregistration boldref workflow
260415-15:18:53,702 nipype.workflow INFO:
	 fMRIPrep workflow graph with 459 nodes built successfully.
260415-15:19:15,480 nipype.workflow IMPORTANT:
	 fMRIPrep started!

Screenshots / relevant information:

Below is my tree for this subject.

Below is the end of the phasediff json files. Phase Encoding direction of fmap is j-

Note all these same steps have worked before on data from a different study - all processed with the same bids formatting, same fmriprep version and same “IntendedFor” field at the end of the phasediff files.


Hi @afroditi and welcome to neurostars!

I believe the problem is likely that you specified an improper B0Field* metadata. When any B0Field metadata is specified, your IntendedFor will be ignored even if your IntendedFor is right and your B0Field metadata are wrong. It seems like you’ve only shared the fmap json and not the BOLD. Is your BOLD B0FieldSource identified?

Unrelated, but I also recommend updating fMRIPrep and using FreeSurfer in your workflow.

Best,
Steven

Thanks for the response Steven.

We plan on updating our fmriprep but we like to preprocess all data from related projects with the same prep version.

In a similar study (where the exact same pipeline was used with same prep version), I had both the B0Field and IntendedFor fields in my fmap json in the exact same order as shown here and it worked and applied it to the proper functional data.

However, I tried removing the "B0FieldIdentifier": "phasediff_fmap0",from my fmap json files but no luck. fMRIPrep still does not detect it.

I don’t see any section in the current study’s BOLD json file that has the BOLD B0FieldSource identified. But usually none of our BOLD fmaps have as we never add it manually and they all seem to have worked fine in the past. I can attach my BOLD json if it’s easier.

Hi @afroditi ,

That could be a problem. May you also return the contents of your dataset_description.json?

Best,

Steven

Thanks, I am attaching a screenshot of my dataset_description.json. I barely put any info in the dataset description files. I only update the study name from project to project.

And for the B0Field, none of our previous BOLD json files have the B0FieldSource and they have worked fine with the fmaps. Maybe I am just not seeing that field or it could have an alternative name?

.

Hi @afroditi,

May you post the contents of the BOLD json? Note that we prefer text formatted as code (using the </>button in the text editor / tickmarks) over screenshots.

Best,

Steven

Here is my BOLD json file.

{

"Modality": "MR",

"MagneticFieldStrength": 3,

"ImagingFrequency": 123.253,

"Manufacturer": "Siemens",

"ManufacturersModelName": "MAGNETOM Cima.X",

"InstitutionName": "REMOVED",

"InstitutionalDepartmentName": "REMOVED",

"InstitutionAddress": "REMOVED",

"DeviceSerialNumber": "REMOVED",

"StationName": "REMOVED",

"BodyPartExamined": "BRAIN",

"PatientPosition": "HFS",

"ProcedureStepDescription": "REMOVED",

"SoftwareVersions": "syngo MR XA61",

"MRAcquisitionType": "2D",

"SeriesDescription": "EPI_sms3_63slice_TR1940_TE36_2x2x2",

"ProtocolName": "EPI_sms3_63slice_TR1940_TE36_2x2x2",

"ScanningSequence": "EP",

"SequenceVariant": "SK",

"ScanOptions": "FS",

"PulseSequenceName": "*epfid2d1_104",

"ImageType": ["ORIGINAL", "PRIMARY", "FMRI", "NONE"],

"ImageTypeText": ["ORIGINAL", "PRIMARY", "M", "DIS2D"],

"NonlinearGradientCorrection": true,

"SeriesNumber": 13,

"AcquisitionTime": "REMOVED",

"AcquisitionNumber": 1,

"SliceThickness": 2,

"SpacingBetweenSlices": 2.06,

"EchoTime": 0.036,

"RepetitionTime": 1.94,

"MTState": false,

"FlipAngle": 70,

"PartialFourier": 1,

"BaseResolution": 104,

"ShimSetting": [

3577,

-4815,

-1233,

490,

27,

116,

-137,

-19 ],

"TxRefAmp": 287.975,

"PhaseResolution": 1,

"ReceiveCoilName": "Head_32",

"ReceiveCoilActiveElements": "HEA;HEP",

"CoilString": "Head_32",

"PulseSequenceDetails": "%SiemensSeq%\\ep2d_bold",

"RefLinesPE": 23,

"CoilCombinationMethod": "Sum of Squares",

"MultibandAccelerationFactor": 3,

"PercentPhaseFOV": 100,

"PercentSampling": 100,

"EchoTrainLength": 104,

"AcquisitionMatrixPE": 104,

"ReconMatrixPE": 104,

"BandwidthPerPixelPhaseEncode": 16.578,

"ParallelAcquisitionTechnique": "SMS",

"EffectiveEchoSpacing": 0.000580009,

"DerivedVendorReportedEchoSpacing": 0.000580009,

"AcquisitionDuration": 504.827,

"TotalReadoutTime": 0.0597409,

"PixelBandwidth": 2003,

"DwellTime": 2.4e-06,

"PhaseEncodingDirection": "j-",

"SliceTiming": [

0,

1.005,

0.09,

1.0975,

0.1825,

1.1875,

0.2725,

1.28,

0.365,

1.37,

0.4575,

1.4625,

0.5475,

1.5525,

0.64,

1.645,

0.73,

1.7375,

0.8225,

1.8275,

0.9125,

0,

1.005,

0.09,

1.0975,

0.1825,

1.1875,

0.2725,

1.28,

0.365,

1.37,

0.4575,

1.4625,

0.5475,

1.5525,

0.64,

1.645,

0.73,

1.7375,

0.8225,

1.8275,

0.9125,

0,

1.005,

0.09,

1.0975,

0.1825,

1.1875,

0.2725,

1.28,

0.365,

1.37,

0.4575,

1.4625,

0.5475,

1.5525,

0.64,

1.645,

0.73,

1.7375,

0.8225,

1.8275,

0.9125 ],

"ImageOrientationPatientDICOM": [

0.999142,

0.0375309,

-0.0174851,

-0.0354146,

0.993444,

0.108697 ],

"InPlanePhaseEncodingDirectionDICOM": "COL",

"ConversionSoftware": "dcm2niix",

"ConversionSoftwareVersion": "v1.0.20220720"

}

May you also please post your full phasediff json?

Here is my phasediff json:

{

    "Modality": "MR",

    "MagneticFieldStrength": 3,

    "ImagingFrequency": 123.253,

    "Manufacturer": "Siemens",

    "ManufacturersModelName": "MAGNETOM Cima.X",

    "InstitutionName": "REMOVED",

    "InstitutionalDepartmentName": "REMOVED",

    "InstitutionAddress": "REMOVED",

    "DeviceSerialNumber": "REMOVED",

    "StationName": "REMOVED",

    "BodyPartExamined": "BRAIN",

    "PatientPosition": "HFS",

    "ProcedureStepDescription": "REMOVED",

    "SoftwareVersions": "syngo MR XA61",

    "MRAcquisitionType": "2D",

    "SeriesDescription": "gre_field-mapping_2mm",

    "ProtocolName": "gre_field-mapping_2mm",

    "ScanningSequence": "GR",

    "SequenceVariant": "SP",

    "PulseSequenceName": "*fm2d2r",

    "ImageType": [

        "ORIGINAL",

        "PRIMARY",

        "P",

        "NONE",

        "PHASE"

    ],

    "ImageTypeText": [

        "ORIGINAL",

        "PRIMARY",

        "P",

        "DIS2D"

    ],

    "NonlinearGradientCorrection": true,

    "SeriesNumber": 16,

    "AcquisitionTime": "REMOVED",

    "AcquisitionNumber": 1,

    "SliceThickness": 2,

    "SpacingBetweenSlices": 2.06,

    "EchoNumber": 2,

    "EchoTime": 0.00738,

    "RepetitionTime": 0.613,

    "MTState": false,

    "FlipAngle": 60,

    "EchoTime1": 0.00492,

    "EchoTime2": 0.00738,

    "PartialFourier": 1,

    "BaseResolution": 64,

    "ShimSetting": [

        3577,

        -4815,

        -1234,

        492,

        28,

        116,

        -139,

        -17

    ],

    "TxRefAmp": 287.975,

    "PhaseResolution": 1,

    "ReceiveCoilName": "Head_32",

    "ReceiveCoilActiveElements": "HEA;HEP",

    "CoilString": "Head_32",

    "PulseSequenceDetails": "%SiemensSeq%\\gre_field_mapping",

    "CoilCombinationMethod": "Sum of Squares",

    "MatrixCoilMode": "SENSE",

    "PercentPhaseFOV": 100,

    "PercentSampling": 100,

    "AcquisitionMatrixPE": 64,

    "ReconMatrixPE": 64,

    "AcquisitionDuration": 77.839,

    "PixelBandwidth": 601,

    "DwellTime": 1.3e-05,

    "PhaseEncodingDirection": "j-",

    "SliceTiming": [

        0,

        0.31,

        0.0075,

        0.32,

        0.0175,

        0.33,

        0.0275,

        0.34,

        0.0375,

        0.35,

        0.0475,

        0.36,

        0.0575,

        0.3675,

        0.0675,

        0.3775,

        0.0775,

        0.3875,

        0.0875,

        0.3975,

        0.095,

        0.4075,

        0.105,

        0.4175,

        0.115,

        0.4275,

        0.125,

        0.4375,

        0.135,

        0.4475,

        0.145,

        0.455,

        0.155,

        0.465,

        0.165,

        0.475,

        0.175,

        0.485,

        0.1825,

        0.495,

        0.1925,

        0.505,

        0.2025,

        0.515,

        0.2125,

        0.525,

        0.2225,

        0.535,

        0.2325,

        0.5425,

        0.2425,

        0.5525,

        0.2525,

        0.5625,

        0.2625,

        0.5725,

        0.2725,

        0.5825,

        0.28,

        0.5925,

        0.29,

        0.6025,

        0.3

    ],

    "ImageOrientationPatientDICOM": [

        0.999153,

        0.0374759,

        -0.0169808,

        -0.0354151,

        0.993447,

        0.108669

    ],

    "InPlanePhaseEncodingDirectionDICOM": "COL",

    "ConversionSoftware": "dcm2niix",

    "ConversionSoftwareVersion": "v1.0.20220720",

    "B0FieldIdentifier": "phasediff_fmap0",

    "IntendedFor": [

        "func/sub-006_task-subliminal_run-01_bold.nii.gz",

        "func/sub-006_task-subliminal_run-02_bold.nii.gz"

    ]

}

Are you able one subject’s worth of data? Can you also try adding “DatasetType”: “raw” to your dataset description json?

Adding the “raw” in the dataset_description json did not really change anything. There was no SDC applied.

I think I might update to the latest prep and then repeat the steps. I am sure the error is something obvious, so hopefully updating it and re-creating all the files from scratch might help.