Tutorial 28: Scripting


Authors: Francois Tadel, Elizabeth Bock, Sylvain Baillet

The previous tutorials explained how to use Brainstorm in an interactive way to process one subject with two acquisition runs. In the context of a typical neuroimaging study, you may have tens or hundreds of subjects to process in the same way, it is unrealistic to process all of them manually. Some parts of the analysis pipeline can be processed in batches with no direct supervisions, others require more attention. This tutorial introduces tools and tricks that will help you assemble an efficient analysis pipeline.

What can be automated

The list below contains all the steps of analysis that were detailed in the introduction tutorials, organized in a way that matches the actual work of the person in charge of the analyses.

[Using the individual anatomy of the subjects]

[Using warped templates]

[General pipeline]

Script generation


Script edition

- Add loops, load files, ...

Loops: http://neuroimage.usc.edu/forums/showthread.php?2429-Problem-using-tags

File manipulation

Export as script

Use the menu "Generate .m script" to create a Matlab script that would have the exact same result as running this analysis pipeline from the Brainstorm interface.

This script is also available in the Brainstorm distribution: brainstorm3/toolbox/script/tutorial_raw.m

Report viewer

Click on Run to start the script.

As this process is taking screen captures, do not use your computer for something else at the same time: if another window covers the Brainstorm figures, it will not capture the right images.

At the end, the report viewer is opened to show the status of all the processes, the information messages, the list of input and output files, and the screen captures. The report is saved in your home folder ($home/.brainstorm/reports). If you close this window, you can get it back with the menu File > Report viewer.

Feedback: Comments, bug reports, suggestions, questions
Email address (if you expect an answer):

Tutorials/Scripting (last edited 2016-07-20 16:33:02 by FrancoisTadel)