Skip to main content
  • Description
  • Computes spline interpolation from an .eeg file and creates a new .eeg file on any user-defined sensor montage. Resulting .eeg file consists in either interpolated potential values or scalp current density values (surface Laplacian), computed on a spherical surface.


  • Usage
  • eegspline myeegfile.eeg myparfile.par myeegfileout.eeg [myelecpositionin.rtp]

    with :

    • myeegfile.eeg: input .eeg file to process (with extension).
    • myparfile.par: text parameter file (with extension).
    • myeegfileout.eeg: output file (with extension) after processing by spline computation.
    • options:
      myelecpositionin.rtp : text file with the list of R, theta, phi coordinates of the recorded channels (channels in myeegfilein.eeg). Only theta and phi values will be considered for spline computation (normalized sphere with radius=1). If omitted, electrode coordinates (theta, phi) are read from elec.dat file.


  • Fields of parameter file and examples
  • spline_channel_flag 1 1 0 1 0 0 0 0 list of the channels to include in the spline computation: 1/0 for selected/unselected channels; the total number of flags is N+2, N being the number of recorded channels in myeegfilein.eeg; the last 2 flags should be set to 0.
    In this example, N=5, and only channels number 1, 2, 4 will be included for computation.
    spline_channel_out_nb 6 Number of output channels on which spline interpolated values (potential or SCD) are computed.
    spline_channel_out_list 13 5 8 10 35 -1 List of electrode numbers (according to elec.dat) on which spline interpolated values (potential or SCD) are computed.
    The electrodes with number -1 are not interpolated (e.g. EOG or EMG channels because they have no coordinates on head). To keep the original data in output file, use the -1 and the original_channel_out_nb and original_channel_out_list fields (see below).
    original_channel_out_nb 1 Number of output channels with original data (no interpolation).
    original_channel_out_list 5 List of electrode indices in the original input EEG file (first is number 1) of the output channel with original data. This electrodes are added at the -1 positions of spline_channel_out_list label with the same order.
    In this example, the 5 first channels (13, 5, 8, 10 and 35 are corresponding to F7, Pz, T3, Cz and POz in elec.dat) are interpolated from channels 1, 2 and 4. The 6th channel is the copy of the 5th channel of the original file.
    spline_scd 1 Flag for computing SCD or potentials:
    0 : potential interpolation
    1 : SCD interpolation
    If omitted, spline_scd = 0.
    spline_order 3 Spline interpolation order (usually 3 or 4).
    Suggestion: if regularization is used for potential or SCD, take spline order = 3, otherwise, take spline order = 4.
    spline_regul 1 Type of regularization for spline computation:
    0 : no regularization
    1 : optimized (Tikhonov)
    2 : user-defined lambda (Tikhonov)
    3 : user-defined lambda (Wahba)
    spline_regul_lambda 0.001 Regularization coefficient for spline interpolation. Required only when spline_regul = 2 or 3.
    spline_signal_offset 1 Flag for offset correction of all selected input channels (for each channel, the mean value over the entire recording period is substracted from the raw signal):
    0 : no offset correction
    1 : offset correction
    If omitted, spline_signal_offset = 0.

    Format of myelecposition.rtp file :
    Text file containing the label ‘r_theta_phi’ followed by the R, Theta, Phi spherical coordinates of the sensors recorded in the input .eeg file myeegfilein.eeg (one line per sensor following the same order as in myeegfilein.eeg). The R value is not read by the programme, sensors are considered to be on a normalized sphere.


  • Example
  • Comments
  • Current version
  • 1.17 30-07-2015

  • History
    • 1.04 25-05-2005 (OB) : changes label of SCD computing flag (becomes spline_scd, was spline_pot_scd).
    • 1.06 04-04-2008 (PEA) : changes label of coordinates file (becomes r_theta_phi field).
    • 1.08 27-11-2009 (PEA) : changes in progress display.
    • 1.09 27-11-2009 (PEA) : reads data by blocks instead of samples.
    • 1.10 30-11-2009 (PEA) : changes for temporary file name (allows many instances of eegspline in one directory).
    • 1.11 23-09-2010 (PEA) : update to use cmake and free release of Elan. Remove static allocation for reading EEG file header.
    • 1.12 21-02-2011 (PEA) : adds original_channel_out_nb and original_channel_out_list parameters to keep original channel which have no coordinates (e.g. EOG, EMG, ...).
    • 1.13 17-11-2011 (PEA) : minor modification.
    • 1.14 07-02-2012 (PEA) : removes maximum number of channel test. Removes exit when original_channel_out_nb field is not present.
    • 1.15 26-09-2014 (PEA) : change temporary file creation to output directory (was system temporary directory).
    • 1.16 30-09-2014 (PEA) : fix reading temporary file error (due to previous change).
    • 1.17 30-07-2015 (PEA) : fix rCSL constant initialization.


  • Files
  • $ELANPATH/bin/eegspline

  • See also
  • epscd