Is it possible to import other file formats into Bci2000?

Forum for software developers to discuss BCI2000 software development
Locked
lightz
Posts: 8
Joined: 21 Sep 2014, 10:39

Is it possible to import other file formats into Bci2000?

Post by lightz » 10 Oct 2014, 00:11

It seems only the .dat format file can be loaded into Bci2000, can other format files, such as .mat in matlab... .set in eeglab, ... .dft files imported into Bci2000?

Thank you very much!

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

Re: Is it possible to import other file formats into Bci2000

Post by boulay » 10 Oct 2014, 09:08

By "import into BCI2000", what do you mean? Do you want to use it for FilePlayback or for OfflineAnalysis or something else?

The BCI2000 dat file contains a lot of information other than just the raw data. It contains all the parameters and states too. All of this information is necessary for both FilePlayback and OfflineAnalysis. While it could be possible to create file input connectors for different file formats, there's no guarantee they would contain the correct information nor that it would be in the correct format.

Further, "OfflineAnalysis" is not really sophisticated enough of a tool to warrant building an entire library of import tools. You are much better off doing all of your analysis in something like EEGLAB (which does have many file import tools) and learning how to write the BCI2000 prm file.

If, for some reason, you really need to get a non-dat file into a program that expects BCI2000 .dat files, then you can write BCI2000 .dat files from Matlab.

lightz
Posts: 8
Joined: 21 Sep 2014, 10:39

Re: Is it possible to import other file formats into Bci2000

Post by lightz » 10 Oct 2014, 22:30

Thank you for reply!

you means eeglab is more powerful for offline analysis?

And what is the means of "toy" dat file? If a dat file is created by create_bcidat, it may possible not work with the offlineanalysis tool of BCI2000?

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

Re: Is it possible to import other file formats into Bci2000

Post by boulay » 11 Oct 2014, 08:42

Yes, absolutely EEGLAB is much more powerful for offline analysis. Also look into "fieldtrip" and "brainstorm".

A "toy" dat file means that it is not a "real" file created by BCI2000 during recording.
I think it is possible to create a .dat file that will work with the OfflineAnalysis tools, but you'll have to be sure you create the parameters and states correctly. I haven't tried to do something like that in a long time.

lightz
Posts: 8
Joined: 21 Sep 2014, 10:39

Re: Is it possible to import other file formats into Bci2000

Post by lightz » 11 Oct 2014, 19:03

then a basic question for eeglab and bci2000.
what is the meaning of r2(r square) spectrum function of a time serial in bci2000 offlinetools? is it equal to the "power" in the tools-> plot spectra and maps?

thank you very much!

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

Re: Is it possible to import other file formats into Bci2000

Post by boulay » 12 Oct 2014, 01:00

The R^2 is the variance in trial class accounted for by spectral power. (Or vice versa: the variance in spectral power accounted for by trial class).

I don't think EEGLAB has an R^2 output. However, EEGLAB can give you between-class statistics and these are directly relatable to R^2. Instead of generating R^2 plots, you can generate spectral plots that show between-class statistics and use those to pick your control features. I think you have to use the STUDY framework to create separate datasets for each class then do the between-dataset comparison.

If your goal is to generate parameters to use for subsequent online feedback then you may want to use BCILAB for this purpose.

lightz
Posts: 8
Joined: 21 Sep 2014, 10:39

Re: Is it possible to import other file formats into Bci2000

Post by lightz » 13 Oct 2014, 11:42

thank you for reply, but I am sorry I have not very understood yet. Is the following right:

1) R^2 is the coefficient of determination?

2) the spectral "power" in eeglab is computed by Fourier transform?

boulay wrote:The R^2 is the variance in trial class accounted for by spectral power. (Or vice versa: the variance in spectral power accounted for by trial class).

I don't think EEGLAB has an R^2 output. However, EEGLAB can give you between-class statistics and these are directly relatable to R^2. Instead of generating R^2 plots, you can generate spectral plots that show between-class statistics and use those to pick your control features. I think you have to use the STUDY framework to create separate datasets for each class then do the between-dataset comparison.

If your goal is to generate parameters to use for subsequent online feedback then you may want to use BCILAB for this purpose.

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

Re: Is it possible to import other file formats into Bci2000

