Diff for "VbDotNetExample" - Methods
location: Diff for "VbDotNetExample"
Differences between revisions 3 and 4
Revision 3 as of 2007-08-24 11:27:11
Size: 2691
Editor: RhodriCusack
Comment:
Revision 4 as of 2007-08-24 11:29:25
Size: 2808
Editor: RhodriCusack
Comment:
Deletions are marked like this. Additions are marked like this.
Line 5: Line 5:
Line 46: Line 45:

= Acknowledgements =
Thanks to Daniel Mitchell & Alejandro Vicente-Grabovetsky who contributed parts to this code.

Download

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.

Program components

ExpSettings

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.

ExpDisp

Contains various subroutines to help you use DirectX for display.

Initialize()

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.

ClearScreen

Clears the screen

DrawFixation

Draws a fixation cross

FlipSurface

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.

ExpTimingAndReponses

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.

frmStart

This is the main form. The code behind the "Start" button actually runs the experiment

Acknowledgements

Thanks to Daniel Mitchell & Alejandro Vicente-Grabovetsky who contributed parts to this code.

None: VbDotNetExample (last edited 2013-03-08 10:28:25 by localhost)