Converting NK .eeg

Hi all,

I am new to Brainstorm and am stuck on a simple question. I would like to convert Nihon Kohden .eeg files to .mat files in batches. The goal is to call Brainstorm functions in a Matlab script. I have been trying to use import_data and in_data, but I keep getting:

Struct contents reference from a non-struct array object.

Error in bst_get (line 427)
argout2 = GlobalData.DataBase.iProtocol;

Error in import_data (line 87)
ProtocolInfo = bst_get(‘ProtocolInfo’);

Could someone please point me to the correct way to do this?

Thank you so much!

Hello

I recommend you use only the pipeline editor to import your NK recordings. Select the processes you need and generate the corresponding Matlab script:
https://neuroimage.usc.edu/brainstorm/Tutorials/Scripting

Or you really don’t want them to be stored in a Brainstorm database, you need to use lower-level functions: in_fopen_nk and in_fread_nk.

Cheers,
Francois

Hi Francois,

Thank you so much! I couldn’t find in_fread_nk before, and that’s exactly what I need.

Best

Annabelle

Hi Francois,
I use in_fopen_nk to obtain [sFile, ChannelMat].
When I try to use in_fread_nk : F = in_fread_nk(sFile, sfid) , I don't what the sfid refers to.
Could you please answer this question?
Thank you very much!
Paul

Use the higher-level functions in_fopen and in_fread instead.