Script importing .erp file (ERPLAB) and .set file (EEGLAB)

Can you provide an example of importing .erp file using script? I can do it with the GUI using right click->import EEG/MEG and then select the .erp file, but I could not find a way to do that using script, same with .set files.

I have tried in_fopen+in_fread, bst_process(‘LoadInputFile’), neither worked. I may have missed some input variables since I don’t know what is mandatory and what is optional.

I have done all my preprocessing in EEGLAB/ERPLAB and just want to use the source localization part of brainstorm.

Thanks,

HY

Have you tried using the processes in “Import recordings” ?
You can select these processes in the pipeline editor and then generate the corresponding Matlab script:
http://neuroimage.usc.edu/brainstorm/Tutorials/PipelineEditor#Automatic_script_generation
http://neuroimage.usc.edu/brainstorm/Tutorials/Scripting

It worked! Turned out it also uses ‘process_import_data_epoch’. I thought it would use another process.

Thank you!