> For the complete documentation index, see [llms.txt](https://bridge-lab.gitbook.io/docs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://bridge-lab.gitbook.io/docs/imaging/data-organization/general-documentation/data-first-steps.md).

# Data - First Steps

The first step in any image analysis pipeline is actually acquiring the data. After data is acquired at the scanner, it is pushed to a server called CBIHome.

<figure><img src="https://2091072347-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FiDgWwNd2W0ZWe2XnzLuq%2Fuploads%2FEojDQDe0Hb5Na2SqBadK%2Fcbi%20workflow.png?alt=media&amp;token=9838feaa-ec52-4ae5-8280-71cab7221e6c" alt="" width="563"><figcaption></figcaption></figure>

[You can read more about this process via the linked PowerPoint made by the CBI](https://medicine.musc.edu/-/sm/medicine/departments/centers/cbi/f/cbimridataflow20210421.pdf).

## 1. Downloading scan data from CBIHome

* Open Filezilla (or the FTP software of your choice)
* Enter the address to CBIHome (sftp\://cbihome.musc.edu), as well as your NetID and password
* Navigate to the top level directory, then to MRData, then to your PI's folder, then to the study folder of your choice
* Download scans of your choice
  * Note that you can set the output destination for your downloads - set this to the folder on your desktop in which you will organize your newly downloaded data

## 2. Unzipping dicom folders

* You can unzip newly downloaded dicom folders in one of two ways:
  * Manually unzip the folders by double clicking (on Mac) or right clicking and extracting (on Windows)
  * Automate the unzipping process with a command line tool such as the bash tool 'unzip'.
    * See <https://bridge-lab.gitbook.io/docs/general/onboarding/research-specialist-training#id-5.-workspace-setup> for more details
    * To use bash unzip, open a Terminal and pass the following commands:

```bash
cd [filezilla download directory]
find . -type f -name '*.zip' -exec unzip {} \;
```

## 3. Sorting dicoms by sequence type

In order to access dicoms in a manageable way, they need to be sorted. This is done by looking at dicom meta data and sorting each dicom file based on a piece of meta data. There are many tools that allow a user to do this, such as simple-dicom-sort ( see <https://bridge-lab.gitbook.io/docs/general/onboarding/research-specialist-training#id-5.-workspace-setup> for more details).&#x20;

Our study dicoms are typically sorted by series/sequence name - the name of the type of scan to which the dicoms belong. Below is the simple-dicom-sort command to sort a set of dicoms. This can be placed into a for-loop in bash to sort many subjects' dicoms at once.

```bash
dicom_sort [input] [output] %SeriesName%
```

## 4. Convert to nifti and BIDS format

See [BIDS Data Organization](/docs/imaging/data-organization/general-documentation/bids-data-organization.md).
