README.md 2.72 KB
Newer Older
Julian Kosciessa's avatar
Julian Kosciessa committed
1
2
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
3

Julian Kosciessa's avatar
Julian Kosciessa committed
4
5
6
7
##### B_STSW_ImportEEG_rest
-	Import EEG data

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

Julian Kosciessa's avatar
Julian Kosciessa committed
17
##### D_STSW_visual_inspection_for_ica_rest
Julian Kosciessa's avatar
Julian Kosciessa committed
18
-	Visual labeling of gross noise periods that should not be considered for ICA
Julian Kosciessa's avatar
Julian Kosciessa committed
19

Julian Kosciessa's avatar
Julian Kosciessa committed
20
##### D5_InspectChannelArrangement_v2
Julian Kosciessa's avatar
Julian Kosciessa committed
21
22
-	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
23
24
##### E_STSW_ica1_rest
-	Conduct initial ICA1
Julian Kosciessa's avatar
Julian Kosciessa committed
25

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

Julian Kosciessa's avatar
Julian Kosciessa committed
29
30
##### G_STSW_segmentation_raw_data
-	Segmentation: XXX
Julian Kosciessa's avatar
Julian Kosciessa committed
31
32
33
-	Load raw data
-	Switch channels
-	EEG settings: 
Julian Kosciessa's avatar
Julian Kosciessa committed
34
35
36
37
38
39
    -	Referenced to avg. mastoid (A1, A2)
    -	0.2 4th order butterworth HPF
    -	125 4th order butterworth LPF
    -	demean
    -	recover implicit reference: A2
    -	downsample: 1000Hz to 500 Hz
Julian Kosciessa's avatar
Julian Kosciessa committed
40

Julian Kosciessa's avatar
Julian Kosciessa committed
41
##### H_STSW_automatic_artifact_correction
Julian Kosciessa's avatar
Julian Kosciessa committed
42
43
44
45
46
47
48
49
-	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
Julian Kosciessa's avatar
Julian Kosciessa committed
50
-	Note that this does NOT yet remove anything. We only calculate the data to be removed in the next step (I).
Julian Kosciessa's avatar
Julian Kosciessa committed
51

Julian Kosciessa's avatar
Julian Kosciessa committed
52
##### I_STSW_prep_data_for_analysis
Julian Kosciessa's avatar
Julian Kosciessa committed
53
54
55
56
-	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
57
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.