EyeLink and Psych APIs for Mac OS 9

Last updated 12/20/2002 by msp

GMU >> Psychology Dept. >> HFAC >> People >> Matthew S. Peterson >> Code

 

What it is:

The code on this page comes in two parts: (1) the stand alone Psych APIs (PAPI) for programming Mac and Windows machines, and (2) my version of the Eyelink software that is dependent on PAPI. While PAPI is Carbon compliant, the Eyelink libraries are not. That means that you must target the Mac Toolbox when using CodeWarrior. Although PAPI is Carbon compliant, at this time I can not vouch for its timing accuracy under OSX. Until more is known about timing under OSX, I can not recomend anyone using it for data collection or stimulus presentation.

Current Stage of Progress:

At this point, the code on this page is late beta. I does work, and I have collected data, but there are still a few known issues (see below). In addition, the code is not as refined nor as commented as I'd like it to be, and the documentation is out of date. For those that want to get started, feel free to jump right in. I'll release a more refined version later in January 2003.

The Parts:

  1. Psych APIs (PAPI)

    [Don't forget the humoursly dated PAPI (nee Psych Toolbox) documentation!]

    PAPI is a cross-platform (Mac Toolbox, Mac Carbon, and Windows) set of APIs for writing Psychology experiments in C++. It includes functions and objects for manipulating bit maps, simple drawing, keyboard and voicekey (Mac only) input, and timing. PAPI is designed to abstract these functions from the underlying OS. Note that this does not include the latest version of the Winodws functions and objects.

  2. PsyCarbon.cpp Carbon compatibility
    PsyGeneral.cpp Startup and other routines
    PsyGraphics.cpp Drawing routines
    Psyio.cpp Keyboard input
    PsyNumerics.cpp Math, randomization, and statistical functions
    PsyPictSave.cpp Screen Capture
    PsyTcards.cpp Virtual Tachistoscope card C++ objects for bitmap manipualtion
    PsyTimer.cpp Timing objects and functions
    PsyVBL.cpp Vertical retrace synchronization

     

  3. My Eyelink files (included in PAPI.zip download)
  4. Eyetrack2.c Common Eyetracking functions. Adapated from Roger Marsh's DOS Eyelink code.
    EYE_ON.C Release Version
    EYE_OFF.C Debug Version
    EYE_FIND2.C Used for gaze contingent displays
    A note about Eye_On and Eye_Off: when developing for the DOS based Eyelink system at the Beckman institute, I would make 2 nearly identical projects: a debug and a release version. The debug version could run without the Eyelink, whereas the release version only ran when connected to an Eyelink machine. The two projects differed in that the relase version contained the file Eye_On.c and the debug version contained Eye_Off.c. Eye_Off, for the most part, contained empty functions, whereas the same functions in Eye_On pointed to the working versions of the functions. I've attempted to do the same thing here, but Eye_Off is still a work in progress and does not currently allow you to debug without the Eyelink connected. Note that the Antisaccade demonstration code has Eye_off turned of in the release target, and vice-versa.

     

  5. SR Research Eyelink Libraries
  6. Also include SetPixelsQuickly.c from the VideoToolbox.

  7. Modified versions of SR Research Eyelink files (included in PAPI.zip download)

    These are based on SR Research's Eyelink code. With one exception, it has been adpated to use PAPI rather than the VideoToolbox APis. 'mac_cam_graf2.cpp', which draws the camera graphics on the subject display is dependent on SetPixelsQuickly.c (see point #3 above)

  8. Antisaccade demonstration code

    A simple antisaccade experiment demonstrating the use of PAPI for the Eyelink system. You might need to modify the paths in Codewarrior for it to compile.

To Do:

  1. Add EyeCmdPrintf() to EyeOn and EyeOff. This will map eyecmd_printf() in Eye_Off for debugging.
  2. Update PAPI with the latest PAPI source code.
  3. Update the documentation!!!!
  4. Add oculomotor capture and visual search demo experiments.

Known Bugs:

  1. The first time the program is run, eyetracker intiialization will fail. It will work if you quit the program and run again.
  2. Debugging without an eyetracker does not work yet. See 'To Do #1' above.
This page has been accessed times.