Document version: 1.0
Author(s): Sven Gijsen
Date: July 2015
The Experiment Manager Plug-in implements a Experiment Engine that you can use to present various kinds of stimuli. It can load an Experiment file (*.exml) that defines the configuration for the experiment; see the EXML-File definition. The Experiment Manager can be created and used by a script or can be used directly by executing an Experiment file by BrainStim. Please read the Creating Experiments with the Experiment Manager document for a beginners Getting Started Guide.
The Experiment manager makes use of the Outputs sub-directory inside the Main User Directory of BrainStim for storing log and output files.
The experiment structure file is an XML file type that can be loaded by the Experiment Manger for its configuration. You can edit this type of file directly in BrainStim using its User Interface or use a text/code editor.
The file can be used for configuring:
as explained above this structure represent a sequential timing scheme that is used when running the experiment. The Experiment Structures scheme is defined by one or more Block and optionally Loop element(s). These defined Block and optionally Loop element(s) from a Experiment Structure file are automatically visualized in BrainStim when such an file is opened.
This element contains the following child elements that can be configured:
Above here we read that Blocks generally are automatically sequentially executed by using their Block Number setting and when there are no more Blocks left the experiment automatically ends. An exception to this rule is a Loop. This Loop is an additional Block link that connects the end (after execution) of another Block to the beginning (before execution) of an Block. This Loop element contains the following child elements that can be configured:
After the experiment has been started a internal Experiment Engine loads the Experiment Structure and waits for the first External Trigger to be incremented. This is done by invoking a function called incrementExternalTrigger(). After this each invocation of that slot causes the External Trigger for the current BlockTrial to automatically increment. Depending on how long the time is between two subsequent invocations the current Experiment Structure changes as shown above here. The internal Experiment Engine has no knowledge of how long the time is between two subsequent invocations and is therefore totally independent of this. Each time a new Block Trial is started the Object Parameters are again fetched and used, if they are not redefined then the last used values kept (buffered).
The internal Experiment Engine is currently implemented by two different script classes, and depending on your experimental needs you can choose between these:
The ExperimentManager can go through different states when loading or executing an Experiment, these states are defined here. We can catch these state changes in our script and make use of that. Furthermore after successfully loading/preparing an experiment and executing it (by using the BrainStim User Interface or by calling the function ExperimentManager::runExperiment() it gives the control back to the user one more time where it can wait, abort or "really" start the Experiment were after the Experiment Engine is ready to receive it's first External Trigger.
When the User gets a Final control, depending on the internal Experiment Engine implementation the screen changes to something like:
Experiment ready, press 'Alt' to proceed or CTRL + 'a' to abort the experiment
|
At this moment you can press the Alt key to unlock the experiment were after the Experiment Engine is ready to receive it's first External Trigger. You can also choose to press the CTRL + a (abort) key combination to abort. You can also choose to do this while the experiment is running. After you unlocked the Experiment using the Alt key the screen changes to:
Experiment ready, waiting for a trigger to start...
|
If the Experiment Engine now receives it's first External Trigger then that timestamp is the exact "real" start of the experiment and because the first Trial for the first Block is initialized at that moment the newly configured Object Parameters are immediately processed.
There are a number of script classes made available for us by the ExperimentManager plugin that support Experimental Designs.
To start learning how to create Experiment using the Experiment Manager plugin you should definitely read this Creating Experiments with the Experiment Manager document. After that you should try out some (Advanced) Examples and try to tweak them.