Finger tapping pipeline
Familiarise yourself with the generic pipeline first.
Preprocess EEG Data
Setup your workspace
- Create three folders in a directory, name them as follow
export: this will contain exported data from analysis pipeline
history: this will contain all processing steps
raw: put your raw .eeg, .vhdr, .vmrk here
Open BrainVision Analyzer
- Press New then set the Raw, History and Export to the created folders above
your workspace is saved in a .wksp
You should now see the datasets as folders in your Primary view
EEG data triggers
The EEG data from an EEG/fMRI experiment should have the following trigger signals
Sync On of marker type Sync Status is a marker repeated every period of time ensuring that the MRI clock and EEG system are in sync
T 1_off of marker type Toggle is a marker
One TR (repetition time) corresponds to T 1_off - T 1_on.
Paradigm-based triggers scripted from your experiment, for the finger-tapping experiment we programmed the S1 marker to appear
Preprocess fMRI Data
The fMRI data from the MRI scanner at NYUAD is in dicom format and will undergo multiple steps below:
conversion from dicom to BIDS
fMRIprep output
fMRIprep outputs a directory, where the required fMRI data is found under
/derivatives/fmriprep/sub-xyz/ses-01/func
The output of fMRIprep pipeline is a .gii found in the above directory.
GLM learning from fMRIprep output
- Learning a General Linear Model assumes that the observed data \(Y\) can be explained as a linear transformation of \(X\) and some random noise \(\epsilon\)
this is plausible when the conditions should activate different areas of your brain
- the GLM is learned per voxel or volume unit of a surface of interest
- two ways we can think of:
learning one GLM for each voxel of the whole brain
learning one GLM for each volume unit of the grey matter surface of the brain
\[Y = X.\beta + \epsilon\]- where
- \(Y\) is a matrix \(n\times k\)
where \(n\) is the number of TR’s \(k\) is the number of voxels
the order of the row values \(n\) should be chronological
Remind that each value of the BOLD signal lasts for a TR time (in ms)
- \(n\),is the length of \(Y\) corresponds to the number of BOLD signal values obtained during the acquisition
if the experiment is 20 blocks, each block of duration 10 seconds then \(n = (20 \times 10) / TR\)
- \(X\) is an \(n\times m\), binary matrix where \(m\) is the number of predictors (conditions + noise reduction regressors)
\(X\) aside from the conditions contains also vectors from the output of fmriprep that contains motion regressor (vector) and a drift cancelling (vector)
a cell at row k \(X\) has a 0 if the condition offset (means the stimulus is not present during this TR at row k)
a cell at row k of \(X\) has a 1 if the condition onset (means the stimulus is present during this TR at row k)
- \(\beta\) is a matrix of size \(m\times k\), corresponding to the weights learnt for all voxels
for a single voxel, the weights are the same across the different TR’s
the weights are different for each voxel (we can see this as learning multiple GLM’s, one per voxel)
- \(\epsilon\) is the part of \(Y\) that cannot be interpreted as a linear combination of \(X\)
it represents the average noise at each BOLD value acquisition, and is therefore of size \(n\)
assuming that the model would explain well the observed data when this model is a simple linear transformation, we would consequently like to find \(\beta\) for which \(\epsilon\) is minimal
- The design matrix \(X\) of the finger-tapping experiment will have the following columns used as regressors:
involves five conditions (thumb, index, middle, ring, pinkie)
- additional regressors output by fmriprep:
drift vector (a sequence of 1, 2, 3,…, n)
movement accounting vector (size n)