Difference: DocsSectionsPlugIns (11 vs. 12)

Revision 1214 Nov 2014 - Main.PhilipVanDenBroek

Line: 1 to 1
 
META TOPICPARENT name="WebHome"
<---Start1--->
Changed:
<
<

Plug-ins

>
>

Importing tables

  Generate current PDF

Introduction

Changed:
<
<
When building new experiments it is often possible to make use of parts that have been developed previously. For example, the procedure for preprocessing incoming data may be highly similar for many experiments. For this reason, BrainStream supports the use of plug-ins. Parts of an experiment that have already been designed can easily be added to new applications as plug-ins, which may save users a lot of development time and encourages sharing parts of experiments between researchers. Although a plug-in can be as simple as a single function inserted in the processing pipeline, this section is focused on plug-in tables. Like ordinary experiment definition tables, plug-in tables can specify any number of actions for multiple markers at different timepoints.
>
>
When building new experiments it is often possible to make use of parts that have been developed previously and are shared among the different type of experiments. For this reason, BrainStream supports a mechanism to entirely import parts of an earlier designed experiment into your current experiment definition table, which may save users a lot of development time and encourages sharing parts of experiments between researchers. Also, common parts can be maintained better only having to update that single experiment definition table that is referred to by all other experiments. Like ordinary experiment definition tables, imported tables can specify any number of actions for multiple markers at different timepoints. Importing definitions from other tables also results in a more structured and readable design since functional parts of the design can be split up into different tables. The import option also incorporates a mechanism to copy a set of definitions to an entire list of markers, which prevents lots of repeated definitions that would heavily obscure the experiment overview.
 
Changed:
<
<
You can insert a plug-in table by placing the @ symbol followed by the plug-in's name in the marker column of your main Actions table. If your plug-in is an excel file with multiple sheets, you can also refer to a specific sheet by adding the name of the sheet after the plug-in's name. For example, if you want to use Sheet1 of a plug-in called MyPlugin you would specify '@MyPlugin.xls Sheet1' in the marker column of your Actions table.
>
>
The general import behaviour can be described as reading the content of the imported table and process it identical to the case where the import-table content would be directly specified in the original table. However, imported actions are treated as defaults and therefore, if the line with the import reference in the original table also defines actions, they will overwrite the defaults retrieved from the import-table.

You can import definitions from another table by placing the @ symbol followed by the table name in the marker column of your main Actions table. If your imported table resides in an excel file with multiple sheets, you can also refer to a specific sheet by adding the name of the sheet after the tables's name. For example, if you want to use Sheet1 of a table called MyTable you would specify '@MyTable.xls Sheet1' in the marker column of your Actions table.

 
Changed:
<
<

Plug-in tables

>
>

Import tables

 
Changed:
<
<
Plug-in tables completely define a part of an experiment. If a DATA timepoint is specified for one or more actions, the plug-in needs its own DataSelection table.
>
>
Imported tables completely define a part of an experiment. If a DATA timepoint is specified for one or more actions, the table needs its own DataSelection table.
 
Changed:
<
<
In order to use a plug-in table, you only have to specify the reference to the plug-in table in your main Actions table. A simplified example of a plug-in is given below:
>
>
In order to import a table, you only have to specify the reference to it in your main Actions table. A simplified example of an imported table is given below:
 
Main Actions Table
marker
time
function
All_Pictures
Picture
BS_INIT EVENT init_bci, bs_send_buffer_marker('start_bci','eeg',0,'now')    
Line: 29 to 32
 
marker
type
value
start_bci stimulus 1
Changed:
<
<
At the BS_INIT marker, the BCI experiment will be initialized and subsequently a BCI processing pipeline will be executed. Let's assume that inside this processing pipeline is a function that inserts a marker whenever a picture needs to be shown. The presentation of pictures is taken care of by the Pictures plugin (@Pictures):
>
>
At the BS_INIT marker, the BCI experiment will be initialized and subsequently a BCI processing pipeline will be executed. Let's assume that inside this processing pipeline is a function that inserts a marker whenever a picture needs to be shown. The presentation of pictures is taken care of by the Pictures table (@Pictures):
 
Changed:
<
<
Plug-in Actions table
>
>
Imported Actions table
 
marker
time function All_Pictures Picture
BS_INIT EVENT load_pictures{'instruction.jpg','fixation_cross.jpg','continue.jpg','end.jpg'} [],get,put [],put
instruction EVENT     'instruction.jpg'
Line: 39 to 42
 
continue EVENT     'continue.jpg'
end EVENT     'end.jpg'
Changed:
<
<
Plug-in Dictionary table
>
>
Imported Dictionary table
 
marker
type
value
instruction stimulus 11
fixation_cross stimulus 12
continue stimulus 13
end stimulus 14
Changed:
<
<
At the BS_INIT marker, first the user defined variables All_Pictures and Pictures are initialized. Then the function load_pictures is executed, which loads all pictures that are needed for the experiment and stores them in the variable All_Pictures. Finally, the content of the user defined variables is copied to the global variables with the put statement.
>
>
At the BS_INIT marker, first the user defined variables All_Pictures and Pictures are initialized. Then the function load_pictures() is executed, which loads all pictures that are needed for the experiment and stores them in the variable All_Pictures. Finally, the content of the user defined variables is copied to the global variables with the put statement.
  Whenever one of the markers instruction, fixation_cross, continue or end is inserted, the plug-in Actions table specifies that the content of the variable Picture should be changed to the name of the corresponding picture. After this has happened, the function show_picture (in the main Actions table) will use this new variable content for showing the picture.
Changed:
<
<
The advantage of the Pictures plugin in the example above is that the main Actions table remains concise. In the Table Expansion section you can see how the experiment definition tables would look if no plug-in had been used. In addition, other experiments that make use of the same pictures, can do so simply by referring to this plug-in table. Any changes to the plug-in, for example changing the pictures that are to be used, will automatically be incorporated in all the experiments that are using the plug-in.
>
>
The advantage of the imported Pictures table in the example above is that the main Actions table remains concise. In the Table Expansion section you can see how the experiment definition tables would look if no import had been used. In addition, other experiments that make use of the same pictures, can do so simply by referring to this same imported table. Any changes to this table, for example changing the pictures that are to be used, will automatically be incorporated in all the experiments that are using the same imported table.
 

Table expansion

Changed:
<
<
In the examples above, only one plug-in was used. However, the main table can refer to more than one plug-in, or one plug-in may refer to another plug-in. The expanded experiment definition table shows you how your experiment looks when the main table and all plug-in tables are combined.
>
>
In the examples above, only one table was imported. However, the main table can specify references to more imported tables, or an imported table itself may import another table. The expanded experiment definition table shows you how your experiment looks when the main table and all imported tables are combined.
 
Changed:
<
<
At the start of each BrainStream experiment, the main experiment definition tables and all plug-in tables will be combined into one table, a process called table expansion. This means that all Action tables will be integrated into a single Action table, and the same is true for the DataSelection and Dictionary tables. Thus, in the example mentioned above, the expanded tables would look like this:
>
>
At the start of each BrainStream experiment, the main experiment definition tables and all references to import-tables will be combined into one table, a process called table expansion. This means that all Action tables will be integrated into a single Action table, and the same is true for the DataSelection and Dictionary tables. Thus, in the example mentioned above, the expanded tables would look like this:
 
Expanded Actions Table
marker
time
function
All_Pictures
Picture
 
This site is powered by the TWiki collaboration platformCopyright © by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding TWiki? Send feedback