EEGLAB: Data transposition and visualization issue

edited August 2016 in Software
Hi there,

I have not been able to successfully view EEG data in EEGLAB, and think it might be related to the matrix transposition step following data importation. If anyone has suggestions on how to proceed, please let me know. Here are the details:

I have followed documentation such as https://irenevigueguix.wordpress.com/2016/07/06/eeglab-tutorial-import-data/ and https://irenevigueguix.wordpress.com/2016/04/22/loading-openbci-datasets-in-eeglab/. When I get to plot --> channel data (scroll) in EEGLAB, EEGLAB either i) plots data that is zoomed to ~1e+05 to even see the different channels (which look like thin blue lines; zooming in is futile - the lines just shift and then disappear), or ii) crashes.

For (i), I noticed something incongruous with the documentation. The docs generally say to perform a matrix transposition, such that channel info is saved in columns (not rows), using eeg_data = eeg_data', Prior to the transposition, my data already is displayed as 1 channel/column (if I then try to plot without the transposition, the crash, aka scenario (ii), occurs). After the transposition, the matrix shows 1 row/channel (i.e., against what is in the documentation). At this point, I can actually get to the plotting stage, but have the aforementioned tiny-line issue described earlier. 

Any thoughts on how to successfully plot this data, or why there is this incongruity with the transposition/documentation? FYI, I am using MATLAB vR2016a, and EEGLAB v13.6.5b. 

Many thanks in advance!

Comments

  • wjcroftwjcroft Mount Shasta, CA
    I've notified Irene and she should reply here.

  • viguixviguix Brooklyn, New York
    Hey there!

    First of all, thanks for reading my blog posts and write a new discussion in the forum.

    There is something incongruous with the documentation, you are right. It's a complete misunderstanding, and I'm going to explain why. The second link that you provided (Loading OpenBCI datasets in EEGLAB) is a copy of the tutorial that you can find in OpenBCI website > Learning > Research Tools > MATLAB. I copy-pasted the instructions, and I completely forgot about the blog post. Two months after, I tried to follow the OpenBCI Learning-MATLAB tutorial, but I had the same problems that you have now. It made me transpose the rows and columns, and when I imported the file in EEGLAB it was crashing all the time. So, I decided to figure out why and how could I upload OpenBCI datasets correctly in EEGLAB. The result of that is the first documentation link that you mentioned (EEGLAB Tutorial: Import Data). 

    To sum up, I would suggest you follow the instructions explained at the "EEGLAB Tutorial: Import Data" post in which you do not need to transpose your data. Besides, I wrote a MATLAB script that imports an OpenBCI file, it selects the EEG data (both filtered and non-filtered) and saves it as a Matlab variable (".mat"). You can find it and download it here.

    This is the perfect occasion for updating the "Loading OpenBCI datasets in EEGLAB" post with the right information and instructions and avoid future misunderstandings. Also, I will update the OpenBCI Matlab tutorial with the right information.

    Keep me posted about your research. If you have more doubts, do not hesitate to contact me. I'll be happy to answer all of your questions.

    Best,

    Irene Vigue Guix
    OpenBCI Summer Intern
  • viguixviguix Brooklyn, New York
    edited August 2016
    I rewrite the Loading OpenBCI datasets in EEGLAB post with new information about the MATLAB script that I mentioned in the previous comment. In the updated post now you can find the MATLAB code commented line by line and a tutorial that shows you how to import the data in EEGLAB by using the variables saved after running my script. Enjoy! :)
  • Thank you for your fast and helpful reply, Irene! Much appreciated. I was successfully able to import a .mat from your script into EEGLAB, and plot it :)
  • edited January 2017
    Hello,

    I'm struggling to import my .txt data into EEGlab. I'm a complete novice comes to Matlab so I'm definitely missing some basic concepts.

    When I import the .txt file into EEGlab and plot the data the channels are all over the graph and they don't really make any sense but I guess this is because of the wrong import method.

    On your blog EEGLAB Tutorial: Import Data the links to the location files are missing, could they be re-uploaded? I managed to create the .m file but I'm not sure what to do after MATLAB loads the data, how can I get it into EEGlab.

    I'm trying to open a .cvs file but I get this:  ( I will first open .txt file in Numbers and then export it into .cvs )

    >> openbciIN
    Error using dlmread (line 143)
    Mismatch between file and format string.
    Trouble reading 'Numeric' field from file (row number 1, field number 1) ==> %Other Columns = EEG data in microvolts followed by Accel Data (in G)
    interleaved with Aux Data,,,,,,,,,,,,\n

    Error in csvread (line 47)
        m=dlmread(filename, ',', r, c);

    Error in openbciIN (line 16)
       data = csvread(filename,5,0);
     




    Could someone please help me to get this working?

    Thanks
    Hubert 

Sign In or Register to comment.