VSG program notes.
In early 1998 I wrote software to control a Cambridge Research Systems VSG.  The  program (emvsg.exe) is likely to remain a "work in progress" with new features being added and bugs fixed and features refined.  The software is written in Delphi-2  and requires windows-95 (or NT?) to run. Presumably it will run under windows-98 as well - beyond that who knows! 
 
Currently (Easter 1998) the program performs 3 main test. 
1-  Grating Tasks. 
2-  Contrast Sensitivity Function (CSF) testing. 
3-  Letter Acuity testing. 
All 3 types of tests have their own drop down menu with a "run task" and "options" menu item in each. There is also a "file" menu which allows the user to open text file (such as the data file created by the program). The  text editor uses a MDI (multiple document interface) so more than one file can be viewed/edited at once. The file menu also allows the user to exit the program (same as clicking the close box). 
The main menu contain an "About" item which shows a mug shot of "yours truly"  along with my present email and WWW address. 

Subject responses.
How the subject response is entered into the computer varies with the type of test and selected options for that test. Initially the keyboard or mouse will be used but a response box is likely to be added at a future date.  Generally the subject will enter their response directly ( i.e. for grating and CSF tasks) but the researcher will enter the response in the case of the letter acuity test. For the grating and CSF tasks the response is either YES/NO,  HORIZONTAL/VERTICAL or FIRST/SECOND depending on the options selected. For the letter acuity task the subject calls out the letter they see and the researcher enters CORRECT/INCORRECT. 

Staircases.
All the tests use a modified staircase method to estimate thresholds. A simple staircase  consists of a series of stimulus presentations which the subject responds to. Initially an "easy" task is presented and this task is made more difficult (higher spatial frequency or lower contrast)  until the subject can't see the image. This completes the first "run" of the staircase which ends with the first "turn". 

The amount the image is changed between presentations is called the "step-size" . Steps are in log units (either Logmar or Log Contrast). The task can be thought of as taking steps in one "direction" or another - moving from easy to difficult or visa versa. 
A series of steps  in one direction is called a "run". Changing direction is called a "turn". The first run generally takes larger steps than subsequent runs, otherwise the first run could take large number of steps. 

After the first turn the task becomes easier again until the subject can see the image again, once again we turn and make the task harder. We repeat this a number of times - for example eight runs total.  When we turn we note the midpoint of the now complete run (i.e. halfway between turns) and sum this so we can take the average when all the runs have been completed. This first run is ignored because the initial starting point is arbitrary hence its midpoint is not useful. The second run *may* also be ignored because the large step size in run one may cause the first turn to have an overshoot error. The remaining runs should have mid-points close to the threshold and the average of these points  gives us an estimate of the threshold with a 50 percent confidence level. At present the program decides whether to ignore the second run based on whether the total number of runs is odd or even. If "runs" is even the first two are ignored, else only the first is ignores. 


Changing the confidence level.
Because subjects may lie or have some bias when ask if they can see a grating - some of the tests require the subject to report the orientation of the grating or which of two fields the grating is in. Since guessing would result in them being correct 50 percent of the time we modify the staircase to measure the threshold at some higher confidence level. This is fairly easy to do with a modified staircase. The modification consists of changing the criteria for turning. If  we  still turn after one "invisible" response but don't turn back unless we have two "visible" responses instead of one (re-tested at the same level) then we bias the confidence level too approximately 70 percent. We call this re-testing  at the same level having an N value of 2, a simple staircase has N = 1; if we make N = 3 the confidence level goes up again to approximately 80 percent. We can also lower the confidence level by doing the opposite - re-testing the invisible responses instead of the visible ones. 
 


Interleaving.
We often run more than one staircase during a test. We may wish to test :- 
  • both horizontal and vertical gratings.
  • both hi-condifence and low-confidence thresholds.
  • number of different spatial frequencies. 