Post by boulay » 13 Oct 2014, 14:42

lightz wrote: 1) R^2 is the coefficient of determination?
Yes, that's right. In OfflineAnalysis the R2 is calculated independently for each feature. It is generally up to the experimenter to decide which features to include in the online signal processing. Note that there are more advanced, and more automatic, ways to select the features to use for online signal processing. See here for example.
lightz wrote: 2) the spectral "power" in eeglab is computed by Fourier transform?
It can use FFT or wavelets. The SIFT plugin for EEGLAB uses auto-regressive methods. If you want to try multitaper spectra then you can try chronux.

lightz
Posts: 8
Joined: 21 Sep 2014, 10:39

Re: Is it possible to import other file formats into Bci2000

Post by lightz » 13 Oct 2014, 20:29

If I wan to realize controlling some machinery by intend can I use BCILAB in stead of BCI2000, including the EEG data online acquisition, the feather online indentifying and the feedback singal online generating? Is it as powerful as BCI2000?

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

Re: Is it possible to import other file formats into Bci2000

Post by boulay » 13 Oct 2014, 21:45

We're talking about importing other data formats. I suggested EEGLAB because it can import from multiple formats (including BCI2000) and then I added on BCILAB because it has some good tools for machine-learning analysis of neural data. These tools are much more flexible and powerful for offline analysis of neural data than BCI2000's OfflineAnalysis, which is only meant to be a simple tool that works with a very specific type of data.

Now, when talking about online feedback of brain signals, the conversation is entirely different. As far as I know, BCI2000 works with the most different kinds of hardware. Further, BCI2000 is written in C++ so it's fast, it has connectors to Matlab and Python for easy prototyping, and its stored data format is supported by multiple analysis tools in Matlab, Python, and even a few 3rd party compiled tools.

I've never used BCILAB for online feedback but if I were to, the first thing I'd look at is if it supported my hardware, if it supported the type of online feedback I wanted to use, if it supported the type of application I wanted, and how many options I'd have for analyzing its stored data. If you compare BCILAB to BCI2000 in those categories and decide that you'd rather use BCILAB then please post here to tell us how you came to that conclusion. I'm sure BCI2000's developers would love to know about its shortcomings and maybe improve it if possible.

lightz
Posts: 8
Joined: 21 Sep 2014, 10:39

Re: Is it possible to import other file formats into Bci2000

Post by lightz » 13 Oct 2014, 23:19

hee...
I wont' challenge Bci2000 here by BCILAB, I just want to simplify the realization. For me, a newcomer of Bci2000, I think it a little too complexed and not easily learning to use.

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

Re: Is it possible to import other file formats into Bci2000

Post by boulay » 14 Oct 2014, 21:28

I think I didn't explain things properly. I'm afraid I'm sending you down the wrong path. For the offline analysis that I did, I found the BCILAB documentation to be a little too verbose in theory and a little too sparse in practical application, and I found some parts where the documentation was just plain wrong. I'm not saying BCI2000's documentation is perfect, I'm just saying that if BCILAB's online processing documentation is similar to its offline documentation then I don't think it will be easier to realize than BCI2000.

To the question:
"How do I import/convert non-BCI2000 datafiles of type X for use with OfflineAnalysis?", the answer is "Don't bother. There are other tools out there that can import them directly and will be just as powerful if not more powerful than OfflineAnalysis.".

To the question:
"How do I control some machinery by intention as recorded by EEG?", the answer is "There are many options. Find the one that's best for you. For me, it's BCI2000. If you decide to use BCI2000 then its stored data files can be analyzed in OfflineAnalysis or almost any other tools."

For completeness, here are the different BCI programs I'm aware of that are not tied to specific hardware, in decreasing order of ease (my opinion) and free-ness (speech and beer):
BCI2000, OpenVibe, Pyff (Python based), BCILAB (requires Matlab), fieldtrip (requires Matlab), Matlab's Simulink (e.g., gHiSys for gtec hardware).

lightz
Posts: 8
Joined: 21 Sep 2014, 10:39

Re: Is it possible to import other file formats into Bci2000

Post by lightz » 15 Oct 2014, 04:48

ok, a lot of useful information, thanks a lot!

Locked

Who is online

Users browsing this forum: No registered users and 1 guest