-
Notifications
You must be signed in to change notification settings - Fork 2
37. EEG MRI analysis
Here are details of processing MRI and EEG data for the steady-state visual evoked potentials (SSVEP) experiment. Sample data are provided here.
Reconstruct brain structure using FreeSurfer and T1-weighted MRI (MPRAGE sequence) data. Details are here.
Follow the instruction here for fMRI data pre-processing, including the following
- convert meas.dat into Matlab mat files
- register between fMRI and structural MRI. See this page for details.
- prepare fMRI data on brain surfaces
The fMRI analysis using Genearal Linear Model can be found here.
EEG pre-processing includes
- suppress gradient and pulse artifacts.
- calculate event-related potentials (for event-related design).
To do EEG source anaylysis, follow the procedure here.
Each session of EEG recording use the Brain Products amplifier gave three files: .vmrk, .vhdr, and .eeg files. You need all three files to process one session of EEG. NOTE: file names cannot be arbitrarily changed because data in the file were linked to the file name.
For example, for subject `180330_SYH', SSVEP_out_1.eeg, SSVEP_out_1.vhdr, and SSVEP_out_1.eeg together completed the recording of EEG outside MRI.
In the SSVEP experiment, EEG recordings for three conditions were taken:
- EEG recorded outside MRI: consequently no MRI gradient and pulse artifacts. This condition is coded by "outside MRI".
- EEG recorded inside MRI bore but no MRI were taken: consequently no MRI gradient but with pulse artifacts. This condition is coded by "inside MRI".
- EEG recorded outside MRI: consequently with both MRI gradient and pulse artifacts. This condition is coded by "SMS-InI"
Subject | 180330_SYH | 180401_YTH | 180411_PYY |
---|---|---|---|
Outside MRI | SSVEP_out_1 | SSVEP_out_1 | SSVEP_out_1 |
Inside MRI | SSVEP_noMR_1, SSVEP_noMR_2, SSVEP_noMR_3 | SSVEP_noMR_1, SSVEP_noMR_2, SSVEP_noMR_3 | SSVEP_noMR_1, SSVEP_noMR_2, SSVEP_noMR_3 |
SMS-InI. | SSVEP_sms_1, SSVEP_sms_2, SSVEP_sms_3 | SSVEP_sms_1, SSVEP_sms_2, SSVEP_sms_3 | SSVEP_sms_1, SSVEP_sms_2, SSVEP_sms_3 |
The following codes read EEG data from one session (outside MRI). NOTE: bvloader tooolbox is needed. Please download it and make it within your Matlab path.
close all; clear all;
headerFile={
'../eeg_raw/SSVEP_out_1.vhdr';
};
% first get the continuous data as a matlab array
eeg{1} = double(bva_loadeeg(headerFile{1}));
% meta information such as samplingRate (fs), labels, etc
[fs(1) label meta] = bva_readheader(headerFile{1}
The variable eeg[1}
is the data. fs(1)
is the sample rate. label
describes the names for EEG electrodes.
EEG traces can be visualized with the following codes:
etc_trace(eeg{1},'fs',fs(1),'ch_names',label);
EEG recording of 30-s interval with electrode names will be shown.
ERPs are calculated following the following major steps:
- Gradient artifact removal: ONLY for data collected during MRI. Remove the large EEG signals caused by MRI gradient coil switching during MRI generation.
- High-pass filtering (default: 1 Hz): remove any slow fluctuations (< 1 Hz).
- Time series truncation (optional): remove some parts of the data, which may lack important timing stamps required for data analysis
- Gradient artifact removal: ONLY for data collected inside the MRI bore. Remove the large EEG signals caused by heartbeats and breathing inside a strong magnetic field.
- Re-reference (optional): remove the average across all EEG electrodes
- Low-pass filtering (default: 70 Hz): remove any fast fluctuation (> 70 Hz).
- Estimate the ERP using the data collected outside MRI: 1.1 Read EEG data with processing options: [read_outside_eeg_042124.m].
1.2 Get ERP by averaging "epochs" of processed EEG waveform over trials: [read_outside_eeg_042124.m].
- Render the evoked response topology and time course: [show_erp_scalp.m]. This script needs a EEG topology definition for 31-channel Brain Products EEG [topology_31ch_default.mat] for the definition of EEG electrode locations and a head model.