Access to the Brainstorm Codes

Hi everyone,
I would mind using brainstorm to source localization. How I can write a script to do this process without openning brainstorm gui?
Clearly, I want to write a function to use brainstorm functions whitout selecting parameters manually.

Hi @sahar,

All the information that you need to write such a script is provided in the Brainstorm scripting tutorial:


Dear Reymundo.Cassani
Thank you for your answer. I read this page, but my problem was not solved :frowning:
Do I run brainstorm after generating the script? Do I load "new proptocol" , "new subject" before running the script and save it in the memory?

Brainstorm must be running in the background, although the GUI does not need to be visible in the screen.

This depends on your goal. It is possible to have a new Protocol, or run the script on an existing Protocol. Same goes for Subjects.

Thanks a lot for your answer.

Dear Reymundo.Cassani,
I use the above link for scripting. Unfortunatly, the "iProtocol" is empty. Why this is happen?

I want to generate .m-file of all these processes shown in the picture in order to plot sources. How I can do that without set the parameters manually?

As you can see in the if after the highlighted code, this indicates the ProtocolName is unknown, this is to say, not present in the database.

Please carefully read the Brainstorm scripting page. It contains the answer to that question:

Moreover, you can see the .m script that reproduces the introduction tutorials ("Get started") here:

OK, Thank you so much.