Skip to content
README.md 2.67 KiB
Newer Older
Julian Kosciessa's avatar
Julian Kosciessa committed
These scripts perform the preprocessing for the resting state EEG data described in Kosciessa et al. (2019, bioRxiv).
--
Julian Kosciessa's avatar
Julian Kosciessa committed

Julian Kosciessa's avatar
Julian Kosciessa committed
##### B_STSW_ImportEEG_rest
-	Import EEG data

##### C_STSW_prepare_preprocessing_rest
Julian Kosciessa's avatar
Julian Kosciessa committed
-	Prepare for ICA
-	Read into FieldTrip format
Julian Kosciessa's avatar
Julian Kosciessa committed
-	Switch channels (see note below)
Julian Kosciessa's avatar
Julian Kosciessa committed
-	EEG settings:
o	Referenced to avg. mastoid (A1, A2)
o	downsample: 1000Hz to 250 Hz
o	4th order Butterworth 1-100 Hz BPF
o	no reref for ECG

Julian Kosciessa's avatar
Julian Kosciessa committed
##### D_STSW_visual_inspection_for_ica_rest
Julian Kosciessa's avatar
Julian Kosciessa committed
-	Check for gross noise periods that should not be considered for ICA

Julian Kosciessa's avatar
Julian Kosciessa committed
##### D5_InspectChannelArrangement_v2
Julian Kosciessa's avatar
Julian Kosciessa committed
-	Check whether the correlational structure of the channels looks sensible. If not, there may have been problems with electrode placement.

Julian Kosciessa's avatar
Julian Kosciessa committed
##### E_STSW_ica1_rest
-	Conduct initial ICA1
Julian Kosciessa's avatar
Julian Kosciessa committed

Julian Kosciessa's avatar
Julian Kosciessa committed
##### F_STSW_ICA_labeling
Julian Kosciessa's avatar
Julian Kosciessa committed
-	Manual labeling of artefactual ICA components

Julian Kosciessa's avatar
Julian Kosciessa committed
##### G_STSW_segmentation_raw_data
-	Segmentation: XXX
Julian Kosciessa's avatar
Julian Kosciessa committed
-	Load raw data
-	Switch channels
-	EEG settings: 
o	Referenced to avg. mastoid (A1, A2)
o	0.2 4th order butterworth HPF
o	125 4th order butterworth LPF
o	demean
o	recover implicit reference: A2
Julian Kosciessa's avatar
Julian Kosciessa committed
o	downsample: 1000Hz to 500 Hz
Julian Kosciessa's avatar
Julian Kosciessa committed

Julian Kosciessa's avatar
Julian Kosciessa committed
##### H_STSW_automatic_artifact_correction
Julian Kosciessa's avatar
Julian Kosciessa committed
-	Automatic artifact correction, interpolation
-	Remove blink, move, heart, ref, art & emg ICA components prior to calculation
-	get artifact contaminated channels by kurtosis, low & high frequency artifacts
-	get artifact contaminated channels by FASTER
-	interpolate artifact contaminated channels
-	equalize duration of trials to the trial with fewest samples
-	get artifact contaminated epochs & exclude epochs recursively
-	get channel x epoch artifacts
-	Note that this does NOT yet remove anything. We only calculate the data to be removed in the next setp (I).

Julian Kosciessa's avatar
Julian Kosciessa committed
##### I_STSW_prep_data_for_analysis
Julian Kosciessa's avatar
Julian Kosciessa committed
-	Remove blink, move, heart, ref, art & emg ICA components
-	Interpolate detected artifact channels
-	Remove artifact-heavy trials, for subjects with missing onsets, the missing trials are included here as ‘artefactual trials’, hence correcting the EEG-behavior assignment:

Julian Kosciessa's avatar
Julian Kosciessa committed
Note that the channels A1 and FCz were generally exchanged in the BrainVisionRecorder. During some sessions, it was also apparent that the amplifiers had been switched. These channels have been switched based on visual inspection of the expected autocorrelation of neighboring channels. Note that this switching is only done AFTER the data are read into FieldTrip! The scripts that do the switching can be found in the directory A_scripts/helper/. C_STSW_prepare_preprocessing_rest contains the conditionals for what is switched in which subject. Visual inspection of ICAs indicated that the channel switch was successful, although outlier channels may still be slightly off.