BrainStreamPlugIns: Difference between revisions

Jump to navigation Jump to search
Created page with "<!---Start1---> = Importing tables = __TOC__ == Introduction == When building new experiments it is often possible to make use of parts that have been developed previously and..."
 
No edit summary
 
(2 intermediate revisions by the same user not shown)
Line 16: Line 16:


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:
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:
{| border="1"
{| class="wikitable"
|-
|-
| '''Main Actions Table''' || || || ||
!colspan="5"| '''Main Actions Table'''  
|-
|-
| <strong>marker <br /></strong> || <strong>time <br /></strong> || <strong>function <br /></strong> || <strong>All_Pictures <br /></strong> || <strong>Picture </strong>  
| <strong>marker <br /></strong> || <strong>time <br /></strong> || <strong>function <br /></strong> || <strong>All_Pictures <br /></strong> || <strong>Picture </strong>  
Line 27: Line 27:
|-
|-
| @Pictures || EVENT || show_picture || get || get  
| @Pictures || EVENT || show_picture || get || get  
 
|}
<br />
{| class="wikitable"
|-
|-
| '''Main Dictionary Table''' || ||
!colspan="3"| '''Main Dictionary Table'''
|-
|-
| <strong>marker <br /></strong> || <strong>type <br /></strong> || <strong>value <br /></strong>  
| <strong>marker <br /></strong> || <strong>type <br /></strong> || <strong>value <br /></strong>  
|-
|-
| start_bci || stimulus || 1  
| start_bci || stimulus || 1  
|}
|}
 
<br />
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):
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):


{| border="1"
{| class="wikitable"
|-
|-
| '''Imported Actions table''' || || || ||
!colspan="5"| '''Imported Actions table'''
|-
|-
| <strong>marker <br /></strong> || <strong>time </strong> || function || <strong>All_Pictures </strong> || <strong>Picture<br /></strong>  
| <strong>marker <br /></strong> || <strong>time </strong> || function || <strong>All_Pictures </strong> || <strong>Picture<br /></strong>  
Line 54: Line 55:
|-
|-
| end || EVENT || || || 'end.jpg'  
| end || EVENT || || || 'end.jpg'  
 
|}
<br />
{| class="wikitable"
|-
|-
| '''Imported Dictionary table''' || ||
!colspan="3"| '''Imported Dictionary table'''
|-
|-
| <strong>marker <br /></strong> || <strong>type <br /></strong> || <strong>value <br /></strong>  
| <strong>marker <br /></strong> || <strong>type <br /></strong> || <strong>value <br /></strong>  
Line 67: Line 70:
|-
|-
| end || stimulus || 14  
| end || stimulus || 14  
|}
|}
 
<br />
At the BS_INIT marker, first the [[BrainStreamBuildingExperiments#SecUserFun|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 [[BrainStreamImportantConcepts#SecVariables|global variables]] with the put statement.
At the BS_INIT marker, first the [[BrainStreamBuildingExperiments#SecUserFun|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 [[BrainStreamImportantConcepts#SecVariables|global variables]] with the put statement.


Line 77: Line 79:


<div id="TableExpansion"></div>
<div id="TableExpansion"></div>
== Table expansion ==
== Table expansion ==


Line 83: Line 86:
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:
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:


{| border="1"
{| class="wikitable"
|-
|-
| '''Expanded Actions Table''' || || || ||
!colspan="5"| '''Expanded Actions Table'''
|-
|-
| <strong>marker <br /></strong> || <strong>time <br /></strong> || <strong>function <br /></strong> || <strong>All_Pictures <br /></strong> || <strong>Picture </strong>  
| <strong>marker <br /></strong> || <strong>time <br /></strong> || <strong>function <br /></strong> || <strong>All_Pictures <br /></strong> || <strong>Picture </strong>  
Line 100: Line 103:
|-
|-
| end || EVENT || show_picture || get || 'end.jpg', get  
| end || EVENT || show_picture || get || 'end.jpg', get  
 
|}
<br />
{| class="wikitable"
|-
|-
| '''Expanded Dictionary Table''' || ||
!colspan="3"| '''Expanded Dictionary Table'''
|-
|-
| <strong>marker <br /></strong> || <strong>type <br /></strong> || <strong>value <br /></strong>  
| <strong>marker <br /></strong> || <strong>type <br /></strong> || <strong>value <br /></strong>  
Line 115: Line 120:
|-
|-
| end || stimulus || 14  
| end || stimulus || 14  
|}
|}
 
<br />
When the experiment is finished, you can find the expanded tables in the [.DocsSectionsLogFile Log file]. Additionally, if you are using the [[BrainStreamBrainStreamEditor|BrainStream editor]], you can view your expanded tables before running the experiment by clicking on the 'Expand table' button.
When the experiment is finished, you can find the expanded tables in the [.DocsSectionsLogFile Log file]. Additionally, if you are using the [[BrainStreamBrainStreamEditor|BrainStream editor]], you can view your expanded tables before running the experiment by clicking on the 'Expand table' button.