Fmriprep error: BIDSConflictingValuesError for entity 'run'

Summary of what happened:

Hi,

I am trying to run fmriprep version 24.0.1 and receiving the following error. I ran fmriprep version 23.2.0 on this same data and meta-data (see JSON below) without issue. Do i need to modify the JSON to run v24.0.1? If so, can anyone advise how ‘run’ should be included in the JSON to avoid this error, or point me to the BIDS documentation?

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

unset PYTHONPATH; singularity run --cleanenv $singularity_dir/fmriprep-24.0.1.simg \
         $bids_root_dir/rawdata $bids_root_dir/derivatives/preprocessed/fmriprep_v2401 \
         participant \
         --participant_label $subj \
         --verbose \
         --output-spaces MNI152NLin2009cAsym:res-native \
         --fs-license-file $FS_LICENSE \
         --work-dir $bids_root_dir/code/fmriprep/sub-$subj/work_v2401

Version:

24.0.1

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

Singularity

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):

240718-17:07:25,699 cli INFO:
         Telemetry system to collect crashes and errors is enabled - thanks for your feedback!. Use option ``--notrack`` to opt out.
Traceback (most recent call last):
  File "/opt/conda/envs/fmriprep/bin/fmriprep", line 8, in <module>
    sys.exit(main())
             ^^^^^^
  File "/opt/conda/envs/fmriprep/lib/python3.11/site-packages/fmriprep/cli/run.py", line 40, in main
    parse_args()
  File "/opt/conda/envs/fmriprep/lib/python3.11/site-packages/fmriprep/cli/parser.py", line 878, in parse_args
    config.from_dict({})
  File "/opt/conda/envs/fmriprep/lib/python3.11/site-packages/fmriprep/config.py", line 729, in from_dict
    execution.load(settings, init=initialize('execution'), ignore=ignore)
  File "/opt/conda/envs/fmriprep/lib/python3.11/site-packages/fmriprep/config.py", line 240, in load
    cls.init()
  File "/opt/conda/envs/fmriprep/lib/python3.11/site-packages/fmriprep/config.py", line 503, in init
    cls._layout = BIDSLayout(
                  ^^^^^^^^^^^
  File "/opt/conda/envs/fmriprep/lib/python3.11/site-packages/bids/layout/layout.py", line 177, in __init__
    _indexer(self)
  File "/opt/conda/envs/fmriprep/lib/python3.11/site-packages/bids/layout/index.py", line 154, in __call__
    self._index_metadata()
  File "/opt/conda/envs/fmriprep/lib/python3.11/site-packages/bids/layout/index.py", line 487, in _index_metadata
    raise BIDSConflictingValuesError(
bids.exceptions.BIDSConflictingValuesError: Conflicting values found for entity 'run' in filename /storage/group/klk37/default/R01_Marketing/bids/rawdata/sub-001/ses-1/func/sub-001_ses-1_task-foodview_run-01_bold.nii.gz (value='01') versus its JSON sidecar (value='{'Description': ''}'). Please reconcile this discrepancy.

Screenshots / relevant information:


JSON:

{
  "Modality": "MR",
  "MagneticFieldStrength": 3,
  "ImagingFrequency": 123.252373,
  "Manufacturer": "Siemens",
  "ManufacturersModelName": "MAGNETOM Prisma Fit",
  "InstitutionName": "Penn State SLEIC",
  "InstitutionAddress": "University Park Chandlee Laboratory,State College,PA,US,16802",
  "DeviceSerialNumber": "67039",
  "StationName": "AWP67039",
  "BodyPartExamined": "BRAIN",
  "PatientPosition": "HFS",
  "SoftwareVersions": "syngo MR XA30",
  "MRAcquisitionType": "2D",
  "SeriesDescription": "foodview-1",
  "ProtocolName": "foodview-1",
  "ScanningSequence": "EP",
  "SequenceVariant": "SK",
  "ScanOptions": "FS",
  "PulseSequenceName": "*epfid2d1_70",
  "ImageType": [
    "ORIGINAL",
    "PRIMARY",
    "FMRI",
    "NONE"
  ],
  "ImageTypeText": [
    "ORIGINAL",
    "PRIMARY",
    "M",
    "ND",
    "NORM"
  ],
  "NonlinearGradientCorrection": false,
  "SeriesNumber": 5,
  "AcquisitionTime": "16:06:21.675000",
  "AcquisitionNumber": 1,
  "SliceThickness": 3,
  "SpacingBetweenSlices": 3,
  "EchoTime": 0.025,
  "RepetitionTime": 2,
  "MTState": false,
  "FlipAngle": 90,
  "PartialFourier": 1,
  "BaseResolution": 70,
  "ShimSetting": [
    -1915,
    8227,
    9418,
    607,
    -79,
    -19,
    5,
    11
  ],
  "TxRefAmp": 237.646,
  "PhaseResolution": 1,
  "ReceiveCoilName": "HeadNeck_20",
  "ReceiveCoilActiveElements": "HE1-4",
  "CoilString": "HeadNeck_20",
  "PulseSequenceDetails": "%SiemensSeq%\\ep2d_bold",
  "CoilCombinationMethod": "Sum of Squares",
  "MatrixCoilMode": "SENSE",
  "PercentPhaseFOV": 100,
  "PercentSampling": 100,
  "EchoTrainLength": 70,
  "PhaseEncodingSteps": 70,
  "FrequencyEncodingSteps": 70,
  "AcquisitionMatrixPE": 70,
  "ReconMatrixPE": 70,
  "BandwidthPerPixelPhaseEncode": 29.155,
  "EffectiveEchoSpacing": 0.000489992,
  "DerivedVendorReportedEchoSpacing": 0.000489992,
  "AcquisitionDuration": 267.925,
  "TotalReadoutTime": 0.0338094,
  "PixelBandwidth": 2463,
  "DwellTime": 2.9e-06,
  "PhaseEncodingDirection": "j-",
  "SliceTiming": [
    0,
    1.02,
    0.0575,
    1.075,
    0.1125,
    1.1325,
    0.17,
    1.1875,
    0.2275,
    1.245,
    0.2825,
    1.3025,
    0.34,
    1.3575,
    0.3975,
    1.415,
    0.4525,
    1.4725,
    0.51,
    1.5275,
    0.5675,
    1.585,
    0.6225,
    1.64,
    0.68,
    1.6975,
    0.735,
    1.755,
    0.7925,
    1.81,
    0.85,
    1.8675,
    0.905,
    1.925,
    0.9625
  ],
  "ImageOrientationPatientDICOM": [
    0.999859,
    -0.00118619,
    0.016734,
    4.67189e-08,
    0.997497,
    0.0707049
  ],
  "InPlanePhaseEncodingDirectionDICOM": "COL",
  "ConversionSoftware": "dcm2niix",
  "ConversionSoftwareVersion": "v1.0.20230411",
  "Dcm2bidsVersion": "2.1.6",
  "TaskName": "foodview"
}

Hi @bfuchs18,

In the future, please do not delete the software support post template, which organizes and formats your post. You can see I reimplemented it for you this time.

Please return the BIDS validation report as requested by the post prompt. Additionally, the tree output on your BIDS directory / sample subject raw data would be helpful.

Best,
Steven

Hi Steven,

Sorry about that. I changed the tag to ‘Software Support’ after posting, so I did not see the template. Thanks for fixing it.

After my initial post, i realized my events files were incorrectly named. Once i fixed those I got a related error:

bids.exceptions.BIDSConflictingValuesError: Conflicting values found for entity ‘run’ in filename /storage/group/klk37/default/R01_Marketing/bids/rawdata/sub-001/ses-1/func/sub-001_ses-1_task-foodview_run-01_events.tsv (value=‘01’) versus its JSON sidecar (value=‘{‘Description’: ‘Food View Task run number’, ‘Levels’: {‘01’: ‘run 1’, ‘02’: ‘run 2’, ‘03’: ‘run 3’, ‘04’: ‘run 4’}}’). Please reconcile this discrepancy.

Once I renamed the ‘run’ column in my events files to something else, fmriprep continued running. I don’t believe any of the warnings from the BIDS validator suggest that the ‘run’ column is invalid.
rawdata_errors.txt (611.3 KB)

Was removing the ‘run’ column from my events file the appropriate fix to this?

Here is the directory structure of rawdata/sub-001.

Hi @bfuchs18,

Thanks for the additional info. I don’t see the reason why you would need a “run” column in your events.tsv, so that’s probably safe to remove. Without seeing your tsv and events json I cannot say exactly what the best solution is, but I think just not having the events json and “run” column in the tsv files is fine for preprocessing purposes.

Best,
Steven

P.S.: For future posts, text formatted as code like this (for short code) or

like this (for longer code)

is generally preferable to screenshots or attachments. You can use the </> button in the text editor for this.

1 Like