Skip to main content
  • Description
  • Conversion function for Elan EP files (.p) obtained from EEG data to SPM.

  • Usage
  • D = epeeg2spm(OutFileSPM, PathSPM, varargin)
    with :

    • OutFileSPM : output SPM filename (with path, no extension .mat).
    • PathSPM : path to output SPM files.
    • option varargin :
    • PFileList : Elan .p file(s).
      'keep_reference' : don't change reference. If omitted, average reference is processed (see output files).

    output :

    • D : SPM structure.

    output files:

    • OutFileSPM.mat, OutFileSPM.dat : SPM files without montage informations.
    • 'M'OutFileSPM.mat, 'M'OutFileSPM.dat : SPM files with montage informations (with average reference or not).


  • Fields of parameter file and example

  • Examples
    • Read /data/Elan/suj001.cond1.p and /data/Elan/suj001.cond2.p files and convert to a single SPM structure with 2 conditions
      D =epeeg2spm('suj001', '/data/SPM/work/', '/data/Elan/suj001.cond1.p', '/data/Elan/suj001.cond2.p');
    • Read /data/Elan/suj001.cond1.p and /data/Elan/suj001.cond2.p files and convert to a single SPM structure with 2 conditions, keeping reference (no average reference processed) :
      D =epeeg2spm('suj001', '/data/SPM/work/', 'keep_reference', '/data/Elan/suj001.cond1.p', '/data/Elan/suj001.cond2.p');
      or
      D =epeeg2spm('suj001', '/data/SPM/work/', '/data/Elan/suj001.cond1.p', '/data/Elan/suj001.cond2.p', 'keep_reference');
    • Open a window for Elan .p file(s) selection
      D =epeeg2spm('suj001', '/data/SPM/work/');
    • Read /data/Elan/suj001.cond1.p and /data/Elan/suj001.cond2.p files and convert to a single SPM structure with 2 conditions (use a vector of names)
      filelist{1}='/data/Elan/suj001.cond1.p';
      filelist{2}='/data/Elan/suj001.cond2.p';
      D =epeeg2spm('suj001', '/data/SPM/work/', file_list);


  • Comments
    • This function uses SPM. You need to change the path according to your SPM installation.
    • Channel coordinates are read from SPM EEG template ext1020.sfp according to the label.


  • Current version
  • 1.08 19-03-2012

  • History
    • 1.00 30-04-2010 (PEA) : first version.
    • 1.01 03-05-2010 (PEA) : remove CTF dependance.
    • 1.02 04-05-2010 (PEA) : adding 'unknown' channels for no label.
    • 1.03 22-07-2010 (PEA) : bug fixe for multiple input files.
    • 1.04 10-08-2010 (PEA) : change in variable names.
    • 1.05 10-08-2010 (PEA) : accept PFileList as cell array.
    • 1.06 06-07-2011 (PEA) : fixes sampling frequency test between files.
    • 1.07 07-07-2011 (PEA) : fixes duration test between files.
    • 1.08 19-03-2012 (PEA) : adds SPM_path variable. Adds average reference option, 'keep_reference' for not changing reference. If omitted, common average reference is computed./li>


  • Files
  • $ELANPATH/misc/matlab/epeeg2spm.m
    $ELANPATH/misc/matlab/ep2mat.m

  • See also
  • epmeg2spm, ep2mat, mat2ep