# Introduction to BIDS

The Brain Imaging Data Structure (BIDS) provides a simple and intuitive way to organize and describe your neuroimaging and behavioral data. It has been widely adopted as a standard that many processing pipelines understand.

## BIDS Specification

The main specification lives here: <https://bids-specification.readthedocs.io/en/stable/>

### Organization Principles

BIDS principles can be summarized as:

* NIFTI files are the chosen imaging format
* Key data is accompanied by `json` file providing parameters and descriptions
* Folder structure and files are named in a consistent manner as prescribed by the specification

### Directory Structure

Overall directories hierarchy is as follows (\[] indicates optional fields):

* sub-\<participant\_label>\[/ses-\<session\_label>]/\<data\_type>/
* \[code/]
* \[derivatives/]
* \[stimuli/]
* \[sourcedata/]

#### Single Session Example

* **sub-control01**
  * **anat**
    * sub-control01\_T1w\.nii.gz sub-control01\_T1w\.json
    * sub-control01\_T2w\.nii.gz sub-control01\_T2w\.json
  * **func**
    * sub-control01\_task-nback\_bold.nii.gz
    * sub-control01\_task-nback\_bold.json
    * sub-control01\_task-nback\_events.tsv
    * sub-control01\_task-nback\_physio.tsv.gz
    * sub-control01\_task-nback\_physio.json
    * sub-control01\_task-nback\_sbref.nii.gz
  * **dwi**
    * sub-control01\_dwi.nii.gz
    * sub-control01\_dwi.bval
    * sub-control01\_dwi.bvec
  * **fmap**
    * sub-control01\_phasediff.nii.gz
    * sub-control01\_phasediff.json
    * sub-control01\_magnitude1.nii.gz
    * sub-control01\_scans.tsv

Additional files and folders containing raw data may be added as needed for special cases. They should be named using all lowercase with a name that reflects the nature of the scan (e.g., “calibration”). Naming of files within the directory should follow the same scheme as above (e.g., “sub-control01\_calibration\_Xcalibration.nii.gz”).

#### BIDS Entity Table

The name of the file depends on modality, acquisition parameters and other considerations. The[ BIDS Entity Table](https://bids-specification.readthedocs.io/en/stable/99-appendices/04-entity-table.html) table compiles the entities (key-value pairs) described throughout the specification, and establishes a common order within a filename. For example, if a file has an acquisition and reconstruction label, the acquisition entity must precede the reconstruction entity.

#### Format considerations

* Filenames are case sensitive
* Recommended: Zero-padding for subjects i.e sub\_01
* NOT Recommended: Zero-padding for runs and echo (and they MUST be integers)
* Units: SI
* Time: YYYY-MM-DDThh:mm:ss


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.ccv.brown.edu/bnc-user-manual/bids/introduction-to-bids.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
