85
Comment:
|
1404
|
Deletions are marked like this. | Additions are marked like this. |
Line 2: | Line 2: |
User-defined processes in ~user/.brainstorm/process | Brainstorm features a flexible plug-in structure. All the operations available when using the Process1 and Process2 tabs are in fact written as plug-ins. A Brainstorm plug-in, or "process", is a single Matlab .m script that is automatically identified and added to the menus in the pipeline editor. Two folders are parsed for plug-ins: * '''brainstorm3/toolbox/process/functions''':<<BR>>Brainstorm "official" processes, included in the main distribution of the software * '''$HOME/.brainstorm/process''':<<BR>>User processes folder, to develop new processes or overwrite some default function == Process structure == A process function must be named "process_...m" and located in one of the two process folders in order to be recognized by the software. Let's call our example function "process_test.m". It contains at least 4 functions: * '''process_test'''(): The first line of the script must contain a function with the same name as the .m script. It contains only a call to the Brainstorm script macro_methodcall. This allows us to call subfunction in the process_test.m script from outside, using the syntax: process_test('FunctionName', arguments) * '''GetDescription'''(): Returns a structure that describes the process. This function is called when Brainstorm parses the process folders to find all the valid processes Run Matlab command |
Writing your own processes
Brainstorm features a flexible plug-in structure. All the operations available when using the Process1 and Process2 tabs are in fact written as plug-ins. A Brainstorm plug-in, or "process", is a single Matlab .m script that is automatically identified and added to the menus in the pipeline editor. Two folders are parsed for plug-ins:
brainstorm3/toolbox/process/functions:
Brainstorm "official" processes, included in the main distribution of the software$HOME/.brainstorm/process:
User processes folder, to develop new processes or overwrite some default function
Process structure
A process function must be named "process_...m" and located in one of the two process folders in order to be recognized by the software. Let's call our example function "process_test.m". It contains at least 4 functions:
process_test(): The first line of the script must contain a function with the same name as the .m script. It contains only a call to the Brainstorm script macro_methodcall. This allows us to call subfunction in the process_test.m script from outside, using the syntax: process_test('FunctionName', arguments)
GetDescription(): Returns a structure that describes the process. This function is called when Brainstorm parses the process folders to find all the valid processes
Run Matlab command