> 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/specification-v1.0/pipelines/data-steps.md). Agents can also search and read this documentation through its [MCP server](https://docs.neuroinfodb.org/squirrel/~gitbook/mcp).

# data-steps

JSON array

Data steps describe the criteria used to find data if searching a database (NiDB for example, since this pipeline is usually connected to a database). `data-steps` is a JSON array, stored in each [pipeline](https://docs.neuroinfodb.org/squirrel/specifications/specification-v1.0/pipelines.md), of the following variables. <mark style="color:red;">**Search**</mark> variables specify how to find data in a database, and <mark style="color:green;">**Export**</mark> variables specify how the data is exported.

<figure><img src="https://mermaid.ink/img/pako:eNptklFrwyAQx79KsBQsNKOM7MVBn7aXMTZY30ZervHSuCYqaraG0u8-TWrWZs1D_J_3O_-eeiSF4kgY2RnQVfL6kcvEf0YpR18272-9WqTpmoMDGn6Lxz_Ez2so9rBDeh7nWa6w5QINjWpG4EGh5h0Ka-iFnlHeOGO8slwK0AOdxcsJHmez9U7LXoGAdjDc0DFKQhjWPaOm335i5ayDCPkQe8b2jLsOzuMVQm4N6i_wmzH0MrjCcmFd2rU4wn-iSE9G3todh3ceh__p2OO8u8ViKslu_QVp6EzNW39HXgYo3oin_HkYi8pMRzvKAAbbocUkcolbsS1u6rpOXUrLPWYMTANaw1DcXZZEn1iC96tVOhUVN3men3X2zZltilwdSEo61B1w5l7m0S9WEttghyUpnGRYQ9_akpTi5NBeuV3hE-NWalLU0BpMCfRWbgZRkcLqHgP0yME99C5S7pl8SBni0w9HOA2R?type=png" alt=""><figcaption></figcaption></figure>

### JSON variables

:blue\_circle: Primary key\
:red\_circle: Required

Pipeline data steps are separated into **Search** variables which describe how to find the data for the step, and **Export** variables which describe how the data is exported on disk to the pipeline.

<table data-full-width="true"><thead><tr><th width="298" align="right">Variable</th><th width="114">Type</th><th width="91">Default</th><th>Description</th></tr></thead><tbody><tr><td align="right"><code>StepNumber</code></td><td>number</td><td><span data-gb-custom-inline data-tag="emoji" data-code="1f534">🔴</span> <span data-gb-custom-inline data-tag="emoji" data-code="1f535">🔵</span></td><td>The numerical order of this data step.</td></tr><tr><td align="right"><code>FlagIsEnabled</code></td><td>bool</td><td><span data-gb-custom-inline data-tag="emoji" data-code="1f534">🔴</span></td><td><code>true</code> if the step is enabled, <code>false</code> otherwise.</td></tr><tr><td align="right"><code>FlagIsOptional</code></td><td>bool</td><td><span data-gb-custom-inline data-tag="emoji" data-code="1f534">🔴</span></td><td><code>true</code> if this data step is optional. <code>false</code> if this step is required and the analysis will not run if the data step is not found.</td></tr><tr><td align="right"><code>FlagIsPrimaryProtocol</code></td><td>bool</td><td></td><td><code>true</code> if this data step determines the primary study, from which subsequent analyses are run. <code>false</code> otherwise.</td></tr><tr><td align="right"><code>SearchAssociationType</code></td><td>string</td><td><span data-gb-custom-inline data-tag="emoji" data-code="1f534">🔴</span></td><td><code>study</code>, or <code>subject</code>.</td></tr><tr><td align="right"><code>SearchDataLevel</code></td><td>string</td><td><span data-gb-custom-inline data-tag="emoji" data-code="1f534">🔴</span></td><td>Where is the data coming from. <code>nearestintime</code>, <code>samestudy</code>.</td></tr><tr><td align="right"><code>SearchImageType</code></td><td>string</td><td></td><td>Comma separated list of image types, often derived from the DICOM ImageType tag, (0008:0008).</td></tr><tr><td align="right"><code>SearchModality</code></td><td>string</td><td><span data-gb-custom-inline data-tag="emoji" data-code="1f534">🔴</span></td><td>Modality to search for.</td></tr><tr><td align="right"><code>SearchNumberBOLDreps</code></td><td>string</td><td></td><td>If <code>SearchSeriesCriteria</code> is set to <code>usecriteria</code>, then search based on this option.</td></tr><tr><td align="right"><code>SearchProtocol</code></td><td>string</td><td><span data-gb-custom-inline data-tag="emoji" data-code="1f534">🔴</span></td><td>Comma separated list of protocol name(s). Protocol names with spaces must be "quoted".</td></tr><tr><td align="right"><code>SearchSeriesCriteria</code></td><td>string</td><td><span data-gb-custom-inline data-tag="emoji" data-code="1f534">🔴</span></td><td>Criteria for which series are downloaded if more than one matches criteria: <code>all</code>, <code>first</code>, <code>last</code>, <code>largest</code>, <code>smallest</code>, <code>usecriteria</code>.</td></tr><tr><td align="right"><code>ExportBehavioralDirectoryFormat</code></td><td>string</td><td></td><td><code>nobeh</code>, <code>behroot</code>, <code>behseries</code>, <code>behseriesdir</code></td></tr><tr><td align="right"><code>ExportBehavioralDirectoryName</code></td><td>string</td><td></td><td>If <code>ExportBehavioralDirectoryFormat</code> writes data to a sub-directory, the directory should be named this.</td></tr><tr><td align="right"><code>ExportDataFormat</code></td><td>string</td><td><span data-gb-custom-inline data-tag="emoji" data-code="1f534">🔴</span></td><td><code>native</code>, <code>dicom</code>, <code>nifti3d</code>, <code>nifti4d</code>, <code>analyze3d</code>, <code>analyze4d</code>, <code>bids</code>.</td></tr><tr><td align="right"><code>ExportSubDirectoryName</code></td><td>string</td><td></td><td>Directory, relative to the <code>analysisroot</code>, where this data item will be written.</td></tr><tr><td align="right"><code>FlagExportGzip</code></td><td>bool</td><td></td><td><code>true</code> if Nifti data should be gzipped, <code>false</code> otherwise.</td></tr><tr><td align="right"><code>FlagExportPreserveSeriesNumber</code></td><td>bool</td><td></td><td><code>true</code> to preserve series numbers in directory names or <code>false</code> to assign new ordinal numbers.</td></tr><tr><td align="right"><code>FlagExportWritePhaseDirectory</code></td><td>bool</td><td></td><td><code>true</code> to write data to a sub directory based on the phase encoding direction.</td></tr><tr><td align="right"><code>FlagExportWriteSeriesDirectory</code></td><td>bool</td><td></td><td><code>true</code> to write each series to its own numbered directory, <code>false</code> to write all series data to the root export directory.</td></tr></tbody></table>


---

# 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/specification-v1.0/pipelines/data-steps.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.
