Skip to main content
  • Description
  • Removes artefact (usually eye blink or movement) on continuous EEG (MEG) data by computing linear regression. This programs first detects for artefact on the regressor channel(s). If an artefact is detected in the epoch, the linear regression is applied. The detection and correction are done on epochs defined by the parameter and event files. The output EEG file contains all concatenated epochs (corrected or not if no artefact detection). The epoch from rejected events are excluded from output file.

  • Usage
  • eegregress myeegfilein.eeg myeventfile.pos myparameterfile.par myeegfileout.eeg

    with :

    • myeegfilein.eeg: input .eeg file to correct (with extension).
    • myeventfile.pos: input event file (with extension) used for data epoching.
    • myparameterfile.par: text file (with extension) containing computing parameters.
    • myeegfileout.eeg: output EEG file (with extension) containing concatenated corrected epoched data.


  • Fields of parameter file and examples
  • regress_channel 0 1 1 1 1 1 1 1 0 0 List of the channels to correct: 1/0 for select/unselected channels; the total number of flags is N+2, N being the number of recorded channels in myeegfilein.eeg file; the last 2 flags should be set to 0.
    In this example, N=8, and channels number 2 to 8 will be corrected and stored in the output EEG file.
    regressor_channel 1 0 0 0 0 0 0 0 0 0 List of the channels to use as regressor: 1/0 for select/unselected channels; the total number of flags is N+2, N being the number of recorded channels in myeegfilein.eeg file; the last 2 flags should be set to 0.
    In this example, N=8, and channel number 1 (EOG) is used as regressor. It is not modified in the output EEG file.
    nb_eventcode 2 Number of event codes to process.
    list_eventcode 2 5 List of the event codes to process.
    prestim_nbsample 400 800 List of the numbers of samples in the prestimulus period; one value for each event code.
    poststim_nbsample 1000 1200 List of the numbers of samples in the poststimulus period; one value for each event code; the total number of samples of the analysis is prestim_nbsample + poststim_nbsample + 1, the extra sample corresponds to the event itself.
    baseline_msec_start -200 -200 List of the baseline start latencies (in ms); one value for each event code.
    If omitted, no baseline value is computed.
    baseline_msec_stop -50 -50 List of the baseline stop latencies (in ms); one value for each event code.
    If omitted, no baseline value is computed.
    center_regressor_chan 1 Flag to center the regressor channel(s) (substract the mean value, computed on the whole epoch). Possible values are :
    0 : do not center regressor channel(s).
    1 : center regressor channel(s).
    range_threshold 125 Threshold value (in physical unit) used for artefact detection. If the difference between the maximum and minimum values on the whole epoch of one regressor channel is larger than this value, an artefact is detected.
    smoothing_halfwnd_nbsample 20 Number of samples of the smoothing half-window.
    The smoothing is applied before the derivative for the artefact detection.
    derivative_len_msec 50 Length in ms of the derivative.
    derivative_threshold 1 Threshold value (in physical unit/s e.g. µV/s) used for artefact detection. This threshold is applied to the derivative. If the absolute value of the derivative of one regressor channel is larger than this value, an artefact is detected.


  • Examples


  • Comments


  • Current version
  • 1.01 30-06-2011

  • History
    • 1.00 02-03-2011 (PEA) : 1st version.
    • 1.01 30-06-2011 (PEA) : fixes label of post-stimulus number of samples (poststim_nbsamp to poststim_nbsample).


  • Files
  • $ELANPATH/bin/eegregress

  • See also