Skip to content

Rules

rules.files

rules.files: Filename construction rules

rules.files.common: Top-level (dataset_description.json) and tables (participants.tsv)

dataset_description
dataset_description:
level: required
path: dataset_description.json
participants
participants:
level: optional
stem: participants
extensions:
    - .tsv
    - .json

rules.files.raw: Data files defined in "BIDS-Raw"

rules.files.raw.anat.nonparametric
nonparametric:
suffixes:
    - T1w
    - T2w
    - PDw
    - T2starw
    - FLAIR
    - inplaneT1
    - inplaneT2
    - PDT2
    - angio
    - T2star # deprecated
    - FLASH # deprecated
    - PD # deprecated
extensions:
    - .nii.gz
    - .nii
    - .json
datatypes:
    - anat
entities:
    subject: required
    session: optional
    task: optional
    acquisition: optional
    ceagent: optional
    reconstruction: optional
    run: optional
    part: optional

rules.files.deriv: Data files defined in "BIDS-Derivatives"

rules.files.raw.beh.noncontinuous:

beh_noncontinous
# Non-continuous data
noncontinuous:
suffixes:
    - beh
extensions:
    - .tsv
    - .json
datatypes:
    - beh
entities:
    subject: required
    session: optional
    task: required
    acquisition: optional
    run: optional

image of template rendered in spec


rules.sidecars

rules.sidecars: Sidecar construction rules

rules.sidecars.anat.MRIAnatomyCommonMetadataFields

MRIAnatomyCommonMetadataFields
MRIAnatomyCommonMetadataFields:
selectors:
    - modality == "mri"
    - datatype == "anat"
fields:
    ContrastBolusIngredient: optional
    RepetitionTimeExcitation: optional
    RepetitionTimePreparation: optional

rendered image of rules.sidecars.anat.MRIAnatomyCommonMetadataFields


rules.tabular_data

rules.tabular_data: TSV construction rules

`rules.tablular_data.task.TaskEvents

TaskEvents
TaskEvents:
selectors:
    - '"task" in entities'
    - suffix == "events"
columns:
    onset: required
    duration: required
    trial_type: optional
    ...
additional_columns: allowed
initial_columns:
    - 'onset'
    - 'duration'

rendered image of task events


rules.checks

rules.checks: Dataset consistency rules, relies heavily on an expression language If all selectors are true, the rule applies to a file; if any check fails, the issue is raised.

`rules.checks.dwi.DWIVolumeCount

DWIVolumeCount
DWIVolumeCount:
issue:
    code: VOLUME_COUNT_MISMATCH
    message: |
    The number of volumes in this scan does not match the number
    of volumes in the corresponding .bvec and .bval files.
    level: error
selectors:
    - suffix == "dwi"
    - '"bval" in associations'
    - '"bvec" in associations'
checks:
    - associations.bval.n_cols == nifti_header.dim[4]
    - associations.bvec.n_cols == nifti_header.dim[4]

One-off rules