Search code examples
matlabsignal-processingeeglab

MATLAB EEG signal processing - Channel location file


I'm trying the EEGLAB and FASTER plugins for MATLAB in order to do some processing for my EEG data,
When trying to load the data file, I'm asked to choose the "channel location file", but I don't have that with my data, I was wondering if I can create it myself? And if so, How?
I know that each channel in my data corresponds to a specific electrode, how can I write that in the location file?
Thank you


Solution

  • You can do it by file or by code.

    By file (I did not test it so it may not work):

    • create a text file with electrode names - one electrode per line, the order should be the same as in your file. Load the file through edit -> channel locations --> read locations (left bottom corner of the gui). Choose your text file and then use "look up locs" button to get corresponding locations on BESA or MNI head model.

    By code and gui (should work well):

    • Create a variable with electrode names (have to be correct names in correct order):

      elec_names = {'Cz', 'O1', 'O2', 'Fp1', 'Fp2'};
      [EEG.chanlocs.labels] = deal(elec_names{:});
      eeglab redraw;
      

      Then use the edit -> channel locations --> look up locs option. Later you can type eegh in command window to get the command that would work on your computer.