# BIDS Ready Protocols

## BIDS Naming Pattern

We provide custom code ([xnat-tools package](https://github.com/brown-bnc/xnat-tools)) to export your XNAT imaging sessions to BIDS format. The process relies on naming your series in a BIDS friendly manner. If you are new to BIDS, it may be helpful to familiarize yourself with the [BIDS Standard](https://bids-specification.readthedocs.io/en/stable/). We also provide [a short overview of BIDS](https://docs.ccv.brown.edu/bnc-user-manual/bids/introduction-to-bids).

When naming your series at the scanner you will need to think of the different parts that make up the BIDS name. More explicitly, the name of the series is composed of different parts that provide information about the sequence type (i.e, anatomical, functional, etc), task information, acquisition parameters, the run id, among others. The examples and diagram below show the parts of the BIDS name that you **need to pay attention when naming your series at the scanner**. These are only a subset of the full set defined by the BIDS specification. You can refer to the [Entity Table of the BIDS specification](https://bids-specification.readthedocs.io/en/stable/99-appendices/04-entity-table.html) for a full reference.

![Color coded examples of BIDS compliant protocols](/files/-MVMNi-UD8kK2WcPwfn4)

![Table on how to build series at the scanner for BIDS compliance](/files/-MVMNTMFZpC6GQv3dSR2)

{% hint style="info" %}
To create the final name, the different parts shown above are concatenated using underscores (\_)
{% endhint %}

## Additional Sample Protocols

```
anat-scout_acq-aascout
anat-scout_acq-localizer
anat-T1w_acq-memprage
fmap_acq-greAP
func-bold_task-TSSblock_acq-2dot4mmSMS4TR1200AP_run+
```

```
anat-scout_acq-localizer
anat-scout_acq-aascout
anat-t1w_acq-memprage
func-bold_task-lum_run+
dwi_acq-122_dir-ap
dwi_acq-b0_dir-pa
```

## Important considerations

### Scouts and Localizers

All **scout** and **localizer** sequences need to have a `scout` label. For example:

* `anat-scout_acq-localizer`
* `anat-scout_acq-aascout`

Scout series will remain in the `sourcedata` directory of your bids output, but will not be present in your `anat` folder.

### Incompatible symbols

Do not use "+", "\_", "-" or "." within SESID, TASKID, ACQLABEL, RUNID. The only exception is the use of `run+`

### Naming Runs

To indicate **runs** in your protocol, without explicitly indicating the run number, simply label the run as `run+`

### Cancelled Runs

If run was canceled you will need to skip that series when calling the BIDS exporting code `xnat2bids.` We encourage adding a note to that series in XNAT to indicate that the run was cancelled. This will improve bookkeeping and maintainability.

### Functional

Functional runs **must** have \_task- field defined

### MEMPRAGE

You can choose (on the scanner) whether to send each individual echo along with the RMS image. Regardless, this data should now be converted appropriately to BIDS format.

### Fieldmaps

Currently the **fieldmaps** collected with our Siemens scanner use the "old way" described in this [OSF documentation on field maps.](https://osf.io/2hjhx/wiki/Brain%20Imaging%20Data%20Structure%20\(BIDS\)/#LCNI_fieldmapshttpslcniuoregonedukbarticleskb0003_29)

### Scanner derivatives

Our xnat2bids software skips over the MRI sequences that are derivatives of the scanner and are not included in the BIDS specification. Refer to [the github fix regarding this function](https://github.com/brown-bnc/xnat-tools/issues/59) for more details).


---

# 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/xnat/bids-compliant-protocols.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.
