|Deletions are marked like this.||Additions are marked like this.|
|Line 1:||Line 1:|
= Download =
|= A sample experiment in VB.net =
== Download ==
|Line 9:||Line 9:|
|= Program components =
== ExpSettings ==
|== Program components ==
====== ExpSettings ======
|Line 13:||Line 13:|
|Public FullScreen As Boolean = True||Public FullScreen As Boolean == True|
|Line 17:||Line 17:|
|== ExpDisp ==||====== ExpDisp ======|
|Line 19:||Line 19:|
|=== Initialize() ===||============ Initialize() ============|
|Line 26:||Line 26:|
|=== ClearScreen ===||============ ClearScreen ============|
|Line 29:||Line 29:|
|=== DrawFixation ===||============ DrawFixation ============|
|Line 32:||Line 32:|
|=== FlipSurface ===||============ FlipSurface ============|
|Line 35:||Line 35:|
|== ExpTimingAndReponses ==||====== ExpTimingAndReponses ======|
|Line 38:||Line 38:|
|== ExpTrial & AttentionTrial ==||====== ExpTrial & AttentionTrial ======|
|Line 41:||Line 41:|
|== ExpTrialList & AttentionTrialList ==||====== ExpTrialList & AttentionTrialList ======|
|Line 44:||Line 44:|
|== frmStart ==||====== frmStart ======|
|Line 47:||Line 47:|
|= Acknowledgements =||== Acknowledgements ==|
A sample experiment in VB.net
The example is here attachment:ExperimentTemplate.zip
This is an attention monitoring experiment. It may be used in the scanner, or out of the scanner, with a simple switch of a parameter. It contains a colleciton of modules (starting Exp...) that contain functions that should be generally useful for many experiments.
This program is provided as an illustration only. You should always check your code carefully.
General experimental settings. Most useful is probably
Public FullScreen As Boolean == True
By default, the experiment acquires the whole screen, to give accurate timing, and prevent other programs from being displayed. However, this can be irritating when debugging, so set this to False when programming.
Contains various subroutines to help you use DirectX for display.
Sets up screen, in full screen or windowed mode. Make sure the number of colours (third argument in
DXDevice.SetDisplayMode(ES.ScreenWidth, ES.ScreenHeight, 32, 0, False)
is set to the same as the colour depth that windows was started in, if you use .FROMARGB anywhere to convert RGB values to colours.
Clears the screen
Draws a fixation cross
To ensure that graphics are displayed tidily, drawing is done on an "off screen surface" and then flipped to the display. This command flips the display. If in fullscreen mode, a DirectX flip command is used, which will be executed by the graphics card, and give high performance. In the testing windowed mode, a copy command is used to emulate the action of the flip.
Various routines for getting accurate timing, synchronising with the scanner (if used), checking button boxes and the keyboard.
ExpTrial & AttentionTrial
The ExpTrial class that represents a single trial, storing the parameters of the trial. This class would usually be used as a base for your own class, which more fully implements the particular experiment in question. Here, this is done in AttentionTrial, which inherits ExpTrial, but extends the "Run" method to display an attention monitoring trial.
ExpTrialList & AttentionTrialList
ExpTrialList stores a list of trials, and knows how to randomise it (or individual parameters), run all of the trials, and dump various things to the output file. AttentionTrialList is a specific implementation for this experiment, that also prepares the grating stimuli.
This is the main form. The code behind the "Start" button actually runs the experiment
Thanks to Daniel Mitchell & Alejandro Vicente-Grabovetsky who contributed parts to this code.