> For the complete documentation index, see [llms.txt](https://docs.neuroinfodb.org/squirrel/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.neuroinfodb.org/squirrel/specifications/squirrel-vs-bids.md). Agents can also search and read this documentation through its [MCP server](https://docs.neuroinfodb.org/squirrel/~gitbook/mcp).

# squirrel vs BIDS

Understanding the differences between package formats

BIDS and squirrel are both file formats designed to store neuroimaging data. They are similar, but different in implementation. If you are familiar with BIDS, squirrel will be easy to understand.

Convert a BIDS dataset with `squirrel convert <bidsdir> <package>.sqrl --inputformat bids --outputformat squirrel`.

## BIDS to squirrel mapping

| BIDS                                                                                                                                 | squirrel                           | Notes                                                                                                                                                                           |
| ------------------------------------------------------------------------------------------------------------------------------------ | ---------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `dataset_description.json`                                                                                                           | package                            | `Name` → PackageName, `License` → License. Other fields (BIDSVersion, Authors, DatasetDOI, Funding, GeneratedBy, ...) are kept in the package Notes under `bids`.               |
| `README`, `README.md`                                                                                                                | package → Readme                   |                                                                                                                                                                                 |
| `CHANGES`                                                                                                                            | package → Changes                  |                                                                                                                                                                                 |
| `sub-*` directory                                                                                                                    | subject                            | The directory name (eg `sub-01`) is the subject ID.                                                                                                                             |
| `participants.tsv`                                                                                                                   | subject, observations              | `sex` and `gender` → Sex and Gender (M/F/O/U). Every other column → an observation (instrument `participants`), described by `participants.json`.                               |
| `ses-*` directory                                                                                                                    | study                              | One study per session, numbered in acquisition order. The session label → VisitType. A subject with no `ses-*` directories has one study.                                       |
| `sub-*_sessions.tsv`                                                                                                                 | study, observations                | `acq_time` → study DateTime. Other columns → observations (instrument `sessions`).                                                                                              |
| Datatype directory (`anat`, `func`, `dwi`, `fmap`, `perf`, `pet`, `eeg`, `ieeg`, `meg`, `nirs`, `emg`, `micr`, `motion`, `beh`, ...) | study → Modality                   | `anat`, `func`, `dwi`, `fmap`, `perf` and `mrs` are MR. Mixed sessions get a combined modality.                                                                                 |
| Data file (`.nii.gz`, `.nii`, `.edf`, `.bdf`, `.set`, `.vhdr`, `.fif`, `.nwb`, `.snirf`, `.tif`, `.ds`, `.zarr`, ...)                | series                             | One series per data file. Filename entities → BidsEntity (datatype), BidsSuffix, BidsTask, BidsRun, BidsPhaseEncodingDirection (`dir-`) and Protocol.                           |
| Sidecars (`.json`, `.bval`, `.bvec`, `events`, `channels`, `electrodes`, `physio`, ...)                                              | series → files, params             | Stored with the series they belong to, including sidecars inherited from the dataset, subject or session level. Matching `.json` sidecars are merged into the series params.    |
| `*_scans.tsv`                                                                                                                        | series → DateTime                  | `acq_time` → series DateTime. The file is stored with the series.                                                                                                               |
| `task-*` files in the root                                                                                                           | experiment                         | One experiment per task label.                                                                                                                                                  |
| `stimuli` directory                                                                                                                  | experiment                         | An experiment named `stimuli`.                                                                                                                                                  |
| `phenotype/*.tsv`                                                                                                                    | observations                       | One observation per column per subject; the instrument is the file name. Column descriptions come from the matching `.json`.                                                    |
| `derivatives/<pipeline>/`                                                                                                            | pipeline, analysis, group-analysis | Each pipeline directory → a pipeline. Each subject/session directory in it → an analysis on that study. Outputs not belonging to a subject (eg `fsaverage`) → a group-analysis. |
| Derivative dataset (`DatasetType: derivative`)                                                                                       | pipeline, analysis                 | The whole dataset → one pipeline named after `GeneratedBy`, with an analysis per subject/session.                                                                               |
| `code` directory                                                                                                                     | pipeline                           | A pipeline named `bids-code`.                                                                                                                                                   |
| Other root files (`LICENSE`, `participants.json`, unused sidecars, ...)                                                              | package → Notes                    | Stored under `bids.files`.                                                                                                                                                      |
| `sourcedata` directory                                                                                                               | —                                  | Not imported. Import raw DICOM with `--inputformat dicom`.                                                                                                                      |


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

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

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.neuroinfodb.org/squirrel/specifications/squirrel-vs-bids.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

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.
