KBB rsEEG Preprocessing (Manually) - LeoLedesma237/LeoWebsite GitHub Wiki

Overview

The listed scripts do the following to the resting-state EEG (rsEEG) data.

  • Part 1: Load in the data
  • Part 2: Getting to know the data
  • Part 3: Filter the data (1-45 Hz)
  • Part 4: Re-reference (TP9, TP10)
  • Part 5: Interpolating noisy channels
  • Part 6: Segmentation rejection
  • Part 7: Running ICA
  • Part 8: Removing blink components
  • Part 9: Documenting the steps
  • Part 10: Saving cleaned EEG data

Part 1: Load in the data

  • These steps work specifically for BrainVision recordings. EEG recordings with other software will require different steps (ex: ONR .xdf files).
  • This also seems to load in channel information automatically.

Loading BrainVision Files

Part 2: Getting to know our data (one data recording)

  • 31 Channels were loaded (is consistent with the .vhdr file; Pz is the reference so it is not counted)
  • Sampling rate is 500 Hz (500 data points recorded in a second)
  • Epochs is equal to 1. This means the data is continuous- there are no segments.
  • Epoch end (sec) is 181. Divide this number by 60 and we get 3 minutes.
  • Frames per epoch is 90920. This number is calculated by multiplying 500 by the number of seconds (181 x 500 = ~90920).
  • Reference is unknown because we have not re-reference the data yet. We do know already that Pz was the reference electrode during the dry-EEG recording.
  • ICA weights are set to 'No' because ICA has not been run yet.
  • Dataset size (Mb) indicates how large the recording is. 12.8 Mb is pretty small, I have several stat textbooks saved as PDFs that are 2-4 times larger than this.

Get to know our data

Part 3: Filter the data

  • 1 - 45 Hz

Filtering the data

Part 4: Re-reference

  • TP9 and TP10
  • The channel numbers coincide with the .vhdr file
  • Notice after doing this the Reference row will be changed to Yes

Re-reference the data

Part 5: Check for noisy channels and interpolate them

  • There are two ways to investigate for noisy channels. Both give the same information. The first is comparing the signals of each channel to each other in the recording. The other is calculating the power spectra of each channel and comparing those to each other. The signals that tend to deviate too much from the rest are considered noisy and should be interpolated.

Investigate using scrolling

Investigating Noisy Channels (Scroll)

Investigate using spectra and maps

Investigating Noisy Channels (Spectra and Maps)

  • Save the channel names in a separate excel file for each EEG recording.

Interpolation Noisy Channels

Part 6: Segmentation rejection

  • Set viewer to 120 microVolts
  • Remove segments of data that look noisy. However, if the noise seems to be blink related then leave that in.
  • Record the EEG recording length before and after segmentation rejection in a separate excel sheet.

Segmentation Rejection

Part 7: Running ICA

Decomposing data by ICA

  • Must manually enter 'pca' argument plus the number after it. This number will be equal to the starting number of channels, minus the number of channels used for a reference (the value is 1 if re-reference to the whole head), minus the number of channels interpolated.
  • Notice after doing this the ICA weights will be changed to Yes

Decomposing data by ICA Part 2

Part 8: Removing blink components

Inspect or label components

  • Flag the components that look like blinks.

Blink Components

  • Must remove the flagged components.

Remove Components

Part 9: Documenting the cleaning steps

  • This is an example of what the excel sheet recording all of this information would look like.

Excel Sheet Tracker

Part 10: Save the EEG data

Notice the following about our saved data

  • 2 channels were 'lost' due to them being re-referenced
  • There are 3 events now. These represent 'boundary' events that show in the data were a segment was removed from the data.
  • The sampling rate was kept at 500 Hz
  • The length of the recording was reduced by ~2 seconds.
  • TP9 and TP10 were used for re-referencing
  • ICA was conducted
  • The dataset became larger (probably due to ICA)

Saving EEG data