Learn R Programming

icaOcularCorrection (version 1.3)

icaDEN.fnc: Independent Components Analysis based eye-movement correction.

Description

Removes eye-movements artifacts as well as (a portion of) of other noise using the fastICA package. The correction methods is based on Flexer, Bauer, Pripfl, and Dorffner (2005). The first step is to decompose the EEG into indepedent components (ICs), then calculate the correlation between the EOG and each of the ICs. Any IC with a correlation at or above threshold (default is 0.4) is zeroed out and the EEG is then reconstructed.

Usage

icaDEN.fnc(object, epoch.length = NULL, method = "by.trial", 
electrodes = defineElectrodeSet.fnc(bottom.eye = NA)$electrodes, 
eogs = list(VEOG = c("BE", "TE"), HEOG = c("LC", "RC")), 
threshold = 0.4, n.comp = 16, ret.SAWK = TRUE, verbose = TRUE)

Arguments

object
A data frame containing EEG recordings (one electrode per column), as well as EOG channels (one per column) and a column with subject identifiers.
epoch.length
If performing by-trial correction, then supply the length of each trial in number of data points (e.g., 192, 179). If performing ICA correction on whole data at once, do not need this (set to NULL).
method
For one subject and one electrode, either perform "by-trial" correction (default) or correction on the whole vector ("all").
electrodes
Supply a vector of electrodes to be corrected. The default is a vector of electrode names supplied by defineElectrodeSet.fnc$electrodes.
eogs
The default is a list identifying which electrodes form the vertical EOG (VEOG) and the horizontal EOG (HEOG). Only one EOG can be supplied (e.g., list(VEOG = c("BE", "TE"))) or a vector containing the names of the EOG channels (e.g., c
threshold
The correlation threshold between EOG and IC. Default is 0.4. Can be set to anything between 0 (will zero-out every IC) and 1 (will most probably zero-out nothing).
n.comp
Number of components. Defaults to 16.
ret.SAWK
Return the S, A, W, and K matrices? Default is TRUE.
verbose
Whether you want to see a verbal indication of where in the process you are.

Value

  • eegThe data frame containing the corrected EEG.
  • snr.icaA matrix showing for each corrected electrode the siganl-to-noise ration.
  • thresholdThe correlation threshold at which the ICs were zeroed-out.
  • SThe estimated source matrix.
  • AThe estimated mixing matrix.
  • WThe estimated un-mixing matrix.
  • Kpre-whitening matrix that projects data onto th first n.comp principal components.

concept

  • EEG
  • electro-encephalogram
  • electroencephalogram
  • ERP
  • event-related potentials
  • event related potentials

References

Flexer, A., Bauer, H., Pripfl, J. & Dorffner, G. (2005). Using ICA for removal of ocular artifacts in EEG recorded from blind subjects. Neural Networks, 18, 998-1005.

See Also

defineElectrodeSet.fnc; eeg; den; batch.icaDEN.fnc; mc.batch.icaDEN.fnc; plotICs.fnc; batch.plotICs.fnc

Examples

Run this code
data(eeg)
head(eeg)
den=icaDEN.fnc(eeg, epoch.length = 192, method = 
    "by.trial", electrodes = c("Fp1", "Fp2", "AF3", 
    "AF4", "F7", "F3", "Fz", "F4", "F8", "FC5", 
    "FC1", "FC2", "FC6", "T7", "C3", "Cz", "C4", 
    "T8", "CP5", "CP1", "CP2", "CP6", "P7", "P3", 
    "Pz", "P4", "P8", "PO3", "PO4", "O1", "Oz", "O2"), 
    eogs = list(VEOG = c("BE", "TE"), HEOG = c("LC", 
    "RC")), threshold = 0.4, n.comp = 16, ret.SAWK = 
    TRUE, verbose = TRUE)
names(den)
den$snr.ica

Run the code above in your browser using DataLab