Skip to main content
  • Description
  • Conversion function for Elan EP files (.p) to Matlab.

  • Usage
  • [HEADER1, HEADER2, DATA, CHANNELS] = ep2mat(p_file_name,varargin)
    with :

    • p_file_name : input filename (with extension) with the complete path.
    • option :
      'save', mat_name : to save all the results in a .mat file named mat_name.mat .

    output :

    • HEADER1 : structure containing the first header of the ep file.
      • HEADER1.s_Version : file version (-1 or -3).
      • HEADER1.s_Header_Size : header size in bytes.
      • HEADER1.s_Event_Code : averaged event code.
      • HEADER1.v_reserved : reserved.
    • HEADER2 : structure containing second header of the ep file.
      • HEADER2.s_Nb_Channels : total number of channels.
      • HEADER2.s_Nb_Sample_per_Channel : number of samples per channel.
      • HEADER2.s_Time_Epoch : duration (ms).
      • HEADER2.s_Nb_Sample_PreStim : number of samples for prestimulus.
      • HEADER2.s_Sampling_Period : sampling period (ms).
      • HEADER2.s_Min_Sig_Value : minimum signal value (amplitude unit).
      • HEADER2.s_Max_Sig_Value : maximum signal value (amplitude unit).
      • HEADER2.v_Elec : channel numbers in elec.dat.
      • HEADER2.v_Triplets : channel spherical coordinates (r, theta, phi).
      • HEADER2.s_Nb_Event_Aver : number of averaged epochs.
      • HEADER2.s_Nb_Samp_Inhib_Artef_Rej : number of inhibition samples for artefact rejection.
      • HEADER2.s_Flag_Artef_Rej : flag for the artefact rejection.
      • HEADER2.s_Flag_Baseline_Correction : flag for the baseline correction (=0 no correction, other = event code used for the correction).
      • HEADER2.s_Amplifier_Gain : amplifiers gain.
      • HEADER2.s_Low_Cutfrequency : low cut frequency for the amplifiers (Hz).
      • HEADER2.s_High_Cutfrequency : high cut frequency for the amplifiers (Hz).
      • HEADER2.v_Baseline_Value_per_Chan : baseline values for each channel.
      • HEADER2.reserved : reserved.
    • DATA : data matrix (HEADER2.s_Nb_Sample_per_Channel x HEADER2.s_Nb_Channels).
    • CHANNELS : structure containing channel informations.
      • v_Label : channel labels.
      • v_Theta : channel spherical coordinates theta (degree).
      • v_Phi : channel spherical coordinates phi (degree).
      • v_Type : channel type (EEG, MEG, LFP, unknown,...).
      • v_Units : channel unit (uV, mV, fT, unknown,...).


  • Fields of parameter file and example

  • Example
    • Read file /data/suj001.p
      [HEADER1, HEADER2, DATA, CHANNELS] =ep2mat('/data/suj001.p');
    • Read file /data/suj001.p and saves in /data/matfiles/suj001.mat
      [HEADER1, HEADER2, DATA, CHANNELS] =ep2mat('/data/Elan/suj001.p', 'save', '/data/matfiles/suj001.mat');


  • Comments

  • Current version
  • 1.03 09-08-2010

  • History
    • 1.03 09-08-2010 (PEA) : minor change (variable names).


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

  • See also
  • mat2ep