Page 1 of 1
how to change the format from .mat to .dat?
Posted: 24 Nov 2011, 21:57
by RobinWang
hey,everyone
Now I have a new issue. I have some BCI competition data whose format is .mat, I want to change it to .dat and use them in the offlineanalysis tool.
So how to change the format from .mat to .dat?
Regards,
Robin
Re: how to change the format from .mat to .dat?
Posted: 25 Nov 2011, 05:30
by mellinger
BCI2000 comes with a save_bcidat mex file that allows you to save any data in BCI2000 .dat format. However, you will need to provide trigger/event information in form of BCI2000 states. Also, OfflineAnalysis requires certain parameters to be present in a .dat file.
So it is probably best to proceed as follows:
* Use the SignalGenerator to create a BCI2000 .dat file that has been recorded with a paradigm similar to the foreign file, i.e. for an ERP paradigm, create a .dat file with StimulusPresentation, for an SMR paradigm, create a .dat file with CursorTask. Also, sampling rate and number of channels should match if possible.
* Load the .dat file into Matlab using load_bcidat.
* Replace the loaded signal with the foreign file's signal.
* Convert the foreign file's trigger information into the state variables that encodes the paradigm, i.e. StimulusCode/StimulusType for ERP paradigms, and TargetCode/ResultCode/Feedback for SMR paradigms (for a description of these state variables, see the StimulusPresentationTask and CursorTask pages on the BCI2000 wiki). The final state variables should have the same number of samples as the signal.
* Remove all remaining state variables.
* Use the save_bcidat mex file to save the data in .dat format.
Regards,
Juergen
Re: how to change the format from .mat to .dat?
Posted: 07 Jan 2012, 11:23
by RobinWang
thank you! I get it