# data-steps

dataSpec describes the criteria used to find data if searching a database (NiDB for example, since this pipeline is usually connected to a database). The dataSpec is a JSON array 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_Ez2so9rBDeh6nWaGxFhItHdWEwINGIxqUztILPaGCccpF4YSSYDo6iRcD3M-m651RrQYJdWeFpX2UxDCue0Ztu_3CwltHEfMxDoxrufAdnMcbhNpaNN8QNmPpZXCDFdL5tG-xh6-ikR6MgrU_juDcD__TY4_T7ubzoSS9CxdkoLGlqMMdBRmh8UYCFc7DOtR2ONpeRjDadjUmI5f4FWs2K0t8WK2WPmvUHlMOtgJjoGP34076utHsum4oY7Msy846_RHcVSzTB7IkDZoGBPfP8xiWy4mrsMGcMC85ltDWLie5PHm01X5r-MyFU4awEmqLSwKtU5tOFoQ502KEngT4196MlH8rn0rF-PQL6OkObw?type=png" alt=""><figcaption></figcaption></figure>

### JSON variables

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

<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>AssociationType</code></td><td>string</td><td><span data-gb-custom-inline data-tag="emoji" data-code="1f534">🔴</span></td><td>[<mark style="color:red;"><strong>Search</strong></mark>] <code>study</code>, or <code>subject</code>.</td></tr><tr><td align="right"><code>BehavioralDirectory</code></td><td>string</td><td></td><td>[<mark style="color:green;"><strong>Export</strong></mark>] if <code>BehFormat</code> writes data to a sub directory, the directory should be named this.</td></tr><tr><td align="right"><code>BehavioralDirectoryFormat</code></td><td>string</td><td></td><td>[<mark style="color:green;"><strong>Export</strong></mark>] <code>nobeh</code>, <code>behroot</code>, <code>behseries</code>, <code>behseriesdir</code></td></tr><tr><td align="right"><code>DataFormat</code></td><td>string</td><td><span data-gb-custom-inline data-tag="emoji" data-code="1f534">🔴</span></td><td>[<mark style="color:green;"><strong>Export</strong></mark>] <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>Enabled</code></td><td>bool</td><td><span data-gb-custom-inline data-tag="emoji" data-code="1f534">🔴</span></td><td>[<mark style="color:red;"><strong>Search</strong></mark>] <code>true</code> if the step is enabled, <code>false</code> otherwise</td></tr><tr><td align="right"><code>Gzip</code></td><td>bool</td><td></td><td>[<mark style="color:green;"><strong>Export</strong></mark>] <code>true</code> if converted Nift data should be g-zipped, <code>false</code> otherwise.</td></tr><tr><td align="right"><code>ImageType</code></td><td>string</td><td></td><td>[<mark style="color:red;"><strong>Search</strong></mark>] Comma separated list of image types, often derived from the DICOM ImageType tag, (0008:0008).</td></tr><tr><td align="right"><code>DataLevel</code></td><td>string</td><td><span data-gb-custom-inline data-tag="emoji" data-code="1f534">🔴</span></td><td>[<mark style="color:red;"><strong>Search</strong></mark>] <code>nearestintime</code>, <code>samestudy</code>. Where is the data coming from.</td></tr><tr><td align="right"><code>Location</code></td><td>string</td><td></td><td>[<mark style="color:green;"><strong>Export</strong></mark>] Directory, relative to the <code>analysisroot</code>, where this data item will be written.</td></tr><tr><td align="right"><code>Modality</code></td><td>string</td><td><span data-gb-custom-inline data-tag="emoji" data-code="1f534">🔴</span></td><td>[<mark style="color:red;"><strong>Search</strong></mark>] Modality to search for.</td></tr><tr><td align="right"><code>NumberBOLDreps</code></td><td>string</td><td></td><td>[<mark style="color:red;"><strong>Search</strong></mark>] If <code>SeriesCriteria</code> is set to <code>usecriteria</code>, then search based on this option.</td></tr><tr><td align="right"><code>NumberImagesCriteria</code></td><td>string</td><td></td><td>[<mark style="color:red;"><strong>Search</strong></mark>] </td></tr><tr><td align="right"><code>Optional</code></td><td>bool</td><td><span data-gb-custom-inline data-tag="emoji" data-code="1f534">🔴</span></td><td>[<mark style="color:red;"><strong>Search</strong></mark>] <code>true</code> if this data step is option. <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>Order</code></td><td>number</td><td><span data-gb-custom-inline data-tag="emoji" data-code="1f534">🔴</span></td><td>The numerical order of this data step.</td></tr><tr><td align="right"><code>PreserveSeries</code></td><td>bool</td><td></td><td>[<mark style="color:green;"><strong>Export</strong></mark>] <code>true</code> to preserve series numbers or <code>false</code> to assign new ordinal numbers.</td></tr><tr><td align="right"><code>PrimaryProtocol</code></td><td>bool</td><td></td><td>[<mark style="color:red;"><strong>Search</strong></mark>] <code>true</code> if this data step determines the primary study, from which subsequent analyses are run.</td></tr><tr><td align="right"><code>Protocol</code></td><td>string</td><td><span data-gb-custom-inline data-tag="emoji" data-code="1f534">🔴</span></td><td>[<mark style="color:red;"><strong>Search</strong></mark>] Comma separated list of protocol name(s).</td></tr><tr><td align="right"><code>SeriesCriteria</code></td><td>string</td><td><span data-gb-custom-inline data-tag="emoji" data-code="1f534">🔴</span></td><td>[<mark style="color:red;"><strong>Search</strong></mark>] 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>UsePhaseDirectory</code></td><td>bool</td><td></td><td>[<mark style="color:green;"><strong>Export</strong></mark>] <code>true</code> to write data to a sub directory based on the phase encoding direction.</td></tr><tr><td align="right"><code>UseSeriesDirectory</code></td><td>bool</td><td></td><td>[<mark style="color:green;"><strong>Export</strong></mark>] <code>true</code> to write each series to its own directory, <code>false</code> to write data to the root export directory.</td></tr></tbody></table>


---

# 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.neuroinfodb.org/nidb/contribute/squirrel-data-sharing-format/specification-v1.0/pipelines/data-steps.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.
