EEG channel file export/import as BST .mat

Hi,

I had to modify a channel file because we used a modified EGI HC GSN net. I noticed that when you export a channel file as BS .mat you cannot import again using the BS channel*.mat import function.

I set a breakpoint and it looked like the import was missing the inner structure that had all the relevant fields. Not sure if this is a bug or I made a mistake, either way, I thought I'd let you guys know.

Bw,
Ulli

I noticed that when you export a channel file as BS .mat you cannot import again using the BS channel*.mat import function.

I'm not sure what you refer to with "export", here.
If you right-click on a channel file > File > Export to file, the Brainstorm channel file is not available in the list. And for this, you don't need to "export", you can just "copy".

I set a breakpoint and it looked like the import was missing the inner structure that had all the relevant fields.

If I right-click on a folder > Import channel file, and select a channel.mat file, it works.
How do you "import" exactly?
Please include a few screen captures illustrating your problems, and copy-paste from the Matlab command window the text of the error message(s) you get.

This Brainstorm channel_...mat format is not really designed to be "exported" and "imported", and I'm not sure I see in which context this could be useful.
But if this is useful to you and you identified some obvious bug in some of data flows, I'd be happy to fix it.

Hi Francois,

Many thanks for the swift reply.

I 'exported' the channel file by saving the structure from the workspace to a .mat file.
I did that because it was easier to edit multiple rows in the workspace rather than using your builtin editor. Sorry for going rogue, it was only a one-off, it is probably not worth adding it in.

Cheers,
Ullrich

Then maybe you didn't save the structure correctly into the .mat file. You need to use the -struct option of the save function, or use bst_save.
You can also directly push the structures back into the database with a right-click on a file > File > Import from Matlab. Or see function node_import.m for examples of how to do it manually.

You are right, I didn't use the -struct option, that makes sense now.
Thanks for the swift replies!