When we have a test which involves doing more than one staircase we interleave the steps. This means rather than doing each complete staircase in turn we randomly mix up the steps from different staircases, so nobody knows what is being tested at any given time. In some case we may have dozens of interleaved staircases. 
There is a potential problem with the interleaving I've implemented. The problem is that staircases will complete at different times. This is partly because the staircase method  does take a fixed number of presentations to complete  and also because of the nature of random number generation. This results in little or no interleaving at the end of a test when all but one or two staircases have completed. If this proves to be a problem we may have to either find a way to bias the random number generator to favor staircases with low run numbers. 
Grating tasks.
The purpose of the grating tasks is to determine the maximum spatial resolution a subject can see at a fixed contrast level (usually %100). 
Here we have the grating parameters options dialog box. At the top we select the type of task or test mode. 
We may not have the best names for the different task modes but currently. 
  • Resolution task - Means that the grating is presented with either vertical or horizontal orientation. The subject responds with which orientation they think it is. Below threshold we would expect them to guess correctly %50 of the time. However horizontal and vertical thresholds are likely to be different so usually both horizontal and vertical stimuli are present during the test and both horizontal and vertical thresholds are determined.
  • Detection F/C - means two presentations are made, one presentation is a blank field and the other contains a grating. The order is random and each presentation starts with an audio cue. The subject responds as to whether they think the grating was in the first or second presentation. Below threshold we would expect them to guess correctly %50 of the time.
  • Grating Acuity - means the grating is presented and the subject simply responds as to  whether or not they can see the grating.
We can change the N value and number of runs using "spinedit" boxes (see image). The grating angle can not be changed in the resolution mode and is ghosted out in this mode - angles are in integer degrees. The resolution can only be set in the test mode and is ghosted in other modes. The Contrast would normally stay at %100 but can be changed to any integer value. The sustain value is in seconds and is limited to around 10 seconds - this depends on the monitor frame rate. The sustain and decay values are in frames and must not be zero. 
 CSF tasks.
The purpose of the "Contrast Sensitivity Function" (CSF) tasks are to determine the minimum contrast a subject requires to see a grating at a particular spatial frequency or set of frequencies. 
Most of the controls on this dialog box should be familiar if you've read the grating task text. One new control enables you to test both hi and low confidence thresholds for the detection task - though this feature is unlikely to be used much. The other new control is an array of check boxes to enable/disable particular spatial frequency tests. The spatial frequencies are in 0.1 Logmar steps. 
 Letter Acuity
The Letter Acuity task determines a subjects visual acuity by presenting a series of random letters on the VSG monitor. Ten letters are use and they are 'DEFHNPRTUV'. The size of the letter is varied in a staircase method. The letter size can be one of 15 - 0.1 Logmar steps. 
 This software directly accesses the VSG palettes and may not work on others VSG models. The contrast feature is un-calibrated and must be checked before serious use at anything but %100 contrast. The "letter size" spinedit control is for testing purposes only - it allows you to choose letter sizes 0-14 (0 being the largest). Unlike the grating tasks this task does not use the temporal wave form generator to generate attack and decay ramps. 
Running tasks
When running a task the first thing you will have to do is use the "SaveAs" dialog box to choose a name and directory for the results to be saved to. 
 
Next fill out the subject details and collect the actual data. 

When you're done a text file containing the results will be displayed on the PC screen. In the case of the CSF a scatter plot will be shown first. Generally the data will be copied to another package (e.g. excel) for analysis. 
 


 
;VSG data file - 
Today is  28/04/98 
Time is  9:19:12 
C:\PROJECTS\QUT\NIALL\vsg\demo.dat 
;Subject Name Bugs Bunny 
;Subject No. 0 
;Age 55 
;Researcher ekm 
;comment Do carrots improve visual acuity... 
detection - H/V interleaved Y/N response 
;Interleaved horizontal and vertical staircases 
;Runs 6 ingore 2 
;vert ;turn 1 at 16 
;horz ;turn 1 at 16 
;vert ;turn 2 at 15 
;vert ;turn 3 at 16 midpoint 15.50 
;horz ;turn 2 at 15 
;vert ;turn 4 at 15 midpoint 15.50 
;horz ;turn 3 at 16 midpoint 15.50 
;vert ;turn 5 at 16 midpoint 15.50 
;horz ;turn 4 at 15 midpoint 15.50 
;horz ;turn 5 at 16 midpoint 15.50 
;vert ;turn 6 at 15 midpoint 15.50 
;vertical staircase finished 
;horz ;turn 6 at 15 midpoint 15.50 
;horizontal ;staircase finished 
vert result - step 15.50  logmar-0.25 
horz result - step 15.50  logmar-0.25 
 
 
An example data file is in the gray box on the left. The format of this file will change with future development. Much of it is for validating and debugging. Most people will just want the results and the end of the file. 
The file header includes the file name, creation time, creation date and details entered into the subjects details box. 
Reading on you can see this was a detection task with horizontal and vertical gratings being interleaved. I requested 6 runs and the program ignored the first two for reasons stated earlier. The turns were logged so the results can be verified manually if need be. The turns and midpoints are logged as step numbers not Logmar values. The numbers can be translated to Logmar by the formula :- logmar=-1.3-Number*0.1 
 
 
 
 
 Back to Eddie's VSG page