I am newbie in Brainstorm. I am analyzing EEG data from N subjects in 2 different states and I should calculate sources for each case. The main steps are:
upload data file (.edf) and choose the anatomy (default anatomy should be perfect now)
upload channel location file (e.g. one that is already in Brainstorm database 10-20 setting)
compute the head model
calculate the noise covariance matrix
compute sources estimation with a specific method (e.g. sLORETA)
save the matrix
I have noticed that at the end of every Tutorial (and I should congratulate because they are really something!) there are the main functions related to the topic. Moreover, Tutorial-28 is about Matlab script and it seems to fit the bill. I have tried with just one subject, yet the following script has some issues:
Regarding the reported error.
Did you try to run the script with a new installation of Brainstorm before having at least one Protocol?
Regarding the script. The shared script does not do what you described in the post, there are some important problems with it, here the major:
Either the Procotol is already created, or the script should create a new Protocol
Similar with the Subject, either is already created in the protocol, or the script should create it
For linking the raw data to a Subject, the needed process is: process_import_data_raw()
If you want to use the 10-20 system locations already in Brainstorm use the process_channel_addloc() with the channelfile setting empty and the usedefault setting indicating which default channel locations.
For computing the sources, use the most recent process process_inverse_2018()
There is nothing in the script to do this.
Before scripting in Brainstorm, it is recommended to use the GUI to perform the pipeline (at least for one Subject) this will help you to understand what are the inputs and parameters for the processes, as well as the outputs. This is very important when debugging your codes.
As you know it is possible to create a script directly from the Pipeline editor. However, you need to be sure that the Pipeline is working.
It just means that you are running in a Mac with Apple Silicon (not Intel) and OpenMEEG has not been released for this architecture. For the sake of writing the pipeline you can use the sphere model (it is faster to compute). Once the pipeline is correct you can decide on the method to compute the head model