Importing .MAT file

I have a .MAT file that contains 64 channel data sampled at 256 Hz. When using the "Review Raw File" option, I'm met with the option to select one specific channel that contains EEG data. Is there a way to import all channels simultaneously? I've attached an image of my concern below:

Hello,

It looks like the structure of your .mat file has one field for each channel. There is no format like this supported in Brainstorm. Which software did you use to create this file?

If you want to load this file in Brainstorm using the file format “EEG: Matlab matrix .mat”, you need to reformat your data in a single matrix [Nchannels x Ntime]. However, with this approach, it will not import the channel names.
Another approach would be so save the data in a coma- or tab-separated text file [Ntime x Nchannel], with the list of channel names in the first line. This would load both the data and the channel names, but it is not straightforward to create this file.

The best option would be for you to load directly the native file format, or any to use a more standard binary format (EDF, BDF, EGI .raw, EEGLAB, FieldTrip, SPM, etc.)

Francois

Hi Francois,

Thanks for your reply. The data was originally collected in BDF form from a Biosemi system, and was later exported to the .mat format. Processing took place prior to the export. I’m gravitating towards the .MAT format just because the data was passed along to me in this way, but I can see if I can acquire a processed version in the .BDF form.

Best,
Sahit

Hi Francois,

I have a similar issue. I have .mat files that contain matrices in the format [Ntime x Nchannels x Ntrials]. Furthermore I have 3 matrices in these .mat files that belong to different conditions (e.g. task 1, task 2, rest). How do I import these files?

Best,
Jae

Clarification:
These signals have already been preprocessed and epoched into trials

Hello

First: update Brainstorm, I’ve just fixed a small bug that was preventing the import of multiples trials in a [time x channel] configuration.

Then: Right-click on your subject, use the menu “Import MEG/EEG”, select the file format “Matlab matrix (.mat)”, the orientation [time x channel], it should ask for the field to import, and finally rename the folder it creates (so you can import another condition in a different folder). Repeat this for each condition.

It will create an empty channel file: you have to name the channels yourself, one by one. Or you may use one of the default channel files, but be very careful with the order of the channels: there is nothing that will check that the order is the same in your matrices and in the channel file.

Francois

Hi Francois,

I've tried that several times and every time I get the following error message:

Error in in_data_mat.m
ORDER must have at least N elements for an N-D array

Call stack:

in_data_mat.m at 68
in_fopen.m at 152
in_data.m at 473
import_data.m at 200
bst_call.m at 28
tree_callbacks.m>@(h,ev)bst_call(@import_data,,,,iStudy,iSubject) at 594


Are you using a compiled version of Brainstorm?
Otherwise simply update Brainstorm before trying again.

I was using the May 2018 version. I’ve updated brainstorm and now it seems to work! Thanks Francois

2 posts were split to a new topic: Import Spike2 .smrx

3 posts were split to a new topic: Opening BrainVision .mat file