EEGLAB .dat file import error

Known Issues and Problems with BCI2000
Locked
shaman
Posts: 8
Joined: 04 Feb 2014, 09:16

EEGLAB .dat file import error

Post by shaman » 06 Mar 2014, 10:16

I am trying to import bci2000 .dat files into matlab using eeglab v11.0.4.3b. On importing data using "Import BCI .dat files" i get a _loadBCI2000.m error that reads "Expression or statement is incorrect-possibly unbalanced (,{ or [."
Has anyone faced this problem and what have you done about it?
Attachments
Untitled.jpg

boulay
Posts: 382
Joined: 25 Dec 2011, 21:14

Re: EEGLAB .dat file import error

Post by boulay » 06 Mar 2014, 12:34

If you can use a new version of EEGLAB (v13.x) then please do that. The new version of EEGLAB has a menu to download plugins, including a newer version of the BCI2000 data import plugin that I modified last year.

Let me know if you are on a Mac. The Mac binaries are 2 years older than the windows binaries, and this creates a problem in my code. I'd like to create new binaries, but this is a slow process. If you need the plugin fixed for Macs now then I will do that quick patch first.

shaman
Posts: 8
Joined: 04 Feb 2014, 09:16

Re: EEGLAB .dat file import error

Post by shaman » 07 Mar 2014, 08:56

No i am on windows 8.
i used the latest version of eeglab(v 13.x) and further downloaded the latest version of BCI2000-IMPORT plugin(v 0.34).
But the same problem persists on attempting to import the .dat file option.

boulay
Posts: 382
Joined: 25 Dec 2011, 21:14

Re: EEGLAB .dat file import error

Post by boulay » 07 Mar 2014, 11:28

I've attached a (slightly) updated version of pop_loadBCI2000.m . However, this does not differ from the version downloaded with the plugin in a way that would fix the error you see. I can only guess that either you are not using the correct version of the plugin (perhaps the old eeglab is still on the path? Please check that) or there is something specific to your system, though I can't imagine what.

[Edit: I deleted the file. Please see the post below.]
Last edited by boulay on 09 Mar 2014, 21:36, edited 1 time in total.

shaman
Posts: 8
Joined: 04 Feb 2014, 09:16

Re: EEGLAB .dat file import error

Post by shaman » 09 Mar 2014, 09:06

no i checked the path and i am using the latest version of the plugins.
On running the pop_loadBCI2000.m file it says error on line 99 with an unbalanced bracket.

boulay
Posts: 382
Joined: 25 Dec 2011, 21:14

Re: EEGLAB .dat file import error

Post by boulay » 09 Mar 2014, 20:16

Ah I think I know what it is. Are you using a version of Matlab older than 2009b? I'll patch the function, upload it here, and also post it to the EEGLAB repository. I'll do that sometime within the next 24 hours. Sorry about that.

boulay
Posts: 382
Joined: 25 Dec 2011, 21:14

Re: EEGLAB .dat file import error

Post by boulay » 09 Mar 2014, 21:36

See the attached file. I will add it to the BCI2000 svn and the EEGLAB repo soon.
Attachments
pop_loadBCI2000.m.zip
No longer uses null (~) output arguments, to be compatible with pre R2009b.
(4.02 KiB) Downloaded 404 times

shaman
Posts: 8
Joined: 04 Feb 2014, 09:16

Re: EEGLAB .dat file import error

Post by shaman » 11 Mar 2014, 10:11

YES it worked.thank you so much.

shaman
Posts: 8
Joined: 04 Feb 2014, 09:16

Re: EEGLAB .dat file import error

Post by shaman » 11 Mar 2014, 10:18

There is another issue that i am facing during import of the .dat BCI file.
On selecting the necessary .dat file there is a "SELECT EVENT" option from which i need to select "RUNNING".
On doing so a warning appears on MATLAB command window saying:"'Running' is not a valid event for EEGLAB. This event is being
discarded."
And subsequently i am not able to export the file using DATA and ICA activity to text file option.
The error says "invalid file identifier.Use fopen to generate a valid file identifier"

boulay
Posts: 382
Joined: 25 Dec 2011, 21:14

Re: EEGLAB .dat file import error

Post by boulay » 11 Mar 2014, 11:25

For EEGLAB to be useful, you need to have "Events" in your data. These events may be subsequently used to break up your data into epochs, time-locked to an event.

The "SELECT EVENT" dialog box allows you to choose the BCI2000 state variables to convert to events. Only BCI2000 states that change, but not-too-frequently, are useful as events. "RUNNING" is not useful because it never changes. Similarly, anything like a clock would not be useful because it always changes. Some States that are useful are things like "StimulusCode". You should pick all the states (you can pick more than 1) that you need to convert into events to time-lock your data (something similar to a "StimulusOn" event) and to know what kind of trial it is (e.g. "StimulusCode").

Please let me know if you do not have states that meet these criteria. I guess I never thought that someone would want to use EEGLAB to analyze data that didn't already have states->events. If that is the case, then I need to change the code a bit to allow for that.

Locked

Who is online

Users browsing this forum: No registered users and 23 guests