XGen Experimental Software

Index


Introduction to XGen

XGen is an application for psychological experiment creation, data collection and data analysis. It allows you to create experiments based upon reaction times or saccade latencies to targets presented via computer controlled switch boxes [see Chris Rorden's hardware guide]. Targets and Cues can be presented in the visual, auditory or tactile modalities. Examples are LEDs, sounds produced from separate speaker cones or the computer or electrically driven solenoid punctators.

Experiments are created in an easy-to-use, Windows 32-bit ('95, '98, NT4) interface (named Xgenesis.exe, shift+click here to download [Windows 3 users can download a 16-bit version: shift+click here to download]). The experiment is then run from MS-DOS using a parallel application (named Xgen.exe, shift+click here to download) which gives millisecond timing and the capability to have on-line eye-movement monitoring trial by trial.

XGen is a developing project, and its features have been developed on a 'as needed' basis. In particulr, the current feature set has developed to suit the needs of Steffan Kennett, Chris Rorden, Francesco Pavani, Joost Heutink and Claudia Bonfiglioli. Because of the specific requirements of our experiments, the development has been somewhat iconoclastic. However, the design is very flexible, and many scientists will find that the software will be able to serve their needs right out of the box.

XGen was written by Chris Rorden. This help file was written by Steffan Kennett and updated by Chris Rorden. This manual can serve as a good introduction to the basic features.

Features
  • Easy to use graphical interface, no programming experience required.
  • Rapid analysis, with outlier exclusion.
  • Eye movement (or touch pad) recording (horizontal and vertical records).
  • Can employ small, portable output and input devices, allowing testing in hospitals or patient homes.
  • Free
Limitations
  • External stimuli only (can not use computer monitor for presenting targets)
  • Experiments can not be run while Windows is running.
  • 5 ms increments for outputs: if this proves to be a problem please contact Chris Rorden (true ms timing of inputs).
  • No staircasing functions to determine perceptual thresholds.

Creating an Experiment

Upon opening XGen, a window is presented showing a blank condition. Inspection of the window will show that this condition is numbered one (all entries have default values of zero, one or none where applicable). This window is where the bulk of any experiment is designed. See Experimental Conditions for an explanation of each box in this window.

In order to create a new experiment a prototype trial must first be designed. By clicking on each box in turn the required values can be typed in or scrolled to (using the arrows next to each box). Each variable has a built in maximum value. If a number greater than the maximum value is entered in a box then the value is automatically reduced to that maximum. Once values for the prototype trial are set, click on the X button or select New from the File menu. A dialogue box will appear prompting you to save any current experiment and/or create a prototype trial first. If this is already done, click OK. You will then be asked to specify how many conditions your new experiment will have. (Note: Maximum number of conditions is 64.) Having chosen the number the new experiment is created based upon the prototype trial entered. At this stage, the experiment has your chosen number of conditions, but they are all identical. To edit each condition, simply enter its number in the condition box and change the values in each of the other boxes as required. Any changes made from now on are specific to the condition you are working on, unlike the prototype trial stage. To move easily to the next condition, press F2 or click the up arrow next to the condition box. To move back, press F1 or click the down arrow. To move easily within each condition, use the tab key to highlight successive boxes. Remember to set values for the Stats. Condition, the number of Trials/Block and the Valid Response or Saccade to be given for each condition.

Before the experiment is complete, the hardware setup and the preferences must be set correctly. Access these by clicking the Preferences (Cogs) or Hardware (Computer) buttons on the toolbar or selecting Hardware or Preferences from the File menu.

Once this is done, the experiment should be saved by clicking the Save (Floppy Disk) button on the toolbar or selecting Save from the File menu and a name chosen for it. Note: The name must be of the form *.txt to be read correctly by Xgen.exe or Xgenesis.exe .


Experimental conditions

Each condition is made up of five slices of time each corresponding to an event. Each event can last between 0 and 2000ms (Except the post traget event, which can last up to 32000 ms, also see flicker and gaps for an exception to this constraint for Cue and Target). Each event has a name. The five event names are Precue,Cue, Cue-to-Target, Target and Post Target. These names need not constrain experimental design, save for the proviso that release times and response times will be measured from the onset of the event named Target. Eye movements will be measured from the event named Cue.

For the events named the experimenter may have any number of the 16 switches open or closed. If a check box is selected, the switch it corresponds to will be closed for the duration of the event and the component (such as an LED) connected to it via a switch-box will be on. In addition to components connected via switch boxes, the experimenter can have the computer generate a sound for the duration of any of the events. The frequency, measured in hertz (Hz), of the sound can be chosen in the boxes on the far right of each event row.

To the right of each event duration box there is a box entitled random. By entering a number in this box, a degree of random variability can be added to the duration of the event. For example, an event with ‘duration’ of 1000ms and ‘random’ of 100ms will last between 1000 and 1100ms and have an average duration of 1050ms. This feature can be employed to reduce the predictability of the sequence of events in any or all conditions. The box labelled Gaps only applies to the events Cue and Target and is normally set to zero. See flicker and gaps for an explanation of its use.

As well as the boxes specific to each event, there is a row of boxes to set details for the condition as a whole. The condition box contains the number of the condition currently shown in the window. The number of repetitions in each block of this condition is set in the Trails/Block box. The statistical condition is set in the Stat Cond box. For example, if your experiment has four conditions, consisting of a pair of distinct conditions repeated on both sides of a fixation point (left and right), you might want to collapse the data left-to-right. This is achieved by giving the equivalent conditions on either side the same number in the Stat Cond box. If there is a switch to be pressed by the subject (or experimenter) in response to the target, this can be set in the Valid Response box. The response labels left,right, up and down correspond to input buttons (see the hardware section for more details). The last box is where any reaction saccade direction is set. The use of this function requires calibration marks set at 5° of visual angle either side of the fixation point. This is so the velocity criterion, for a saccade to be registered, is equal to a standard 100° s-1 of visual angle.


Flicker and Gaps

The events Cue, Target, Response Error and Eye-Move Error all have the ‘flicker’ feature.

Using this feature, the experiment designer can choose whether to have a steady event of a given duration, or an event that rapidly alternates between two states. The simplest application of this would be to have a single LED flashing on and off as the Target in a chosen condition. For example, to have the light flash three times, each time for 100ms separated by 50ms of darkness, set theTarget event as follows. In the main Target box enter ‘100’; In the Gaps box of the Target event enter ‘2’ and finally, in the box which appears adjacent to the Gaps box, enter ‘50’. You will notice that the total duration of the Target is then computed as 400ms. Having set the durations, you must set the events themselves. By clicking the first check-box for the main Target event, the LED (say) in port 1 is selected. If the check boxes that appear adjacent to the Gaps box are left blank, then this LED will extinguish.

This feature can be used to alternate between different devices and need not be restricted to simply turning them on and off. The only limit to this feature is that each event can have a maximum of twenty gaps, which can each last up to 2000ms. Thus, the maximum duration for the events that have this feature is 82000ms!


Maximum Values

Within XGen, a number of different boxes can contain user-entered numbers. Here is a summary of the maximum values each box-type can contain.

Number of Conditions 64
Trials/Block (per condition) 32
Stat Cond Same as no. of conditions
Event Durations (ms) 2000 [except *]
Number of gaps 20
Random (ms) 995
All sounds (Hz) 8000
*Post Target (ms) 30000
Total Blocks 100
*‘C’ and ‘K’ (ms) 5000
Port Setting (Hardware) 4000

Prototype Trial

A Prototype Trial is a generic trial for your experiment. As the first step in creating a new experiment, you should design a prototype trial. To save time when editing individual conditions, it is a good idea to set the prototype such that its settings are as close as possible to each condition that you have in mind. This will often be condition number one but this is not necessarily so. Once you have designed the prototype trial follow the procedure outlined in the Creating an Experiment section.


Hardware Setup

By clicking on the Hardware (Computer) button, you will be presented with the Hardware Setup window. This contains four edit boxes: one for eye monitor selection, two for the selecting the output port sand one choosing the input device. There are currently seven supported eye monitor inputs, which determine the Analog to Digital Conversion (ADC) protocol which will be used to read the gaze position (systems marked with a * record both horizontal and vertical data, software also exists to record horizontal and vertical 12-bit serial data: contact Chris Rorden for details):

Serial 8-bit Implements the TLC-549 chip through the parallel port to sample from -3..+3 volts. Historical input: new users should consider the simpler serial 12-bit option.
Parallel 8-bit Proprietary connection with the ASL 210 eye monitor (-3..+3 volts). The parallel port at LPT1 will be used for the ADC, and can not be used for digital output.
Serial 12-bit Uses the elegant Max176 ADC to sample -5..+5v. The most flexible eye monitor input available in XGen.
Parallel 12-bit Samples a Blue Chip Technologies DCM-16 ADC card from -5..+5v. The card's DIP switches should be set for address 210h.
ASL 5k Demand* ASL5000 contol unit's digital demand/request protocol. This is a historical input device: users of the ASL5k should upgrade their software to support Streaming mode (see ASL tech note 5008).
MicroTouch* MicroTouch touchscreen input, using the serial port (Com1).
ASL5k Streaming* Implements the ASL 5000 eye monitor control unit's streaming digital format via the serial port (port must be set to Com1).
Parallel 8-bit
v2
Proprietary connection with the ASL 210 eye monitor (-3..+3 volts). The parallel port at LPT1 will be used for the ADC, and can not be used for digital output. Version 2 interface also supports my IOBox interface. See my IO schematics.

Select the digital output that corresponds to your equipment. Modern versions of XGen automatically detect which parallel port LPT addresses are being used, so you usually do not have to worry about which particular port you will select (e.g. LPT0 or LPT1).

LPT Allows you to control 8 digital outputs connected to the parallel port. This selection writes directly to eight pins of the parallel port, allowing the user to implement simple output boxes. e.g. see figure A3 on my hardware page
LPT IOBox Uses the 74hc595 and 74hc165 integrated circuits to control eight digital inputs, 16 digital outputs, and 12-bit serial ADC from a single parallel port. Using this design, a laptop can run all aspects of an experiment (see my diagram A4)
Other Allows you to use any standard IO card (e.g. Blue Chip Technologie's DOP-24). You will be asked to select the specific port address of the card (enter the decimal [not hex] address of your IO card).

You can also select your desired digital input from the hardware window. You have four options:

Keyboard Uses the keyboards left shift, right shift, ctrl and alt keys for left, right, up and down responses. Note that PC keyboards tend to be temporally sloppy, so they do not make ideal input devices.
Serial port Reads four lines of the serial port (pins 6,9, 1 and 8 correspond to buttons left, right, up and down) directly. This is a simple design with excellent timing.
Mouse Reads the mouse buttons (left and right buttons only). Serial port mice (with D-shaped connectors) can give ms accuracy, in-built laptop mice and serial-mice (those with round connectors) are somewhat inaccurate. Requires a DOS mouse software driver (available freely from the web).
IOBox Uses the 74hc595 and 74hc165 integrated circuits to control eight digital inputs, 16 digital outputs, and 12-bit serial ADC from a single parallel port. Using this design, a laptop can run all aspects of an experiment (see diagram A4 of the hardware guide)
LPT Direct Allows the parallel port inputs to be read directly, as described in my IO schematics page.

Preferences

By clicking on the Preferences (Cogs) button, you will be presented with the Preferences window. Details about your experiment that are not specific to particular conditions can be found here.

There are three additional events here. The Response Error event will take place immediately after a trial if the response given by the subject is wrong. In addition, when eye-movements are being measured, the Eye-Move Error will take place after the Response Error event if an eye-movement error occurs. The Inter-Trial event takes place after every trial regardless of subject performance. Choose the duration and content of the events as before, noting that flicker and gaps can apply to the two Error events only.

Other values set here are:

  1. The maximum number of blocks per experiment.
  2. The computer generated sound to indicate the end of each trial and/or block.
  3. Whether each trial is cut short once the subject responds (Response Ends Trial).
  4. Whether the eye-movement monitor is on.
  5. Whether responses are speeded.
  6. The identity of any Release Key.
  7. The values of ‘K’ and ‘C’.
  8. Whether the start of a trial is delayed until only the required release keys are depressed (start check). Note that the trial duration may be variable is start check is selected. This feature should be switched off if each trial must have the same fixed duration (e.g. PET studies).
  9. Start hold: If this option is selected, the start of a trial will be delayed until the keyboard's 'insert key' is depressed. This is useful for studies where the experimenter wants to initiate each trial. However, when start hold is selected, the duration of individual trial will be variable.
  10. Inverted keys.

 


Inverted Keys

The preferences window includes a check box for inverted keys. Any or all of the response keys can be selected to run in Inverted mode. This essentially means that a closed switch (a depressed key) will be treated as if it were open (released) and vice versa. Inverted keys detect the release of buttons, rather than detecting when they are depressed. This is useful in studies where foot pedals are used (and you want to measurea toe or heel lift). Inverted keys must be depressed at the beginning of a trial if 'start check' is selected


Release Key

The Release Key feature, which can be selected in the Preferences window, allows the experimenter to time subject journey times. For example, if the time taken by a subject to reach to a target is of interest (the so-called 'execution' or 'transport' time) then the release key feature can be used to do this. The subject should keep the designated switch (named the ‘Release Key’) depressed until the target appears. When this happens, he should reach as quickly as possible to the target switch and depress that. XGen records the latency to release the first switch and the time taken to arrive at the second. The joysticks buttons are used as the release key, unless the Hardware Setup's input is set to IOBox, where the IOBox's 5th and 6th buttons are used as inputs.


Response Ends Trial

If Response Ends Trial is selected in the Preferences window, as soon as the subject presses a response button the trial halts. This is true wherever in a trial the subject presses the button and does not depend upon the subject making the correct response. If the response comes before the onset of the Target event, the reaction time is recorded as zero and the trial is classified as a Procedural Error. If the response comes during the Target event, this event is cut short and the reaction time is recorded as the number of milliseconds elapsed since the onset of the Target. As soon as the trial ends, the computer presents any error feedback events and finally the Inter-Trial event, before starting the next trial. For the purposes of feedback, both Procedural and Response Errors lead to the Response Error event being presented. This feature can also be toggled on and off from within the MS-DOS application prior to running the experiment, by selecting Exit with Response. When both 'response ends trial' and 'start check' are switched off, each trial will require exactly the same amount of time to complete. This can be useful in PET and event related fMRI studies, where scan aquisitions occur at regular intervals.


Unspeeded Responses

For unspeeded responses, set the post target time for each conditionto its maximum value (32,000 ms). Make sure that the experiment preference's 'response ends trial' box is checked (otherwise each trial will always require more than 30 seconds to complete). This feature useful when the response type itself is of primary importance (for example, when conducting a Double Simultaneous Stimulation paradigm on an Extinction Patient). The analysis of results is also fundamentally different for such experiments soyou may want to set the Statistics window to graph errors rather than reaction time.


K and C

The values of ‘K’ and ‘C’ are designed to change the duration of the Target event for all conditions. This feature, while being accessible form the Windowsinterface, is mainly to be used while running an experiment from the MS-DOS interface using the Constants feature. The duration of the Target event includes the constant ‘K’ and any gaps selected include the constant ‘C’. Thus if the experimenter is trying to raise a particular subject’s performance from the ‘floor’ the target could be made more salient by increasing its duration. If the experiment involves the detection of gaps, these can be made more salient by increasing ‘C’. If the target is a simple non-flickering LED, this can be made more salient by increasing ‘K’. If your experiment is designed accordingly, the independent effects of ‘K’ and ‘C’ can be used to make some Target events more salient while making others less so.

 


Running an Experiment (DOS, The Basics)

Experiments designed with XGen must be run from MS-DOS. This is because the millisecond timer can be disrupted by the Windowsoperating system.

From within MS-DOS run the application Xgen.exe, avoiding its near namesake Xgenesis.exe. To run Xgen in the standard 640x350 resolution, type 'Xgen', to implement a 800x600 pixel screen launch the program with 'Xgen 15', and for 1024x768 run the program with the command 'Xgen 16'. Launching the program with the parameter 'h' (e.g. 'Xgen 15 h') will attempt to restore the program's hardware defaults, which can be useful if the program's hardware file has been corrupted (you will probably want to run XGenesis to restore your preferred hardware settings). The 'j' parameter inverts the joystick values [some computers automatically invert the joystick inputs]. The 'm' parameter waits for an unspeeded manual response before starting the next trial. To see a list of all of the possible startup parameters, run 'xgen ?'.

Choose the experiment you require from the list presented. On doing this, you will be presented with the basic XGen MS-DOS interface. All commands available are listed on the left and are invoked by typing their initial letter. Details regarding the experiment that you have opened are listed on the right. If you are happy with the experiment you have designed with the Windows-based interface then run the DOS program and open the Settings/modify menu item. You will want to check that

  1. eye-movements are being monitored (if required)
  2. trials exit with response
  3. all hardware

Having done this, start the experiment by selecting the Experiment/run menu item (or Experiment/practice if you do not wish to save your data).

If data is being saved, then you will be prompted to enter a file name (for example, the name of the subject) limited to seven characters (no spaces). If eye movements are being monitored, then you will be prompted to enter the acceptable limits beyond which trials will be rejected for deviation. This must be done after the eye-movement monitor is in place and the subject has adopted the experimental posture. When the dialogue box reads "…enter accepts" the experimenter has a choice. Either the eye-movement values can be re-set (by pressing ESCAPE), or the values can be accepted and the experiment begun (by pressing ENTER or ¿ ). For more information about eye monitors, see the Eye movement calibration section. Between blocks, instructions will appear in dialogue boxes for the experiment to continue.

At the end of the experiment, you return to the main menu by following the dialogue box instructions. To exit the program, choose the System/exit menu item.


Modifying the Experiment from the MS-DOS Interface

In general, it is a good idea to use the Windows interface of XGen to set-up correctly for your experiment. However, a few settings can be changed from within the MS-DOS interface. The following functions can be toggled on and off by typing their initial letter: Data save; Eye monitor; Xit w. Response. The maximum number of blocks and the number of those designated as practice is set by typing B. (Note: the number of practice blocks can be changed retrospectively. This means that the statistics output will ignore the first blocks, which it will consider as practice.) A range of self-explanatory hardware and other setting can be changed by typing P (Preferences). See also ‘K’ and ‘C’.


Testing the Hardware(DOS)

XGen (the DOS program) has three functions that allow you to test that your hardware is working properly. Hardware Test (in the Experiment menu) closes each switch of Port 1 in turn. This should switch each connected component on. Then, each of the response switches is tested and finally the eye-movement monitor output is displayed. Eye tracker (in the System menu) allows the eye-monitor output to be viewed. Finally, the Practice command (in the Experiment menu) allows you to dry run an experiment without saving data to disk.


Appending Data to Old Data Files(DOS)

The Experiment menu's Append function allows the data from the current experiment to be appended to a previous data file. For example, if your experiment has blocked design independent of the within-block conditions the blocks might be performed in the order ABBA. This being the case, you might want the data form the fourth block to carry on directly where the first block left off. The above scenario could be performed as follows. At the start of the first block, select Run (experiment menu) and name the block "s1ba" (Subject 1, blocked condition A). At the end of this block, exit to the main menu and start the second block by selecting Run again and naming it "s1bb". Run two blocks of this condition before quitting to the main menu. Then, instead of selectingRun, invoke the function Append by selecting Append. From the list of data files, chose "s1ba". Then run the experiment as normal. You will notice that the block number will be 2, carrying on from the first block. Even if you chose to append to an aborted block, the block number will be increased by one. Normally, when you run an XGen experiment, all of the settings and date/time are stored in the data file (allowing you to check the settings you used post hoc). However, when you append data, it will not record the settings of the Appended session.


Eye movement calibration(DOS)

When eye-movements are being monitored, the program requires a calibration to be performed before each block. The experimenter should decide what the maximum deviation from fixation should be (for example, 5° of visual angle). Beyond this point, deviations will be classified as eye-movement errors. Markers should be placed at these points to allow subjects to fixate during calibration. Prior to each block, dialogue boxes guide the experimenter through the calibration procedure. If, during a block, the calibration needs repeating, press the SPACEBAR and the block will pause. If the SPACEBAR is pressed by mistake, pressing ESCAPE will give you the choice of aborting the block entirely or returning to it. At all stages, the choices are presented in dialogue boxes.

XGen's settings/modify command allows you to select whether or not you want to save eye movement traces to disk. If you save traces, you will be able to view eye traces off line (e.g. if you want to observe an individuals gaze pattern during a trial). The eye movements are saved in a compressed binary format, which can be read by the Windows software EMView. EMView can report saccade latencies and fixations based on velocity measures, as well as maximum velocity, time to peak, peak to stop measures. In addition, EMView can display real time simulations of eye gaze patterns.


Statistics (Windows)

From the main XGenesis window there are two buttons with icons of graphs which allow you to access the statistics window. These two buttons allow two different ways to analyze the data. The 'analyze data file' button will analyze trials based on the currently displayed stat conds. The 'raw data analysis' analyzes the trial data by the experimental condition (stat conds are ignored).

XGen automates the analysis of trial data. For each analysis you should select which continuous measure you wish to examine:

There are three basic methods of graphically presenting data.

Trial filtering can be performed to remove practice blocks from analysis, as well as trials for which the reaction times fall outside an acceptable range (you can independently set values for release time, response time, eye movement time and transport time). The relevant values should be set in the Statistics window prior to analysis. To analyse a single data file, click on the Analyse button and select the relevant file. To group together several files for analysis, click first on Analyse to select the first file, and then on Group to add each file in turn. The files, which are part of any displayed statistics, are shown in the bottom right panel. To analyze all of the data sets contained in a folder, click on the 'folder' button. If the settings are changed in any way the display becomes blank to prevent any confusion and the files must be entered afresh.

Several special analysis check boxes are also available. Future versions will also allow exclusion of trials which are 1.5 interquartile ranges [IQRs] faster than the fastest quartile, and trials which are 1.5 IQR slower than the slowest quartile. This 'intelligent' outlier exclusion criteria is currently available in my XLGen software [ shift+click here to download a beta version {fully functional except the ANOVA features}], which is a Microsoft Excel for Windows utility.

  1. RT w Errors: RTs include trials where an incorrect response was made.
  2. t-tests: selects whether t-tests will be performed between each condition.
  3. Prev Trial Filter: Excludes analysis of trials which follow a response error. There is evidence that individuals have an unusual response pattern subsequent to response errors.
  4. Reach errors OK: includes errors with reach errors into the analysis.
  5. EM errors OK: includes trials with eye movements into the analysis.

XGen's statistics window includes several buttons which allow you to copy data to other analysis packages (e.g. Excel). The button with a floppy disk icon allows you to copy the filtered (using the settings you have selected) RT data to a text file. The button attached to the data window which shows a text file being copied to a clipboard will copy the contents of the data window to the clipboard. The icon of a file with the sigma symbol and a clipboard copies most of the critical statistics as a single row of text. You can use this sigma feature to copy data from several individuals and paste them into an analysis package for performing a repeated measures ANOVA, allowing one row of data for each participant.


Statistical Output (Windows)

The numerical information displayed in the Statistics window of XGenesis is arranged in columns. Each column heading has the following meaning.

The next six columns give details of trial rejection due to various criteria. Each rejection criterion is applied to those trials remaining after the previous criteria have been applied and the number or percentage recorded relates to trials rejected at each successive level. Percentages relate to remaining trials only.