Opening data from Brainstorm in EEGLab

Hi
Is it possible after importing EEG data into Brainstorm, to down-sample it and then to open it in EEGLab?
Thanks

1 Like

Yes, you can probably do this.
Right-click on the “Link to raw file” or the imported epoch in the Brainstorm database explorer > File > Export to file.
Select the EDF file format, you can probably read this in EEGLAB.

1 Like

Thanks Francois, will try that.

Good afternoon, I have a question about this.
When I try to do this procedure on bdf files imported and pre-processed in brainstorm, I have the following error.

Error using bsxfun
Non-singleton dimensions of the two input arrays must match each other.

Error in bst_bsxfun (line 60)
C = bsxfun(fun, A, B);

Error in out_fwrite_edf (line 41)
F = bst_bsxfun(@times, F, chgain');

Error in out_fwrite (line 108)
out_fwrite_edf(sFile, sfid, SamplesBounds, ChannelRange, F);

Error in export_data (line 245)
sFileOut = out_fwrite(sFileOut, ChannelMat, 1, SamplesBounds, iChannels, F);

Error in tree_callbacks>@(h,ev)export_data(GetAllFilenames(bstNodes)) (line 1341)
jMenuExport = gui_component('MenuItem', [], [], 'Export to file', IconLoader.ICON_SAVE, [],
@(h,ev)export_data(GetAllFilenames(bstNodes)));

Any idea why is this happening?
Many regards,
Alessio

Hi Alessio,

First of all, you should never use the EDF/BDF format to save back files that were processed in MATLAB (Brainstorm, EEGLAB, FieldTrip, SPM...). This format does not support 32bit floats, therefore all the values have to be converted back to integers, losing a lot of precision in the decimals. This may cause important artifacts at the frequency level in your signals. Not too problematic if you are only interested only by amplitudes of ERPs, annoying if you are doing any time-frequency or connectivity analysis.
For a review on available file formats in EEG (which recommends the use of the BrainVision format instead):
https://psyarxiv.com/r7vc2/download

Beside this question, there were indeed some bugs in the export of recordings initially coming from BDF/EDF files (because of the annotation channels). It is now fixed: https://github.com/brainstorm-tools/brainstorm3/commit/3837fa8276f2881f55b07e71ad84e75952f0cc4a
Update Brainstorm and try again.

Cheers,
Francois

Thanks very much for your quick response. Many regards,
AB