BRAIN IMAGING

DATA STRUCTURE

The dataset for this tutorial is structured according to the Brain Imaging Data Structure (BIDS). BIDS is a simple and intuitive way to organize and describe your neuroimaging and behavioral data. Neuroimaging experiments result in complicated data that can be arranged in many different ways. So far there is no consensus on how to organize and share data obtained in neuroimaging experiments. BIDS tackles this problem by suggesting a new standard for the arrangement of neuroimaging datasets.

The idea of BIDS is that the file and folder names follow a strict set of rules:

Using the same structure for all of your studies will allow you to easily reuse all of your scripts between studies. But additionally, it also has the advantage that sharing code with and using scripts from other researchers will be much easier.

# Tutorial Dataset¶

For this tutorial, we will be using a subset of the fMRI dataset (ds000114) publicly available on openfmri.org. If you're using the suggested Docker image you probably have all data needed to run the tutorial within the Docker container. If you want to have data locally you can use Datalad to download a subset of the dataset, via the datalad repository. In order to install dataset with all subrepositories you can run:

In [ ]:
%%bash
cd /data

install(notneeded): /data/ds000114 (dataset) [dataset <Dataset path=/data/ds000114> was already cloned from 'http://datasets.datalad.org/workshops/nih-2017/ds000114']
install(notneeded): derivatives/fmriprep (dataset)
install(notneeded): derivatives/freesurfer (dataset)
action summary:
get (notneeded: 2)
install (notneeded: 3)

[INFO] Installing <Dataset path=/data/ds000114> recursively


In order to download data, you can use datalad get foldername command, to download all files in the folder foldername. For this tutorial we only want to download part of the dataset, i.e. the anatomical and the functional fingerfootlips images:

In [ ]:
%%bash
cd /data/ds000114
datalad get -J 4 /data/ds000114/derivatives/fmriprep/sub-*/anat/*preproc.nii.gz \
/data/ds000114/sub-01/ses-test/anat \
/data/ds000114/sub-*/ses-test/func/*fingerfootlips*

get(notneeded): /data/ds000114/sub-01/ses-test/func/sub-01_ses-test_task-fingerfootlips_bold.nii.gz (file) [already present]
action summary:
get (notneeded: 30)


So let's have a look at the tutorial dataset.

In [ ]:
ls /data/ds000114

CHANGES                   sub-08/
dataset_description.json  sub-09/
derivatives/              sub-10/

In [ ]:
ls /data/ds000114/sub-01/ses-test/*

/data/ds000114/sub-01/ses-test/anat:
sub-01_ses-test_T1w.nii.gz@

/data/ds000114/sub-01/ses-test/dwi:
sub-01_ses-test_dwi.nii.gz@

/data/ds000114/sub-01/ses-test/func:


As you can, for every subject we have one anatomical T1w image, five functional images, and one diffusion weighted image.

Note: If you used datalad or git annex to get the dataset, you can see symlinks for the image files.

Subject from the ds000114 dataset did five behavioral tasks. In our dataset two of them are included.

The motor task consisted of finger tapping, foot twitching and lip pouching interleaved with fixation at a cross.

The landmark task was designed to mimic the line bisection task used in neurological practice to diagnose spatial hemineglect. Two conditions were contrasted, specifically judging if a horizontal line had been bisected exactly in the middle, versus judging if a horizontal line was bisected at all. More about the dataset and studies you can find here.

To each of the functional images above, we therefore also have a tab-separated values file (tva), containing information such as stimuli onset, duration, type, etc. So let's have a look at one of them:

In [ ]:
%%bash
cd /data/ds000114

get(ok): /data/ds000114/sub-01/ses-test/func/sub-01_ses-test_task-linebisection_events.tsv (file) [from origin...
checksum...]

In [ ]:
!cat /data/ds000114/sub-01/ses-test/func/sub-01_ses-test_task-linebisection_events.tsv

onset	duration	weight	trial_type
56.973	1	1.0	Response_Control
58.613	1	1.0	No_Response_Control
60.253	1	1.0	Response_Control
61.893	1	1.0	No_Response_Control
63.533	1	1.0	Response_Control
65.173	1	1.0	Response_Control
66.8129	1	1.0	Response_Control
68.4529	1	1.0	Response_Control
70.0929	1	1.0	Response_Control
71.7329	1	1.0	No_Response_Control
122.306	1	1.0	Response_Control
123.946	1	1.0	No_Response_Control
125.586	1	1.0	Response_Control
127.226	1	1.0	Response_Control
128.866	1	1.0	Response_Control
130.506	1	1.0	No_Response_Control
132.146	1	1.0	Response_Control
133.786	1	1.0	Response_Control
135.4259	1	1.0	No_Response_Control
137.0659	1	1.0	Response_Control
187.639	1	1.0	Response_Control
189.279	1	1.0	Response_Control
190.919	1	1.0	Response_Control
192.559	1	1.0	No_Response_Control
194.199	1	1.0	Response_Control
195.839	1	1.0	Response_Control
197.479	1	1.0	No_Response_Control
199.119	1	1.0	Response_Control
200.759	1	1.0	Response_Control
202.399	1	1.0	No_Response_Control
252.9721	1	1.0	Response_Control
254.612	1	1.0	Response_Control
256.252	1	1.0	Response_Control
257.892	1	1.0	Response_Control
259.532	1	1.0	No_Response_Control
261.172	1	1.0	Response_Control
262.812	1	1.0	Response_Control
264.452	1	1.0	No_Response_Control
266.092	1	1.0	Response_Control
267.732	1	1.0	No_Response_Control
318.3051	1	1.0	Response_Control
319.9451	1	1.0	Response_Control
321.5851	1	1.0	Response_Control
323.2251	1	1.0	Response_Control
324.865	1	1.0	No_Response_Control
326.505	1	1.0	Response_Control
328.145	1	1.0	Response_Control
329.785	1	1.0	No_Response_Control
331.425	1	1.0	Response_Control
333.065	1	1.0	No_Response_Control
383.6381	1	1.0	Response_Control
385.2781	1	1.0	Response_Control
386.9181	1	1.0	Response_Control
388.5581	1	1.0	Response_Control
390.1981	1	1.0	No_Response_Control
391.8381	1	1.0	Response_Control
393.478	1	1.0	Response_Control
395.118	1	1.0	No_Response_Control
396.758	1	1.0	Response_Control
398.398	1	1.0	Response_Control
448.9711	1	1.0	Response_Control
450.6111	1	1.0	No_Response_Control
452.2511	1	1.0	Response_Control
453.8911	1	1.0	No_Response_Control
455.5311	1	1.0	Response_Control
457.1711	1	1.0	Response_Control
458.8111	1	1.0	Response_Control
460.4511	1	1.0	Response_Control
462.091	1	1.0	Response_Control
463.731	1	1.0	No_Response_Control