SR Research Support Site

Introduction

Introduction

Performing research with eye-tracking equipment typically requires a long-term investment in software tools to collect, process, and analyze data. Much of this involves real-time data collection, saccadic analysis, calibration routines, and so on.

The EyeLink® eye-tracking system is designed to implement most of the required software base for data collection and conversion. It is most powerful when used with the Ethernet link interface, which allows remote control of data collection and real-time data transfer. The PyLink toolkit includes Pylink module, which implements all core EyeLink functions and classes for EyeLink connection and the eyelink graphics, such as the display of camera image, calibration, validation, and drift correct. The EyeLink graphics is currently implemented using Simple Direct Media Layer (SDL: www.libsdl.org).

Organization of This Document

EyeLink Programming Conventions of this document introduces the standard form of an EyeLink experiment and some important EyeLink messages. This will help in understanding the sample code, and is also valuable to programmers in understanding how to write experiment software, and how to port existing experiments to the EyeLink platform. Overview of PyLink module documents the common functions and classes used in the pylink module. You will rarely need other functions or classes than those listed here. Finally, a detailed analysis of a sample program and code follows. This sample contains code that can be used for almost any experiment type, and can be used as a starting point for your own experiments.

Getting Started

Please refer to the EyeLink II Installation manual for instructions on how to set up the Subject PC for use with the API. For Python programming, you may refer to the book "Python in a Nutshell" by Alex Martelli or any other books on this topic.

EyeLink Programming Conventions

The Pylink library contains a set of classes and functions, which are used to program experiments on many different platforms, such as MS-DOS, Windows, Linux, and the Macintosh. Some programming standards, such as placement of messages in the EDF file by your experiment, and the use of special data types, have been implemented to allow portability of the development kit across platforms. The standard messages allow general analysis tools such as EDF2ASC converter or EyeLink Data Viewer to process your EDF files.

Outline of a Typical Windows Experiment

To help in understanding the sample code, we first introduce the standard form of an EyeLink experiment. This is also valuable to programmers in understanding how to write experiment software, and how to port existing experiments to the EyeLink platform. A typical experiment using the EyeLink eye tracker system will use some variation of this sequence of operations:
  • Initialize the EyeLink system, and open a link connection to the EyeLink tracker.
  • Check the display mode, create a full-screen window, and initialize the calibration system.
  • Send any configuration commands to the EyeLink tracker to prepare it for the experiment.
  • Get an EDF file name, and open an EDF data file (stored on the eye tracker).
  • Record one or more blocks of trials. Each block typically begins with tracker setup (camera setup and calibration), and then several trials are run.
  • Close the EDF data file. If desired, copy it via the link to the local computer.
  • Close the window, and the link connection to the eye tracker.

For each trial, the experiment will do these steps:

  • Create a data message ("TRIALID") and title to identify the trial.
  • Create background graphics on the eye tracker display.
  • Perform a drift correction, or display a fixation target.
  • Start the EyeLink recording to the EDF file.
  • Display graphics for the trial. (These may have been prepared as a bitmap before the trial).
  • Loop until the trial time is up, a button is pressed on the tracker, or the recording is interrupted from the tracker. The display may be changed as required for the trial (i.e. moving a target to elicit saccades) in this loop. Real-time eye-position and saccade/fixation data are also available for gaze-contingent displays and control.
  • Stop recording, and handle any special exit conditions. Report trial success or errors by adding messages to the EDF file.
  • Optionally, play back the data from the trial for on-line analysis.

This sequence of operations is the core of almost all experiments (see Example: GCWindow for an example illustrating the above concept). A real experiment would probably add practice trials, instruction screens, randomization, and so on.

During recording, all eye-tracking data and events are usually written into the EDF file, which is saved on the eye tracker's hard disk, and may be copied to the Subject PC at the end of the experiment. Your experiment will also add messages to the EDF file to identify trial conditions and to timestamp important events (such as subject responses and display changes) for use in analysis. The EDF file may be processed directly using the EyeLink DataViewer application, or converted to an ASC file and processed by your own software.

Standard Messages

Experiments should place certain messages into the EDF file, to mark the start and end of trials. These will enable the SR Research viewing and analysis applications to process the files. Following these standards will also allow your programs to take full advantage of the ASC analysis toolkit.

Text messages can be sent via the toolkit to the eye tracker and added to the EDF file along with the eye data. These messages will be time stamped with an accuracy of 1 millisecond from the time sent, and can be used to mark important events such as display changes.

Several important messages have been defined for EDF files that are used by analysis tools. The "TRIALID", "SYNCTIME", and "TRIAL OK" messages are especially important and should be included in all your experiments.

  • "DISPLAY_COORDS" or "RESOLUTION" followed by four numbers: the left, top, right, and bottom pixel coordinates for the display. It should be one of the first messages recorded in your EDF file. This gives analysis software the display coordinate system for use in analysis or plotting fixations. This is not used to determine the size in visual degrees of saccades: angular resolution data is incorporated in the EDF file for this purpose.
  • "FRAMERATE" followed by the display refresh rate (2 decimal places of accuracy should be used). This is optional if stimulus presentation is not locked to the display refresh. Analysis programs can use this to correct stimulus onset time for the vertical position on the stimulus.
  • "TRIALID" followed by data on the trial number, trial condition, etc. This message should be sent before recording starts for a trial. The message should contain numbers ant text separated by spaces, with the first item containing up to 12 numbers and letters that uniquely identify the trial for analysis. Other data may follow, such as one number for each trial independent variable.
  • "SYNCTIME" marks the zero-time in a trial. A number may follow, which is interpreted as the delay of the message from the actual stimulus onset. It is suggested that recording start 100 milliseconds before the display is drawn or unblanked at zero-time, so that no data at the trial start is lost.
  • "DISPLAY ON" marks the start of a trial's display, and can be used to compute reaction time. It may be preceded by a number may follow, which is interpreted as the delay of the message from the actual stimulus onset. It is used like the "SYNCTIME" message, and may be used in addition to it.
  • "TIMEOUT" marks the end of a trial when the maximum duration has expired without a subject response. This can also be used when the trial runs for a fixed time. It is suggested that recording continue for 100 milliseconds after a timeout, in case a fixation or blink has just begun.
  • "ENDBUTTON" followed by a number marks a button press response that ended the trial. This can be used in place of the EyeLink button box for local key responses. It is suggested that recording continue for 100 milliseconds after the subject's response.
  • The optional message "TRIAL_RESULT" followed by one or more numbers indicates the result of the trial. The number 0 usually represents a trial timeout, -1 represents an error. Other values may represent button numbers or key presses.
  • "TRIAL OK" after the end of recording marks a successful trial. All data required for analysis of the trial (i.e. messages recording subject responses after the trial) must be written before the "TRIAL OK" message. Other messages starting with the word "TRIAL" mark errors in the trial execution.

Messages can also be used to timestamp and record events such as calibrations, start and end of drawing of complex displays, or auxiliary information such as audio capture recording indexes. Be careful not to send messages too quickly: the eye tracker can handle about 20 messages every 10 milliseconds. Above this rate, some messages may be lost before being written to the EDF file.

For the ease of data analysis with EyeLink Data Viewer, special viewer message can be added to the EDF file. Examples of these commands include defining the image to overlay, creating interest areas, and specifying trial variables. See "EyeLink Data Viewer User's Manual" for details.

Overview of PyLink module

The interaction of the EyeLink tracker and your experiment is fairly sophisticated: for example, in the Setup menu it is possible to perform calibration or validation, display a camera image on the Subject PC to aid in subject setup, and record data with the experiment following along by displaying proper graphics. Large files can be transferred over the link, and should the EyeLink tracker software terminate, the experiment application is automatically terminated as well. Keys pressed on the Subject PC keyboard are transferred to the EyeLink PC and operate the tracker during setup, and buttons pressed on the tracker button box may be used to control the execution of the experiment on the Subject PC.

Pylink, a Python wrapper for Eyelink core API, implements all of the functions and classes for EyeLink connection and graphics, such as the display of camera image, calibration, validation, and drift correct. Each of the above operations required just one line of code in your program. Almost all of the source code you will write is for the experiment itself: control of trials, presentation and generation of stimuli, and error handling.

Please see a detailed description of all functions in the pylink module and all classes in this module under Classes section.

Overriding Calibration Target

Overriding calibration target is required for controlling calibration targets on broadcast applications. In C this is handled by using function pointers. However, in Python this is easily handled by over-riding specific methods namely drawCalTarget in EyeLinkListener class.

class BroadcastEyelink(EyeLinkListener):
    def __init__(self):
        EyeLinkListener.__init__(self)

    def drawCalTarget(self, pos):
        x = track2local_x(pos[0])
        y = track2local_y(pos[1])
        EyeLinkListener.drawCalTarget(self,(x,y))

Example: GCWindow

This section gives one specific example of programming an EyeLink experiment using the pylink module. The most useful real-time experiment is a gaze-contingent display, where the part of the display the subject is looking at is changed, or where the entire display is modified depending on the location of gaze. These manipulations require high sampling rates and low delay, which the EyeLink tracker can deliver through the link.

You should run this experiment at as high a display refresh rate as possible (at least 120 Hz). You may have to decrease the display resolution to 800x600 or even 640x480 to reach the highest refresh rates, depending on your monitor and display card and driver. Higher refresh rates mean lower delays between eye movements and the motion of the window.

This template demonstrates how to use the link's real-time gaze-position data to display a gaze-contingent window. This is an area centered on the point of gaze that shows a foreground image, while areas outside the window show the background image. You supply full-screen sized bitmaps for these, and update the display based on the current gaze position. The template demonstrates this window with text and pictures.

The graphics used in the current example is pygame (http://www.pygame.org/), please make sure that this program has been installed in your computer.

Files Required for the Example

To run the GCWindow demonstration, type "gcwindow_main.py" from the dos prompt. Make sure that you have the gcwindow_main.py and gcwindow_trial.py file in the experiment directory. The former is used for experiment setup, such as connecting or shutting down the link and experiment graphics, opening EDF file, etc. The latter is used to run the actual trials. This file handles standard return codes from trials to allow trial skip, repeat, and experiment abort. This file can be modified for your experiments, by replacing the trial instance code. In addition, other support files (sacrmeto.jpg, scr_blur.jpg, and cour.ttf) should also be included in the same directory.

Analyzing "gcwindow_main.py"

This file has the initialization and cleanup code for the experiment. You should use as much of the code and operation sequence from this file as possible in your experiments. Also, try to keep your source files separated by function in the same way as the source files in this template are: this will make the maintenance of the code easier.

Importing Python Source Code

At the beginning of the experiment code, all of the required modules should be imported by using the import statement. In this example, we need to import all of the classes and functions from the pylink and pygame modules. In addition, gc, sys and time modules are also required so that we can handle file operations, check for timing, and perform garbage collection. Last but not least, the gcwindow_trial module should also be imported.

from pylink import *
from pygame import *
import time
import gc
import sys

import gcwindow_trial

Initializes Experiment Graphics

The first thing the user should do is to manually initialize SDL's video subsystem and opens the graphics based on the display mode set. To make the display changes faster, a low screen resolution of 800 x 600 is used.

#Initializes the graphics
display.init()
display.set_mode((800, 600), FULLSCREEN |RLEACCEL |DOUBLEBUF ,16)
pylink.openGraphics()

Opening an EDF File

Following this, an EDF file ("Test.EDF") can be opened for data recording. Note that, we use the built-in constant of the pylink module EYELINK, which is an instance of the EyeLink/EyelinkListener class. The file name can also be read from a command line by the following code:

    edfFileName = sys.argv[1];

#Opens the EDF file.
edfFileName = "TEST.EDF";
EYELINK.openDataFile(edfFileName)

EyeLink Tracker Configuration

Before recording, the EyeLink tracker must be set up. The first step is to record the display resolution, so that the EyeLink tracker and Data Viewer will work in right display pixel coordinates. We also write information on the display to the EDF file, to document the experiment and for use during analysis. The "DISPLAY_COORDS" message records the size of the display, which may be used to control data display tools.

pylink.flushGetkeyQueue();
EYELINK.setOfflineMode();

#Gets the display surface and sends a mesage to EDF file;
surf = display.get_surface()
EYELINK.sendCommand("screen_pixel_coords =  0 0 %d %d" %(surf.get_rect().w - 1, surf.get_rect().h - 1))
EYELINK.sendMessage("DISPLAY_COORDS  0 0 %d %d" %(surf.get_rect().w - 1, surf.get_rect().h - 1))

The saccade detection thresholds and the EDF file data contents are set next. Setting these at the start of the experiment prevents changes to default settings made by other experiments from affecting your experiment. The saccadic detection thresholds determine if small saccades are detected and how sensitive to noise the tracker will be. If we are connected to an EyeLink II tracker, we select a parser configuration rather than changing the saccade detector parameters:

if (EYELINK.getTrackerVersion()== 2):
    EYELINK.sendCommand("select_parser_configuration 0");
else:
    EYELINK.sendCommand("saccade_velocity_threshold = 35");
    EYELINK.sendCommand("saccade_acceleration_threshold = 9500");

EYELINK.setFileEventFilter("LEFT,RIGHT,FIXATION,SACCADE,BLINK,MESSAGE,BUTTON");
EYELINK.setFileSampleFilter("LEFT,RIGHT,GAZE,AREA,GAZERES,STATUS");
EYELINK.setLinkEventFilter("LEFT,RIGHT,FIXATION,SACCADE,BLINK,BUTTON");
EYELINK.setLinkSampleFilter("LEFT,RIGHT,GAZE,GAZERES,AREA,STATUS");
EYELINK.sendCommand("button_function 5 'accept_target_fixation'");

Calibration and drift correction are customized by setting the target size, the background and target colors, and the sounds to be used as feedback. Target size is set as a fraction of display width, so that the templates will be relatively display-mode independent. A gray background and black target is initially set for the window: this will be changed before calibration to match trial stimuli brightness. The default sounds are used for most, but the sound after drift correction is turned off.

pylink.setCalibrationColors((255, 255, 255), (0, 0, 0));  #Sets the calibration target and background color
pylink.setTargetSize(int(surf.get_rect().w/70), int(surf.get_rect().w/300));
#select best size for calibration target
pylink.setCalibrationSounds("", "", "");
pylink.setDriftCorrectSounds("", "off", "off");

Running the Experiment

Everything is now set up. We check to make sure the program has not been terminated, then call run_trials() to perform a block of trials. The implementation of this function, documented below, differs across experiment. For a multiple-block experiment, you would call this function once for every block, and call this function in a loop.

if(EYELINK.isConnected() and not EYELINK.breakPressed()):
    gcwindow_trial.run_trials(surf, tracker)

Transferring the EDF File

Once all trials are run, the EDF file is closed and transferred via the link to the subject PC's hard disk. The tracker is set to Offline mode to speed the transfer with EyeLink I. The receiveDataFile() function is called to copy the file.

if tracker != None:
    # File transfer and cleanup!
    EYELINK.setOfflineMode();
    msecDelay(500);

    #Close the file and transfer it to Display PC
    EYELINK.closeDataFile()
    EYELINK.receiveDataFile(edfFileName, edfFileName)

Remarks:
Warning: Users have reported significantly slower EDF file transfer speeds when the experiment is run using Python editors like IDLE. While it may often be justified during experiment design and debugging, you should never run your Pylink experiment via an editor or a development environment during data collection. Instead, always run your Pylink experiments from the command line or by opening it via a file system browser like Windows Explorer.

Cleaning Up

Finally, the program cleans up. It closes the connection to the eye tracker, and closes its experimental graphics.

EYELINK.close();
#Close the experiment graphics
pylink.closeGraphics()
display.quit()

Analyzing "gcwindow_trial.py"

The gcwindow_trial.py module performs the actions needed to perform block of experiment trials. The run_trials() is called to loop through a set of trial and the do_trial() function supplies the bitmap for each trial and executes the trial.

Initial Setup and Calibration

The run_trials() function begins by calling up the Camera Setup screen (Setup menu on the EyeLink I tracker), for the experimenter to perform camera setup, calibration, and validation. Scheduling this at the start of each block gives the experimenter a chance to fix any setup problems, and calibration can be skipped by simply pressing the 'Esc' key immediately. This also allows the subject an opportunity for a break, as the headband can be removed and the entire setup repeated when the subject is reseated.

NTRIALS = 4
def run_trials(surface, tracker):
    ''' This function is used to run individual trials and handles the trial return values. '''

    ''' Returns a successful trial with 0, aborting experiment with ABORT_EXPT (3); It also handles
    the case of re-running a trial. '''
    #Do the tracker setup at the beginning of the experiment.
    EYELINK.doTrackerSetup()

Trial Loop and Result Code Processing

Each block loops through a number of trials, which calls a function to execute the trial itself. The trial should return one of a set of trial return codes, which match those returned by the EyeLink trial support functions. The trial return code should be interpreted by the block-of-trials loop to determine which trial to execute next, and to report errors via messages in the EDF file. The trial loop function should return the code ABORT_EXPT if a fatal error occurred, otherwise 0 or your own return code.

The standard trial return codes are listed below, and the appropriate message to be placed in the EDF file is also given.

Return Code | Message | Caused by
TRIAL_OK | "TRIAL OK" | Trial recorded successfully
TRIAL_ERROR | "TRIAL ERROR" | Error: could not record trial
ABORT_EXPT | "EXPERIMENT ABORTED" | Experiment aborted from EyeLink Abort menu, link disconnect or ALT-F4 key
SKIP_TRIAL | "TRIAL SKIPPED" | Trial terminated from EyeLink Abort menu
REPEAT_TRIAL | "TRIAL REPEATED" | Trial terminated from EyeLink Abort menu: repeat requested

The REPEAT_TRIAL function cannot always be implemented, because of randomization requirements or the experimental design. In this case, it should be treated as SKIP_TRIAL.

This is the code that executes the trials and processes the result code. This code can be used in your experiments, simply by changing the function called to execute each trial:

    for trial in range(NTRIALS):
        if(EYELINK.isConnected() ==0 or EYELINK.breakPressed()): break;

        while 1:
            ret_value = do_trial(trial, surface, tracker)
            endRealTimeMode()

            if (ret_value == TRIAL_OK):
                EYELINK.sendMessage("TRIAL OK");
                break;
            elif (ret_value == SKIP_TRIAL):
                EYELINK.sendMessage("TRIAL ABORTED");
                break;
            elif (ret_value == ABORT_EXPT):
                EYELINK.sendMessage("EXPERIMENT ABORTED")
                return ABORT_EXPT;
            elif (ret_value == REPEAT_TRIAL):
                EYELINK.sendMessage("TRIAL REPEATED");
            else:
                EYELINK.sendMessage("TRIAL ERROR")
                break;

    return 0;

Trial Setup

The do_trial() function first sets the trial identification title by sending a "record_status_message" command to the tracker. This is displayed at the bottom right of the EyeLink tracker display during recording. This message should be less than 80 characters long (35 characters for the EyeLink I tracker), and should contain the trial and block number and trial conditions. Such information will let the experimenter know how far the experiment has progressed, and will be essential in fixing problems that the experimenter notices during recording.

The "TRIALID" message is sent to the EDF file next. This message must be placed in the EDF file before the drift correction and before recording begins, and is critical for data analysis. EyeLink analysis software treats this message in special ways. It should contain information that uniquely identifies the trial for analysis, including a number or code for each independent variable. Each item in the message should be separated by spaces.

trial_condition = ["Image-Window", "Image-Mask", "Text-Window", "Text-Mask"];

def dotrial(trial, surf, tracker):
    '''Does the simple trial'''

    message ="record_status_message 'Trial %d %s'"%(trial+1, trial_condition[trial])
    EYELINK.sendCommand(message);
    msg = "TRIALID %s"%trial_condition[trial];
    EYELINK.sendMessage(msg);

Creating Trial Bitmaps

Four trials are run to demonstrate different aspects of the gaze-contingent window manipulation. For trials 1 and 2, a clear image and a blurred image of the same picture are used. In trial 1, the foreground bitmap is a clear image and the background is a blurred one. For trial 2, the bitmaps are reversed, and the window type is set to masking. For trials 3 and 4, two bitmaps of text are created, one with characters and the other with "Xxx" words. A monospaced font (Courier) is used so that the two displays overlap. For trial 3, the normal text is in the foreground, and the "Xxx" text is outside the window. For trial 4, the bitmaps are reversed, and the window type is set to masking.

    #Creates the bitmap images for the foreground and background images;
    if(trial == 0):
        fgbm = getImageBitmap(1)
        bgbm = getImageBitmap(2)
    elif(trial == 1):
        fgbm = getImageBitmap(2)
        bgbm = getImageBitmap(1)
    elif(trial == 2):
        fgbm = getTxtBitmap(fgtext, (surf.get_rect().w, surf.get_rect().h))
        bgbm = getTxtBitmap(bgtext, (surf.get_rect().w, surf.get_rect().h))
    elif(trial == 3):
        bgbm = getTxtBitmap(fgtext, (surf.get_rect().w, surf.get_rect().h))
        fgbm = getTxtBitmap(bgtext, (surf.get_rect().w, surf.get_rect().h))
    else:
        return SKIP_TRIAL ;

    if (fgbm == None or bgbm == None):
        print "Skipping trial ", trial+1, "because images cannot be loaded"
        return SKIP_TRIAL ;

The image bitmaps are created by the getImageBitmap() function.

def getImageBitmap(pic):
    ''' This function is used to load an image into a new surface. '''

    ''' return image object if successful; otherwise None '''

    if(pic == 1):
        try:
            bmp = image.load("sacrmeto.jpg", "jpg")
            return bmp
        except:
            print "Cannot load image sacrmeto.jpg";
            return None;
    else:
        try:
            bmp = image.load("sac_blur.jpg", "jpg")
            return bmp
        except:
            print "Cannot load image sac_blur.jpg";
            return None;

The text bitmaps are created by the getTxtBitmap() function.

def getTxtBitmap(text, dim):
    ''' This function is used to create a page of text. '''

    ''' return image object if successful; otherwise None '''

    if(not font.get_init()):
        font.init()
    fnt = font.Font("cour.ttf",15)
    fnt.set_bold(1)
    sz = fnt.size(text[0])
    bmp = Surface(dim)

    bmp.fill((255,255,255,255))
    for i in range(len(text)):
        txt = fnt.render(text[i],1,(0,0,0,255), (255,255,255,255))
        bmp.blit(txt, (0,sz[1]*i))

    return bmp

Overview of Recording

The second part of the trial is the actual recording loop. It performs a drift correction, displays the graphics, records the data, and exits when the appropriate conditions are met. These include a response button press, the maximum recording time expired, the 'Esc' key pressed, or the program being terminated.

The sequence of operations for implementing the trial is:

  • Perform a drift correction, which also serves as the pre-trial fixation target.
  • Start recording, allowing 100 milliseconds of data to accumulate before the trial display starts
  • Draw the subject display, recording the time that the display appeared by placing a message in the EDF file
  • Loop until one of these events occurs Recording halts, due to the tracker Abort menu or an error The maximum trial duration expires 'Esc' is pressed, or the program is interrupted. A button on the EyeLink button box is pressed
  • Add special code to handle gaze-contingent display updates
  • Blank the display, stop recording after an additional 100 milliseconds of data has been collected
  • Report the trial result, and return an appropriate error code

Each of these sections of the code is described below.

Drift Correction

At the start of each trial, a fixation point should be displayed, so that the subject's gaze is in a known position. The EyeLink system is able to use this fixation point to correct for small drifts in the calculation of gaze position that can build up over time. Even when using the EyeLink II tracker's corneal reflection mode, a fixation target should be presented, and a drift correction allows the experimenter the opportunity to recalibrate if needed.

The doDriftCorrect() method of the EyeLinkListener class implements this operation. The display coordinates where the target is to be displayed must be supplied. Usually this is at the center of the display, but could be anywhere that gaze should be located at the trial start. For example, it could be located over the first word in a page of text.

    #The following does drift correction at the begin of each trial
    while 1:
        # Checks whether we are still connected to the tracker
        if not EYELINK.isConnected():
            return ABORT_EXPT;

        # Does drift correction and handles the re-do camera setup situations
        try:
            error = EYELINK.doDriftCorrect(surf.get_rect().w/2,surf.get_rect().h/2,1,1)
            if error != 27:
                break;
            else:
                EYELINK.doTrackerSetup();
        except:
            EYELINK.doTrackerSetup()

In the template, we told doDriftCorrect() to draw the drift correction display for us, by setting the third argument to 1. It cleared the screen to the calibration background color, drew the target, and cleared the screen again when finished.

Starting Recording

After drift correction, recording is initiated. Recording should begin about 100 milliseconds before the trial graphics are displayed to the subject, to ensure that no data is lost:
    error = EYELINK.startRecording(1,1,1,1)
    if error:   return error;
    #gc.disable();
    #begin the realtime mode
    #pylink.beginRealTimeMode(100)

The startRecording() method of the EyeLinkListener class starts the EyeLink tracker recording, and does not return until recording has actually begun. If link data has been requested, it will wait for data to become available. If an error occurs or data is not available within 2 seconds, it returns an error code. This code should be returned as the trial result if recording fails.

Four arguments to startRecording() set what data will be recorded to the EDF file and sent via the link. If an argument is 0, recording of the corresponding data is disabled. At least one of the data selectors must be enabled. This is the prototype and arguments to the function:

startRecording(File_samples, File_events, Link_samples, Link_events)
<File_samples>: If 1, writes samples to EDF file. If 0, disables sample recording.
<File_events>: If 1, writes events to EDF file. If 0, disables event recording.
<Link_samples>: If 1, sends samples through link. If 0, disables link sample access.
<Link_events>: If 1, sends events through link. If 0, disables link event access.

The type of data recorded to the EDF file affects the file size and what processing can be done with the file later. If only events are recorded, the file will be fairly small (less than 300 kilobytes for a 30-minute experiment) and can be used for analysis of cognitive tasks such as reading. Adding samples to the file increases its size (about 4 megabytes for a 30-minute experiment) but allows the file to reprocessed to remove artifacts if required. The data stored in the EDF file also sets the data types available for post-trial playback.

We also introduce a 100 millisecond delay after recording begins (using pylink.beginRealTimeMode()), to ensure that no data is missed before the important part of the trial starts. The EyeLink tracker requires 10 to 30 milliseconds after the recording command to begin writing data. This extra data also allows the detection of blinks or saccades just before the trial start, allowing bad trials to be discarded in saccadic RT analysis. A "SYNCTIME" message later in the trial marks the actual zero-time in the trial's data record for analysis.

Confirming Data Availability

After recording starts, a block of sample and/or event data will be opened by sending a special event over the link. This event contains information on what data will be available sent in samples and events during recording, including which eyes are being tracked and (for the EyeLink II tracker only) sample rates, filtering levels, and whether corneal reflections are being used.

The data in this event is only available once it has been read from the link data queue, and the waitForBlockStart() method of the EyeLinkListener class is used to scan the queue data for the block start event. The arguments to this function specify how long to wait for the block start, and whether samples, events, or both types of data are expected. If no data is found, the trial should end with an error.

    if not EYELINK.waitForBlockStart(100, 1, 0):
        end_trial();
        print "ERROR: No link samples received!";
            return TRIAL_ERROR;
Once the block start has been processed, data on the block is available.

Checking Recording Eye

Because the EyeLink system is a binocular eye tracker, we do not know which eye's data will be present, as this was selected during camera setup by the experimenter. After the block start, eyeAvailable() method of the EyeLinkListener class returns one of the constants LEFT_EYE, RIGHT_EYE, or BINOCULAR to indicate which eye(s) data is available from the link. LEFT_EYE (0) and RIGHT_EYE (1) can be used to index eye data in the sample; if the value is BINOCULAR (2) we use the LEFT_EYE. A message should be placed in the EDF file to record this, so that we know which eye's data to use during analysis.

    eye_used = EYELINK.eyeAvailable(); #determine which eye(s) are available
    if eye_used == RIGHT_EYE:
        EYELINK.sendMessage("EYE_USED 1 RIGHT");
    elif eye_used == LEFT_EYE or eye_used == BINOCULAR:
        EYELINK.sendMessage("EYE_USED 0 LEFT");
        eye_used = LEFT_EYE;
    else:
        print "Error in getting the eye information!";
        return TRIAL_ERROR;

Drawing the Subject Display

For the display drawing, we first blit the image onto the background surface and then flip it to screen to make it visible. Immediately following display flipping, the time of the retrace is read. This allows us to determine the time of stimulus onset (actually the stimulus is painted on the monitor phosphors at a delay dependent on its vertical position on the display, but this can be corrected for during analysis). If additional drawing is made, the time is read again, and used to compute the delay from the retrace. This delay is included in the messages "DISPLAY ON" and "SYNCTIME", which are then placed in the EDF file to mark the time the stimulus appeared.

    surf.fill((255,255,255,255))
    surf.blit(bgbm,((surf.get_rect().w-bgbm.get_rect().w)/2,(surf.get_rect().h-bgbm.get_rect().h)/2))
    display.flip()
    startTime = currentTime()
    surf.fill((255,255,255,255))
    surf.blit(bgbm,((surf.get_rect().w-bgbm.get_rect().w)/2,(surf.get_rect().h-bgbm.get_rect().h)/2))
        # write to the back buffer

    EYELINK.sendMessage("SYNCTIME %d"%(currentTime()-startTime));
Please note that if you use a different graphics library other than pygame, the drawing may be done differently.

Recording Loop

With recording started and the stimulus visible, we wait for an event to occur that ends the trial. In the template, we look for the maximum trial duration to be exceeded, the 'Esc' key on the local keyboard to be pressed, a button press from the EyeLink button box, or the program being terminated. For the present example, the recording loop is implemented in the drawgc() function.

Any tracker buttons pressed before the trial, and any pending events from the local keyboard are discarded:

    EYELINK.flushKeybuttons(0)
    buttons =(0, 0);

The main part of the trial is a loop that tests for error conditions and response events. Any such event will stop recording and exit the loop, or return an error code. The process of halting recording and blanking the display is implemented as a small local function, because it is done from several places in the loop:

def end_trial():
    '''Ends recording: adds 100 msec of data to catch final events'''

    pylink.endRealTimeMode();
    pumpDelay(100);
    EYELINK.stopRecording();
    while EYELINK.getkey() :
        pass;

The trial recording loop tests for recording errors, trial timeout, the local 'Esc' key, program termination, or tracker button presses. The first test in the loop detects recording errors or aborts, and handles EyeLink Abort menu selections. It also stops recording, and returns the correct result code for the trial:

        error = EYELINK.isRecording()  # First check if recording is aborted
        if error!=0:
            end_trial();
            return error

Next, the trial duration is tested. This could be used to implement fixed-duration trials, or to limit the time a subject is allowed to respond. When the trial times out, a "TIMEOUT" message is placed in the EDF file and the trial is stopped. The local end_trial() function will properly clear the display, and stop recording after an additional 100 milliseconds.

        #Writres out a time out message if no response is made
        if (currentTime() -startTime) > DURATION:
            EYELINK.sendMessage("TIMEOUT");
            end_trial();
            buttons =(0, 0);
            break;

Next, the local keyboard is checked to see if we should abort the trial. This is most useful for testing and debugging an experiment. There is some time penalty for using getkey() in the recording loop on the Subject PC, as this function allows Windows multitasking and background disk activity to occur. It is preferable to use escapePressed() and breakPressed() to test for termination without processing system messages, as these do not allow interruption. However, these functions may respond slowly or not at all under Windows XP if a lot of drawing is being done within the loop, or in realtime mode.

    if(EYELINK.breakPressed()): # Checks for program termination or ALT-F4 or CTRL-C keys
        end_trial();
        return ABORT_EXPT
    elif(EYELINK.escapePressed()): # Checks for local ESC key to abort trial (useful in debugging)
        end_trial();
        return SKIP_TRIAL

Finally, we check for a subject response to end the trial. The tracker button box is the preferred way to collect a response, as it accurately records the time of the response. Using the getLastButtonPress() method is the simplest way to check for new button presses since the last call to this function. It returns (0, 0) if no button has been pressed since recording started, or a two-item tuple of the button number and tracker time for button repsonse. This function reports only the latest button press, and so could miss multiple button presses if not called often. This is not usually a problem, as all button presses will be recorded in the EDF file.

        buttons = EYELINK.getLastButtonPress() # Checks for eye-tracker buttons pressed
        if(buttons[0] != 0):
            EYELINK.sendMessage("ENDBUTTON %d"%(buttons[0]));
            end_trial();
            break;

The message "ENDBUTTON" is placed in the EDF data file to record the button press. The timestamp of this message is not as accurate as the button press event that is also recorded in the EDF file, but serves to record the reason for ending the trial. The "ENDBUTTON" message can also be used if the local keyboard as well as buttons can be used to respond, with keys translated into a button number.

Reading Samples

In the current example, the display is updated constantly based on the observer's current gaze position. To that purpose, code is added to the recording loop to read and process samples. This calls getNewestSample() method to read the latest sample. If new data is available, the gaze position for the monitored eye is extracted from the sample, using the getGaze() method of the SampleData class.

        dt = EYELINK.getNewestSample() # check for new sample update
        if(dt != None):
            # Gets the gaze position of the latest sample,
            if eye_used == RIGHT_EYE and dt.isRightSample():
                gaze_position = dt.getRightEye().getGaze()
            elif eye_used == LEFT_EYE and dt.isLeftSample():
                gaze_position = dt.getLeftEye().getGaze()

Drawing the Window

The window code for gaze-contingent display update operates by copying areas from a foreground bitmap to draw within the window, and from a background bitmap to draw outside the window. Once the window and background are initially drawn, the code needs only to redraw those parts of the window or background that changed due to window motion. Even during saccades, only a small fraction of the window area will need to be updated.

The code here first checks whether redrawing the display is necessarily or not for a given sample.

    # Determines the top-left corner of the update region and determines
    # whether an update is necessarily or not
    region_topleft = (gaze_position[0]-cursorsize[0]/2, gaze_position[1]-cursorsize[1]/2)
    if(oldv != None and oldv == region_topleft):
        continue
    oldv = region_topleft

Otherwise, we will update the content of the cursor and shows the cursor content.

    if(backcursor != None): #copy the current backcursor to the surface and get a new backup
        if(prevrct != None):
            surf.blit(pbackcursor, (prevrct.x, prevrct.y))

        pbackcursor.blit(backcursor,(0,0))
        pbackcursor.blit(backcursor,(0,0))
        prevrct = srcrct.move(0,0) #make a copy
        srcrct.x = region_topleft[0]
        srcrct.y = region_topleft[1]
        backcursor.blit(surf, (0,0),srcrct)

    else: # create a new backcursor and copy the new back cursor
        backcursor = Surface(cursorsize)
        pbackcursor = Surface(cursorsize)
        backcursor.fill((0,255,0,255))
        srcrct = cursor.get_rect().move(0,0)
        srcrct.x = region_topleft[0]
        srcrct.y = region_topleft[1]
        backcursor.blit(surf, (0,0), srcrct)
        backcursor.blit(surf, (0,0), srcrct)

    updateCursor(cursor,region_topleft, fgbm)  #Updates the content of the cursor
    surf.blit(cursor, region_topleft)       #Draws and shows the cursor content;
    display.flip()
Again, the code for display updating may be different if you are using a different graphics library.

Cleaning Up and Reporting Trial Results

After exiting the recording loop, it is good programming practice to prevent anything that happened during the trial from affecting later code, in this case by making sure we are out of realtime mode and by discarding any accumulated key presses. Remember, it is better to have some extra code than to waste time debugging unexpected problems.

Finally, the trial is completed by reporting the trial result and returning the result code. The standard message "TRIAL_RESULT" records the button pressed, or 0 if the trial timed out. This message is used during analysis to determine why the recording stopped. Any post-recording subject responses (i.e. questionnaires, etc.) should be performed before returning from the trial, to place them before the "TRIAL OK" message. Finally, the call to the getRecordingStatus() method of the EyeLinkListener class makes sure that no Abort menu operations remain to be performed, and generates the trial return code.

       EYELINK.sendMessage("TRIAL_RESULT %d"%(buttons[0]));
       return EYELINK.getRecordingStatus()

If the trial is run under the realtime mode, it is the place to turn off the mode. Also, garbage collection should be re-enabled if it has been disabled previously.

    ret_value = drawgc(surf, tracker, fgbm, startTime);
    pylink.endRealTimeMode();
    gc.enable();
    return ret_value;

Extending the Current Example

For many experiments, this code can be used with few modifications, except for changing the stimulus drawn. For experiments that show a single static display for each recording trial, the user simply needs to remove the code of 4.3.12 (reading samples) and 4.3.13 (performing gaze-contingent display updates).
Copyright ©2006, SR Research Ltd.


PyLink Class List

Here are the classes, structs, unions and interfaces with brief descriptions:
ButtonEvent | A ButtonEvent class, derived from the IOEvent class, is created to handle specifics of button events
DisplayInfo | Used to contain information on display configurations, including width, height, color bits, and refresh rate
EndBlinkEvent | Class to represent End Blink event
EndFixationEvent | Class to represent End Fixation event
EndNonBlinkEvent | This interface is never used as is
EndSaccadeEvent | Class to represent End Saccade event
EyeEvent | The EyeLink tracker simplifies data analysis by detecting important changes in the sample data and placing corresponding events into the data stream
EyeLink | Extension of the EyeLinkListener class with additional utility functions
EyeLinkAddress | Used to hold addresses to EyeLink nodes
EyeLinkCBind |
EyeLinkCustomDisplay | EyeLinkCustomDisplay is an abstract class, that one would implement to present calibration/validation/drift correction targets and camera images
EyeLinkListener | EyeLinkListener class implements most of the core EyeLink interface
EyelinkMessage | EyelinkMessage class, derived from EyeLinkAddress class, is used to send and receive messages between EyeLink nodes
FixUpdateEvent | Class to represent the Fix Update event
ILinkData | Class to represent tracker status information such as time stamps, flags, tracker addresses and so on
IOEvent | IOEvent class is used to handle BUTTONEVENT and INPUTEVENT types, which report changes in button status or in the input port data
KeyInput | This represents a key input
MessageEvent | A message event is created by your experiment program and placed in the EDF file
Sample | The EyeLink toolkit library defines special data classes that allow the same programming calls to be used on different platforms such as MS-DOS, Windows, and Macintosh
SampleData | Sample data for left and right eye
StartBlinkEvent | Class to represent Start Blink event
StartFixationEvent | Class to represent Start Fixation event
StartNonBlinkEvent | This interface is never used as is
StartSaccadeEvent | Class to represent Start Saccade event


pylink.ButtonEvent

ButtonEvent Class Reference

A ButtonEvent class, derived from the IOEvent class, is created to handle specifics of button events. More...

Inheritance diagram for ButtonEvent:

IOEvent List of all members.

Public Member Functions

def | __init__
def | getButtons
A list of buttons pressed or released.
def | getStates
The button state (1 for pressed or 0 for released).
def | __str__

Detailed Description

A ButtonEvent class, derived from the IOEvent class, is created to handle specifics of button events.

For this class, in addition to the generic IOEvent class methods, two additional methods can be used for instances of the ButtonEvent class.

Returned by getFloatData() whenever there is a Button Event.

Member Function Documentation

def __init__ | ( | self,
 |  | time,
 |  | data
 | )

def getButtons ( self )

A list of buttons pressed or released.

Returns:
List of integers.

def getStates ( self )

The button state (1 for pressed or 0 for released).

Returns:
List of integers.

def __str__ ( self )

Reimplemented from IOEvent.


ButtonEvent Member List

This is the complete list of members for ButtonEvent, including all inherited members.

__init__ | ButtonEvent
pylink::IOEvent::__init__ | IOEvent
__str__ | ButtonEvent
getButtons | ButtonEvent
getData | IOEvent
getStates | ButtonEvent
getTime | IOEvent
getType | IOEvent


pylink.DisplayInfo

DisplayInfo Class Reference

The DisplayInfo class is used to contain information on display configurations, including width, height, color bits, and refresh rate. More...

List of all members.

Public Member Functions

def __init__

Public Attributes

width
Display width in screen pixels.
height
Display height in screen pixels.
bits
Color resolution, in bits per pixel, of the display device (for example: 4 bits for 16 colors, 8 bits for 256 colors, or 16 bits for 65,536 colors).
refresh
Refresh rate.

Detailed Description

The DisplayInfo class is used to contain information on display configurations, including width, height, color bits, and refresh rate.

The current display configuration can be retrieved by the getDisplayInformation() function of the pylink module.

For example:

    from pylink import *

    // Code to open the display
    currentDisplay = getDisplayInformation();
       print("Current display settings: ", currentDisplay.width, currentDisplay.height, \
    print "Current display settings: ", currentDisplay.width, currentDisplay.height, \
                    currentDisplay.bits, currentDisplay.refresh

Member Function Documentation

def __init__ | ( | self,
 |  | width,
 |  | height,
 |  | bits,
 |  | refresh
 | )

Member Data Documentation

width

Display width in screen pixels.

height

Display height in screen pixels.

bits

Color resolution, in bits per pixel, of the display device (for example: 4 bits for 16 colors, 8 bits for 256 colors, or 16 bits for 65,536 colors).

refresh

Refresh rate.


DisplayInfo Member List

This is the complete list of members for DisplayInfo, including all inherited members.

__init__ | DisplayInfo
bits | DisplayInfo
height | DisplayInfo
refresh | DisplayInfo
width | DisplayInfo


pylink.EndBlinkEvent

EndBlinkEvent Class Reference

Class to represent End Blink event. More...

Inheritance diagram for EndBlinkEvent:

EyeEvent List of all members.

Public Member Functions

def | __init__
def | getEndTime
Timestamp of the last sample of the blink.

Detailed Description

Class to represent End Blink event.

This also contains the Start Blink data. This also inherits all properties from EyeEvent.

Member Function Documentation

def __init__ | ( | self,
 |  | time,
 |  | type,
 |  | eye,
 |  | read,
 |  | sttime,
 |  | entime
 | )

def getEndTime ( self )

Timestamp of the last sample of the blink.

Returns:
Long integer.


EndBlinkEvent Member List

This is the complete list of members for EndBlinkEvent, including all inherited members.

__init__ | EndBlinkEvent
pylink::EyeEvent::__init__ | EyeEvent
getEndTime | EndBlinkEvent
getEye | EyeEvent
getRead | EyeEvent
getStartTime | EyeEvent
getStatus | EyeEvent
getTime | EyeEvent
getType | EyeEvent


pylink.EndFixationEvent

EndFixationEvent Class Reference

Class to represent End Fixation event. More...

Inheritance diagram for EndFixationEvent:

StartFixationEvent EndNonBlinkEvent StartNonBlinkEvent EyeEvent List of all members.

Public Member Functions

def | __init__
def | getAverageGaze
The average gaze position during the fixation period (in pixel coordinates set by the screen_pixel_coords command).
def | getAverageHREF
Average HEADREF position during the fixation period.
def | getAveragePupilSize
Average pupil size (in arbitrary units, area or diameter as selected) during a fixation.
def | getEndPupilSize
Pupil size (in arbitrary units, area or diameter as selected) at the end of a fixation interval.

Detailed Description

Class to represent End Fixation event.

This also contains the Start Fixation data. This also inherits all properties from StartFixationEvent and EndNonBlinkEvent.

Member Function Documentation

def __init__ | ( | self,
 |  | time,
 |  | type,
 |  | eye,
 |  | read,
 |  | sttime,
 |  | gstx,
 |  | gsty,
 |  | hstx,
 |  | hsty,
 |  | sta,
 |  | svel,
 |  | supd_x,
 |  | supd_y,
 |  | entime,
 |  | genx,
 |  | geny,
 |  | gavx,
 |  | gavy,
 |  | henx,
 |  | heny,
 |  | havx,
 |  | havy,
 |  | ena,
 |  | ava,
 |  | evel,
 |  | avel,
 |  | pvel,
 |  | eupd_x,
 |  | eupd_y
 | )

def getAverageGaze ( self )

The average gaze position during the fixation period (in pixel coordinates set by the screen_pixel_coords command).

Returns:
Two-item tuple in the format of (float, float).

def getAverageHREF ( self )

Average HEADREF position during the fixation period.

Returns:
Two-item tuple in the format of (float, float).

def getAveragePupilSize ( self )

Average pupil size (in arbitrary units, area or diameter as selected) during a fixation.

Returns:
Float.

def getEndPupilSize ( self )

Pupil size (in arbitrary units, area or diameter as selected) at the end of a fixation interval.

Returns:
Float.


EndFixationEvent Member List

This is the complete list of members for EndFixationEvent, including all inherited members.

__init__ | EndFixationEvent
pylink::StartFixationEvent::__init__ | StartFixationEvent
pylink::StartNonBlinkEvent::__init__ | StartNonBlinkEvent
pylink::EyeEvent::__init__ | EyeEvent
pylink::EndNonBlinkEvent::__init__ | EndNonBlinkEvent
getAverageGaze | EndFixationEvent
getAverageHREF | EndFixationEvent
getAveragePupilSize | EndFixationEvent
getAverageVelocity | EndNonBlinkEvent
getEndGaze | EndNonBlinkEvent
getEndHREF | EndNonBlinkEvent
getEndPPD | EndNonBlinkEvent
getEndPupilSize | EndFixationEvent
getEndTime | EndNonBlinkEvent
getEndVelocity | EndNonBlinkEvent
getEye | EyeEvent
getPeakVelocity | EndNonBlinkEvent
getRead | EyeEvent
getStartGaze | StartNonBlinkEvent
getStartHREF | StartNonBlinkEvent
getStartPPD | StartNonBlinkEvent
getStartPupilSize | StartFixationEvent
getStartTime | EyeEvent
getStartVelocity | StartNonBlinkEvent
getStatus | EyeEvent
getTime | EyeEvent
getType | EyeEvent


pylink.EndNonBlinkEvent

EndNonBlinkEvent Class Reference

This interface is never used as is. More...

Inheritance diagram for EndNonBlinkEvent:

EndFixationEvent EndSaccadeEvent FixUpdateEvent List of all members.

Public Member Functions

def | __init__
def | getEndTime
Timestamp of the last sample of the event.
def | getEndGaze
Gaze position at the end of the event (in pixel coordinates set by the screen_pixel_coords command).
def | getEndHREF
HEADREF position at the end of the event.
def | getEndVelocity
Gaze velocity at the end of the event (in visual degrees per second).
def | getAverageVelocity
Average gaze velocity during event (in visual degrees per second).
def | getPeakVelocity
Peak gaze velocity during event (in visual degrees per second).
def | getEndPPD
Angular resolution at the end of the event (in screen pixels per visual degree).

Detailed Description

This interface is never used as is.

EndFixationEvent, EndSaccadeEvent and FixUpdateEvent types inherit this.

Please note that the getStartTime() and getEndTime() methods of the event class are the timestamps of the first and last samples in the event. To compute duration, subtract these two values and add 4 msec (even in 500 Hz tracking modes, the internal parser of EyeLink II quantizes event times to 4 milliseconds).

Peak velocity returned by getPeakVelocity() for fixations is usually corrupted by terminal segments of the preceding and following saccades.

The getStartPPD() and getEndPPD() methods contain the angular resolution at the start and end of the saccade or fixation. The average of the start and end angular resolution can be used to compute the size of saccades in degrees. This Python code would compute the true magnitude of a saccade from an ENDSACC event in the following way:

    newEvent = EYELINK.getFloatData()

    if isinstance(newEvent, EndFixationEvent):
        Start_Gaze = newEvent.getStartGaze()
        Start_PPD = newEvent.getStartPPD()
        End_Gaze = newEvent.getEndGaze()
        End_PPD = newEvent. getEndPPD()

    dx = (End_Gaze[0] - Start_Gaze[0]) / ((End_PPD[0] + Start_PPD[0])/2.0);
    dy = (End_Gaze[1] - Start_Gaze[1]) / ((End_PPD[1] + Start_PPD[1])/2.0);
    dist = math.sqrt(dx*dx + dy*dy);

Please note that the average velocity for saccades may be larger than the saccade magnitude divided by its duration because of overshoots and returns.

Member Function Documentation

def __init__ | ( | self,
 |  | entime,
 |  | genx,
 |  | geny,
 |  | henx,
 |  | heny,
 |  | evel,
 |  | avel,
 |  | pvel,
 |  | eupd_x,
 |  | eupd_y
 | )

def getEndTime ( self )

Timestamp of the last sample of the event.

Returns:
Long integer.

def getEndGaze ( self )

Gaze position at the end of the event (in pixel coordinates set by the screen_pixel_coords command).

The first and second items of the returned tuple store the x- and y- gaze position respectively.

Returns:
Two-item tuple in the format of (float, float).

def getEndHREF ( self )

HEADREF position at the end of the event.

The first and second items of the returned tuple store the x- and y- coordinate HREF data respectively.

Returns:
Two-item tuple in the format of (float, float).

def getEndVelocity ( self )

Gaze velocity at the end of the event (in visual degrees per second).

Returns:
Float.

def getAverageVelocity ( self )

Average gaze velocity during event (in visual degrees per second).

Returns:
Float.

def getPeakVelocity ( self )

Peak gaze velocity during event (in visual degrees per second).

Returns:
Float.

def getEndPPD ( self )

Angular resolution at the end of the event (in screen pixels per visual degree).

Returns:
Two-item tuple in the format of (float, float).


EndNonBlinkEvent Member List

This is the complete list of members for EndNonBlinkEvent, including all inherited members.

__init__ | EndNonBlinkEvent
getAverageVelocity | EndNonBlinkEvent
getEndGaze | EndNonBlinkEvent
getEndHREF | EndNonBlinkEvent
getEndPPD | EndNonBlinkEvent
getEndTime | EndNonBlinkEvent
getEndVelocity | EndNonBlinkEvent
getPeakVelocity | EndNonBlinkEvent


pylink.EndSaccadeEvent

EndSaccadeEvent Class Reference

Class to represent End Saccade event. More...

Inheritance diagram for EndSaccadeEvent:

StartSaccadeEvent EndNonBlinkEvent StartNonBlinkEvent EyeEvent List of all members.

Public Member Functions

def | __init__
def | getAmplitude
Returns the amplitude between the start and end of the event.
def | getAngle
Returns the angle between the start and end of the event.

Detailed Description

Class to represent End Saccade event.

This also contains the Start Saccade data. This also inherits all properties from StartSaccadeEvent and EndNonBlinkEvent.

Member Function Documentation

def __init__ | ( | self,
 |  | time,
 |  | type,
 |  | eye,
 |  | read,
 |  | sttime,
 |  | gstx,
 |  | gsty,
 |  | hstx,
 |  | hsty,
 |  | svel,
 |  | supd_x,
 |  | supd_y,
 |  | entime,
 |  | genx,
 |  | geny,
 |  | henx,
 |  | heny,
 |  | evel,
 |  | avel,
 |  | pvel,
 |  | eupd_x,
 |  | eupd_y
 | )

def getAmplitude ( self )

Returns the amplitude between the start and end of the event.

Returns:
Amplitude between the start and end of the event.

def getAngle ( self )

Returns the angle between the start and end of the event.

Returns:
Angle between the start and end of the event.


EndSaccadeEvent Member List

This is the complete list of members for EndSaccadeEvent, including all inherited members.

__init__ | EndSaccadeEvent
pylink::StartSaccadeEvent::__init__ | StartSaccadeEvent
pylink::EyeEvent::__init__ | EyeEvent
pylink::EndNonBlinkEvent::__init__ | EndNonBlinkEvent
getAmplitude | EndSaccadeEvent
getAngle | EndSaccadeEvent
getAverageVelocity | EndNonBlinkEvent
getEndGaze | EndNonBlinkEvent
getEndHREF | EndNonBlinkEvent
getEndPPD | EndNonBlinkEvent
getEndTime | EndNonBlinkEvent
getEndVelocity | EndNonBlinkEvent
getEye | EyeEvent
getPeakVelocity | EndNonBlinkEvent
getRead | EyeEvent
getStartGaze | StartNonBlinkEvent
getStartHREF | StartNonBlinkEvent
getStartPPD | StartNonBlinkEvent
getStartTime | EyeEvent
getStartVelocity | StartNonBlinkEvent
getStatus | EyeEvent
getTime | EyeEvent
getType | EyeEvent


pylink.EyeEvent

EyeEvent Class Reference

The EyeLink tracker simplifies data analysis by detecting important changes in the sample data and placing corresponding events into the data stream. More...

Inheritance diagram for EyeEvent:

EndBlinkEvent StartBlinkEvent StartNonBlinkEvent FixUpdateEvent StartFixationEvent StartSaccadeEvent EndFixationEvent EndSaccadeEvent List of all members.

Public Member Functions

def | __init__
def | getTime
Timestamp of the sample causing event (in milliseconds since EyeLink tracker was activated).
def | getType
The event code.
def | getEye
Which eye produced the event: 0 (LEFT_EYE) or 1 (RIGHT_EYE).
def | getRead
Bits indicating which data fields contain valid data (see eye_data.h file for details of the bits information).
def | getStartTime
Timestamp of the first sample of the event.
def | getStatus
Errors and warnings of the event.

Detailed Description

The EyeLink tracker simplifies data analysis by detecting important changes in the sample data and placing corresponding events into the data stream.

These include eye-data events (blinks, saccades, and fixations), button events, input-port events, and messages. Several classes have been created to holds eye event data (start/end of fixation, start/end of saccade, start/end of blink, fixation update) information. Start events contain only the start time, and optionally the start eye or gaze position. End events contain the start and end time, plus summary data on saccades and fixations.

It is important to remember that data sent over the link does not arrive in strict time sequence. Typically, eye events (such as STARTSACC and ENDFIX) arrive up to 32 milliseconds after the corresponding samples, and messages and buttons may arrive before a sample with the same time code. This differs from the order seen in an ASC file, where the events and samples have been sorted into a consistent order by their timestamps.

The LOST_DATA_EVENT is a new event, introduced for EyeLink tracker version 2.1 and later, and produced within the DLL to mark the location of lost data. It is possible that data may be lost, either during recording with real-time data enabled, or during playback. This might happen because of a lost link packet or because data was not read fast enough (data is stored in a large queue that can hold 2 to 10 seconds of data, and once it is full the oldest data is discarded to make room for new data). This event has no data or time associated with it.

Event data returned by the getFloatData() method the EyeLink class.

For example,

    newEvent = EYELINK.getFloatData()

Right now, the developer kit implements the following eye events:

Constant Name | Value | Description
STARTBLINK | 3 | Pupil disappeared (time only)
ENDBLINK | 4 | Pupil reappeared (duration data)
STARTSACC | 5 | Start of saccade (with time only)
ENDSACC | 6 | End of saccade (with summary data)
STARTFIX | 7 | Start of fixation (with time only)
ENDFIX | 8 | End of fixation (with summary data)
FIXUPDATE | 9 | Update within fixation (summary data for interval)
MESSAGEEVENT | 24 | User-definable text (IMESSAGE structure)
BUTTONEVENT | 25 | Button state change (IOEVENT structure)
INPUTEVENT | 28 | Change of input port (IOEVENT structure)
SAMPLE_TYPE | 200 | Event flags gap in data stream

Please note that due to the tracker configuration, some of the property information returned may be a missing value MISSING_DATA (or 0, depending on the field). So make sure you check for the validity of the data before trying to use them. To do the tracker configuration, the user can use the setLinkEventFilter() and setLinkEventData() methods of the EyeLink class to send commands at the start of the experiment or modify the DATA.INI file on the tracker PC.

When both eyes are being tracked, left and right eye events are produced. The eye from which data was produced can be retrieved by the getEye() method.

Member Function Documentation

def __init__ | ( | self,
 |  | time,
 |  | type,
 |  | eye,
 |  | read,
 |  | sttime
 | )

Reimplemented in StartBlinkEvent.

def getTime ( self )

Timestamp of the sample causing event (in milliseconds since EyeLink tracker was activated).

Returns:
Long integer.

def getType ( self )

The event code.

Returns:
Integer.

def getEye ( self )

Which eye produced the event: 0 (LEFT_EYE) or 1 (RIGHT_EYE).

Returns:
Integer.

def getRead ( self )

Bits indicating which data fields contain valid data (see eye_data.h file for details of the bits information).

Returns:
Integer.

def getStartTime ( self )

Timestamp of the first sample of the event.

Returns:
Long integer.

def getStatus ( self )

Errors and warnings of the event.


EyeEvent Member List

This is the complete list of members for EyeEvent, including all inherited members.

__init__ | EyeEvent
getEye | EyeEvent
getRead | EyeEvent
getStartTime | EyeEvent
getStatus | EyeEvent
getTime | EyeEvent
getType | EyeEvent


pylink.EyeLink

EyeLink Class Reference

The EyeLink class is an extension of the EyeLinkListener class with additional utility functions. More...

Inheritance diagram for EyeLink:

EyeLinkListener EyeLinkCBind List of all members.

Public Member Functions

def | __init__
Constructor.
def | progressUpdate
prints out the file transfer progress to the console.
def | progressSendDataUpdate
prints out the sending file progress to the console.
def | setSampleSizeForVelAndAcceleration
Sets the sample model to be used for velocity and acceleration calculation.
def | getSampleSizeForVelAndAcceleration
Returns the sample model used for velocity and acceleration calculation.
def | setVelocityAccelerationModel
Sets the sample model to be used for velocity and acceleration calculation.
def | getVelocityAccelerationModel
Returns the sample model used for velocity and acceleration calculation in text form.
def | getTrackerAddress
Returns the tracker address.
def | getDummyMode
Returns wheter in dummy mode or not.
def | doTrackerSetup
Switches the EyeLink tracker to the Setup menu, from which camera setup, calibration, validation, drift correction, and configuration may be performed.
def | setAcceptTargetFixationButton
This programs a specific button for use in drift correction.
def | setCalibrationType
This command sets the calibration type, and recomputed the calibration targets after a display resolution change.
def | setXGazeConstraint
Locks the x part of gaze position data.
def | setYGazeConstraint
Locks the y part of gaze position data.
def | enableAutoCalibration
Enables the auto calibration mechanism.
def | disableAutoCalibration
Disables the auto calibration mechanism.
def | setAutoCalibrationPacing
Sets automatic calibration pacing.
def | readIOPort
Sends a command to the tracker to read the specified io port.
def | writeIOPort
Sends a command to the tracker to write the specified io port.
def | setHeuristicLinkAndFileFilter
EyeLink II only: Can be used to set level of filtering on the link and analog output, and on file data.
def | setHeuristicFilterOn
EyeLink 1 Only: Can be used to enable filtering, increases system delay by 4 msec if the filter was originally off.
def | setHeuristicFilterOff
EyeLink 1 Only: Can be used to disable filtering, reduces system delay by 4 msec.
def | setPupilSizeDiameter
Can be used to determine pupil size information to be recorded.
def | setSimulationMode
Can be used to turn off head tracking if not used.
def | setScreenSimulationDistance
Used to compute correct visual angles and velocities when head tracking not used.
def | markPlayBackStart
Marks the location in the data file from which playback will begin at the next call to EYEYLINK.startPlayBack().
def | setNoRecordEvents
Selects what types of events can be sent over the link while not recording (e.g between trials).
def | setFileSampleFilter
Sets data in samples written to EDF file.
def | setFileEventData
Sets data in events written to EDF file.
def | setFileEventFilter
Sets which types of events will be written to EDF file.
def | setLinkSampleFilter
Sets data in samples sent through link.
def | setLinkEventData
Sets data in events sent through link.
def | setLinkEventFilter
Sets which types of events will be sent through link.
def | setSaccadeVelocityThreshold
Sets velocity threshold of saccade detector: usually 30 for cognitive research, 22 for pursuit and neurological work.
def | setAccelerationThreshold
Sets acceleration threshold of saccade detector: usually 9500 for cognitive research, 5000 for pursuit and neurological work.
def | setMotionThreshold
Sets a spatial threshold to shorten saccades.
def | setPursuitFixup
Sets the maximum pursuit velocity accommodation by the saccade detector.
def | setUpdateInterval
Normally set to 0 to disable fixation update events.
def | setFixationUpdateAccumulate
Normally set to 0 to disable fixation update events.
def | setRecordingParseType
Sets how velocity information for saccade detection is computed.
def | drawText
Draws text, coordinates are gaze-position display coordinates.
def | clearScreen
Clear tracker screen for drawing background graphics or messages.
def | drawLine
Draws line, coordinates are gaze-position display coordinates.
def | drawBox
Draws an empty box, coordinates are gaze-position display coordinates.
def | drawFilledBox
Draws a solid block of color, coordinates are gaze-position display coordinates.
def | getFixationUpdateInterval
Returns the fixation update interval value.
def | getFixationUpdateAccumulate
Returns the fixation update accumulate value.
def | setFixationUpdateInterval
Sends a command to the tracker to update the FixationUpdateInterval.
def | setFixationUpdateAccumulate
Sends a command to the tracker to update the FixationUpdateAccumulate.
def | echo
Prints text at current print position to tracker screen, gray on black only.
def | drawCross
Draws a small "+" to mark a target point.

Public Attributes

trackeraddress

Detailed Description

The EyeLink class is an extension of the EyeLinkListener class with additional utility functions.

Most of these functions are used to perform tracker setups (For current information on the EyeLink tracker configuration, examine the *.INI files in the EYELINK\EXE\ directory of the eye tracker computer). An instance of the EyeLink class can be created by using the class constructor function. For example,

    try:
        EYELINK = EyeLink()
    except:
        EYELINK = None

An instance of EyeLink class can directly use all of the EyeLinkListener methods. In addition, it has its own methods as listed in the following. All of the methods should be called in the format of: EYELINK.functionName(parameters), where EYELINK is an instance of EyeLink class.

Member Function Documentation

def __init__ | ( | self,
 |  | trackeraddress = "100.1.1.1"
 | )

Constructor.

Parameters:
trackeraddress optional tracker address. If no parameters passed in, defalut address of 100.1.1.1 is used. If None is passed as the address, the connection is opened in dummy mode.

def progressUpdate | ( | self,
 |  | size,
 |  | received
 | )

prints out the file transfer progress to the console.

This is called after the call to receiveDataFile

Parameters:
size | Size of the file.
received | Size received so far.

def progressSendDataUpdate | ( | self,
 |  | size,
 |  | sent
 | )

prints out the sending file progress to the console.

This is called after the call to sendDataFile

Parameters:
size | Size of the file.
received | Size received so far.

def setSampleSizeForVelAndAcceleration | ( | self,
 |  | sm
 | )

Sets the sample model to be used for velocity and acceleration calculation.

xrefitem todo 2

Parameters:
sm sample model to be used. Valid values are FIVE_SAMPLE_MODEL, NINE_SAMPLE_MODEL,SEVENTEEN_SAMPLE_MODEL, and EL1000_TRACKER_MODEL

def getSampleSizeForVelAndAcceleration ( self )

Returns the sample model used for velocity and acceleration calculation.

def setVelocityAccelerationModel | ( | self,
 |  | sm
 | )

Sets the sample model to be used for velocity and acceleration calculation.

Same as setSampleSizeForVelAndAcceleration excepts this interprets string message.

Parameters:
sm sample model to be used. Valid values are 5-sample Model, 9-sample Model,17-sample Model, and EL1000 Tracker Model

def getVelocityAccelerationModel ( self )

Returns the sample model used for velocity and acceleration calculation in text form.

def getTrackerAddress ( self )

Returns the tracker address.

def getDummyMode ( self )

Returns wheter in dummy mode or not.

def doTrackerSetup | ( | self,
 |  | width = None,
 |  | height = None
 | )

Switches the EyeLink tracker to the Setup menu, from which camera setup, calibration, validation, drift correction, and configuration may be performed.

Pressing the 'Esc' key on the tracker keyboard will exit the Setup menu and return from this function. Calling exitCalibration() from an event handler will cause any call to do_tracker_setup() in progress to return immediately.

Parameters:
width | Width of the screen.
height | Height of he screen.

def setAcceptTargetFixationButton | ( | self,
 |  | button
 | )

This programs a specific button for use in drift correction.

Remarks:
This function is equivalent to
    EYELINK.sendCommand("button_function %d 'accept_target_fixation'"%button);
Parameters:
button Id of the button that is used to accept target fixation.

def setCalibrationType | ( | self,
 |  | type
 | )

This command sets the calibration type, and recomputed the calibration targets after a display resolution change.

Remarks:
This function is equivalent to
    EYELINK.sendCommand("calibration_type=%s"%caltype);
Parameters:
type One of these calibration type codes:
H3

horizontal 3-point calibration
HV3

3-point calibration, poor linearization
HV5

5-point calibration, poor at corners
HV9

9-point grid calibration, best overall

def setXGazeConstraint | ( | self,
 |  | x_position = "AUTO"
 | )

Locks the x part of gaze position data.

Usually set to AUTO: this will use the last drift-correction target position when in H3 mode.

Remarks:
This function is equivalent to
    EYELINK.sendCommand("x_gaze_constraint=%s"%(str(value)));
Parameters:
x_position x gaze coordinate, or AUTO.

def setYGazeConstraint | ( | self,
 |  | y_position = "AUTO"
 | )

Locks the y part of gaze position data.

Usually set to AUTO: this will use the last drift-correction target position when in H3 mode.

Remarks:
This function is equivalent to
    EYELINK.sendCommand("y_gaze_constraint=%s"%(str(value)));
Parameters:
y_position y gaze coordinate, or AUTO.

def enableAutoCalibration ( self )

Enables the auto calibration mechanism.

By default, this mechanism is turned off.

Remarks:
This function is equivalent to
    if(EYELINK.isConnected()):
        EYELINK.sendCommand("enable_automatic_calibration=YES")

def disableAutoCalibration ( self )

Disables the auto calibration mechanism.

By default, this mechanism is turned off.

Remarks:
This function is equivalent to
    if(EYELINK.isConnected()):
        EYELINK.sendCommand("enable_automatic_calibration=NO")

def setAutoCalibrationPacing | ( | self,
 |  | pace
 | )

Sets automatic calibration pacing.

1000 is a good value for most subjects, 1500 for slow subjects and when interocular data is required.

Remarks:
This function is equivalent to
    EYELINK.sendCommand("automatic_calibration_pacing=%d"%(time))
Parameters:
time shortest delay.

def readIOPort | ( | self,
 |  | ioport
 | )

Sends a command to the tracker to read the specified io port.

Parameters:
ioport port id of the io port.

def writeIOPort | ( | self,
 |  | ioport,
 |  | data
 | )

Sends a command to the tracker to write the specified io port.

Parameters:
ioport | byte hardware I/O port address. The port address for the C and D ports on the EyeLink analog output card are 4 and 5, respectively; the print port address will typically be 0x378 (please see the buttons.ini settings).
data | data to write

def setHeuristicLinkAndFileFilter | ( | self,
 |  | linkfilter,
 |  | filefilter = -1
 | )

EyeLink II only: Can be used to set level of filtering on the link and analog output, and on file data.

An additional delay of 1 sample is added to link or analog data for each filter level. If an argument of <on> is used, link filter level is set to 1 to match EyeLink I delays. The file filter level is not changed unless two arguments are supplied. The default file filter level is 2.

Remarks:
This function is equivalent to
    if(EYELINK.getTrackerVersion() >=2):
        if(filefilter == -1):
            EYELINK.sendCommand("heuristic_filter %d"%(linkfilter))
        else:
            EYELINK.sendCommand(" %d %d"%(linkfilter, filefilter));
Parameters:
linkfilter | Filter level of the link data. 0 or OFF disables link filter. 1 or ON sets filter to 1 (moderate filtering, 1 sample delay). 2 applies an extra level of filtering (2 sample delay).
filefilter | Filter level of the data written to EDF file. 0 or OFF disables link filter. 1 or ON sets filter to 1 (moderate filtering, 1 sample delay). 2 applies an extra level of filtering (2 sample delay).

def setHeuristicFilterOn ( self )

EyeLink 1 Only: Can be used to enable filtering, increases system delay by 4 msec if the filter was originally off.

NEVER TURN OFF THE FILTER WHEN ANTIREFLECTION IS TURNED ON. For EyeLink II, you should use the setHuresticFileAndLinkFilter() method instead.

Remarks:
This function is equivalent to
    EYELINK.sendCommand("heuristic_filter=ON");

def setHeuristicFilterOff ( self )

EyeLink 1 Only: Can be used to disable filtering, reduces system delay by 4 msec.

NEVER TURN OFF THE FILTER WHEN ANTIREFLECTION IS TURNED ON. For EyeLink II, you should use the following setHuresticFileAndLinkFilter() method instead.

Remarks:
This function is equivalent to
    EYELINK.sendCommand("heuristic_filter = OFF");

def setPupilSizeDiameter | ( | self,
 |  | value
 | )

Can be used to determine pupil size information to be recorded.

Remarks:
This function is equivalent to
    EYELINK.sendCommand("pupil_size_diameter = %s"%(value));
Parameters:
value YES to convert pupil area to diameter; NO to output pupil area data.

def setSimulationMode | ( | self,
 |  | value
 | )

Can be used to turn off head tracking if not used.

Do this before calibration.

Remarks:
This function is equivalent to
    EYELINK.sendCommand("simulate_head_camera = %s"%(value));
Parameters:
value YES to disable head tracking; NO to enable head tracking.

def setScreenSimulationDistance | ( | self,
 |  | distance
 | )

Used to compute correct visual angles and velocities when head tracking not used.

Remarks:
This function is equivalent to
    EYELINK.sendCommand("simulation_screen_distance = %s"%(distance));
Parameters:
distance simulated distance from display to subject in millimeters.

def markPlayBackStart ( self )

Marks the location in the data file from which playback will begin at the next call to EYEYLINK.startPlayBack().

When this command is not used (or on older tracker versions), playback starts from the beginning of the previous recording block. This default behavior is suppressed after this command is used, until the tracker application is shut down.

Remarks:
This function is equivalent to
    EYELINK.sendCommand("mark_playback_start");

def setNoRecordEvents | ( | self,
 |  | message = False,
 |  | button = False,
 |  | inputevent = False
 | )

Selects what types of events can be sent over the link while not recording (e.g between trials).

This command has no effect for EyeLink II, and messages cannot be enabled for versions of EyeLink I before v2.1.

Remarks:
This function is equivalent to
    re = []
    if(message):
        re.append("MESSAGE ")
    if(button):
        re.append("BUTTON ")
    if(inputevent):
        re.append("INPUT ")
    EYELINK.sendCommand("link_nonrecord_events = %s"%"".join(re));
Parameters:
message | 1 to enable the recording of EyeLink messages.
button | 1 to enable recording of buttons (1..8 press or release).
inputevent | 1 to enable recording of changes in input port lines.

def setFileSampleFilter | ( | self,
 |  | list
 | )

Sets data in samples written to EDF file.

See tracker file "DATA.INI" for types.

Remarks:
This function is equivalent to
    EYELINK.sendCommand("file_sample_data = %s"%list)
Parameters:
list list of the following data types, separated by spaces or commas.
GAZE

screen x/y (gaze) position
GAZERES

units-per-degree screen resolution
HREF

head-referenced gaze
PUPIL

raw eye camera pupil coordinates
AREA

pupil area
STATUS

warning and error flags
BUTTON

button state and change flags
INPUT

input port data lines

def setFileEventData | ( | self,
 |  | list
 | )

Sets data in events written to EDF file.

See tracker file "DATA.INI" for types.

Remarks:
This function is equivalent to
    EYELINK.sendCommand("file_event_data = %s"%list);
Parameters:
list list of the following event data types, separated by spaces or commas.
GAZE

screen xy (gaze) position
GAZERES

units-per-degree angular resolution
HREF

HREF gaze position
AREA

pupil area or diameter
VELOCITY

velocity of eye motion (avg, peak)
STATUS

warning and error flags for event
FIXAVG

include ONLY average data in ENDFIX events
NOSTART

start events have no data, just time stamp

def setFileEventFilter | ( | self,
 |  | list
 | )

Sets which types of events will be written to EDF file.

See tracker file "DATA.INI" for types.

Remarks:
This function is equivalent to
    EYELINK.sendCommand("file_event_filter = %s"%list);
Parameters:
list list of the following event types, separated by spaces or commas.
LEFT, RIGHT

events for one or both eyes
FIXATION

fixation start and end events
FIXUPDATE

fixation (pursuit) state updates
SACCADE

saccade start and end
BLINK

blink start an end
MESSAGE

messages (user notes in file)
BUTTON

button 1..8 press or release
INPUT

changes in input port lines;

def setLinkSampleFilter | ( | self,
 |  | list
 | )

Sets data in samples sent through link.

See tracker file "DATA.INI" for types.

Remarks:
This function is equivalent to
    EYELINK.sendCommand("link_sample_data = %s"%list)
Parameters:
list list of data types, separated by spaces or commas.
GAZE

screen xy (gaze) position
GAZERES

units-per-degree screen resolution
HREF

head-referenced gaze
PUPIL

raw eye camera pupil coordinates
AREA

pupil area
STATUS

warning and error flags
BUTTON

button state and change flags
INPUT

input port data lines

def setLinkEventData | ( | self,
 |  | list
 | )

Sets data in events sent through link.

See tracker file "DATA.INI" for types.

Remarks:
This function is equivalent to
    EYELINK.sendCommand("link_event_data = %s"%list);
Parameters:
list list of data types, separated by spaces or commas.
GAZE

screen xy (gaze) position
GAZERES

units-per-degree angular resolution
HREF

HREF gaze position
AREA

pupil area or diameter
VELOCITY

velocity of eye motion (avg, peak)
STATUS

warning and error flags for event
FIXAVG

include ONLY average data in ENDFIX events
NOSTART

start events have no data, just time stamp

def setLinkEventFilter | ( | self,
 |  | list
 | )

Sets which types of events will be sent through link.

See tracker file "DATA.INI" for types.

Remarks:
This function is equivalent to
    EYELINK.sendCommand("link_event_filter = %s"%list);
Parameters:
list list of event types.
LEFT, RIGHT

events for one or both eyes
FIXATION

fixation start and end events
FIXUPDATE

fixation (pursuit) state updates
SACCADE

saccade start and end
BLINK

blink start an end
MESSAGE

messages (user notes in file)
BUTTON

button 1..8 press or release
INPUT

changes in input port lines;

def setSaccadeVelocityThreshold | ( | self,
 |  | vel
 | )

Sets velocity threshold of saccade detector: usually 30 for cognitive research, 22 for pursuit and neurological work.

Remarks:
This function is equivalent to
    EYELINK.sendCommand("saccade_velocity_threshold =%d"%(vel));
Parameters:
vel minimum velocity (°/sec) for saccades.

def setAccelerationThreshold | ( | self,
 |  | accel
 | )

Sets acceleration threshold of saccade detector: usually 9500 for cognitive research, 5000 for pursuit and neurological work.

Remarks:
This function is equivalent to
    EYELINK.sendCommand("saccade_acceleration_threshold  =%d"%(accl));
Parameters:
accel minimum acceleration (°/sec/sec) for saccades.

def setMotionThreshold | ( | self,
 |  | deg
 | )

Sets a spatial threshold to shorten saccades.

Usually 0.15 for cognitive research, 0 for pursuit and neurological work.

Remarks:
This function is equivalent to
    EYELINK. sendCommand("saccade_motion_threshold  =%d"%(deg));
Parameters:
deg minimum motion (degrees) out of fixation before saccade onset allowed.

def setPursuitFixup | ( | self,
 |  | maxvel
 | )

Sets the maximum pursuit velocity accommodation by the saccade detector.

Usually 60.

Remarks:
This function is equivalent to
    EYELINK.sendCommand("saccade_pursuit_fixup =  %d"%(v));
Parameters:
maxvel maximum pursuit velocity fixup (°/sec).

def setUpdateInterval | ( | self,
 |  | time
 | )

Normally set to 0 to disable fixation update events.

Set to 50 or 100 milliseconds to produce updates for gaze-controlled interface applications.

Remarks:
This function is equivalent to
    EYELINK.sendCommand("fixation_update_interval =  %d"%(time));
Parameters:
time milliseconds between fixation updates, 0 turns off.

def setFixationUpdateAccumulate | ( | self,
 |  | time
 | )

Normally set to 0 to disable fixation update events.

Set to 50 or 100 milliseconds to produce updates for gaze-controlled interface applications. Set to 4 to collect single sample rather than average position.

Remarks:
This function is equivalent to
    EYELINK.sendCommand("fixation_update_accumulate =  %d"%(time));
Parameters:
time milliseconds to collect data before fixation update for average gaze position.

def setRecordingParseType | ( | self,
 |  | rtype = "GAZE"
 | )

Sets how velocity information for saccade detection is computed.

Remarks:
This function is equivalent to
    EYELINK.sendCommand("recording_parse_type %s"%(rtype));
Parameters:
rtype GAZE or HREF; Almost always left to GAZE.

def drawText | ( | self,
 |  | text,
 |  | pos = (-1,-1
 | )

Draws text, coordinates are gaze-position display coordinates.

Remarks:
This function is equivalent to
    EYELINK.sendCommand("print_position= %d %d"%pos)
    EYELINK.sendCommand("echo %s"%(text))
Parameters:
text | text to print in quotes.
pos | Center point of text; Default position is (-1, -1).

def clearScreen | ( | self,
 |  | color
 | )

Clear tracker screen for drawing background graphics or messages.

Remarks:
This function is equivalent to
    EYELINK. sendCommand("clear_screen %d"%(color));
Parameters:
color 0 to 15.

def drawLine | ( | self,
 |  | firstPoint,
 |  | secondPoint,
 |  | color
 | )

Draws line, coordinates are gaze-position display coordinates.

Remarks:
This function is equivalent to
    EYELINK. sendCommand("draw_line %d %d %d %d %d"%
        (firstPoint[0],firstPoint[1],secondPoint[0],secondPoint[1], color));
Parameters:
firstPoint | a two-item tuple, containing the x, y coordinates of the start point.
secondPoint | a two-item tuple, containing the x, y coordinates of the end point.
color | 0 to 15.

def drawBox | ( | self,
 |  | x,
 |  | y,
 |  | width,
 |  | height,
 |  | color
 | )

Draws an empty box, coordinates are gaze-position display coordinates.

Remarks:
This function is equivalent to
    EYELINK.sendCommand("draw_box %d %d %d %d %d"%(x,y,x+width,y+height,color));
Parameters:
x | x coordinates for the top-left corner of the rectangle.
y | y coordinates for the top-left corner of the rectangle.
width | width of the filled rectangle.
height | height of the filled rectangle.
color | 0 to 15.

def drawFilledBox | ( | self,
 |  | x,
 |  | y,
 |  | width,
 |  | height,
 |  | color
 | )

Draws a solid block of color, coordinates are gaze-position display coordinates.

Remarks:
This function is equivalent to
    EYELINK.sendCommand("draw_filled_box %d %d %d %d %d"%(x,y,x+width,y+height,color));
Parameters:
x | x coordinates for the top-left corner of the rectangle.
y | y coordinates for the top-left corner of the rectangle.
width | width of the filled rectangle.
height | height of the filled rectangle.
color | 0 to 15.

def getFixationUpdateInterval ( self )

Returns the fixation update interval value.

This does not query the tracker, only valid if setFixationUpdateInterval is called prior to calling this function.

def getFixationUpdateAccumulate ( self )

Returns the fixation update accumulate value.

This does not query the tracker, only valid if setFixationUpdateAccumulate is called prior to calling this function.

def setFixationUpdateInterval | ( | self,
 |  | interval
 | )

Sends a command to the tracker to update the FixationUpdateInterval.

Parameters:
interval value for fixation update interval

def setFixationUpdateAccumulate | ( | self,
 |  | accumulate
 | )

Sends a command to the tracker to update the FixationUpdateAccumulate.

Parameters:
accumulate value for fixation update accumulate

def echo | ( | self,
 |  | text,
 |  | pos = (-1,-1
 | )

Prints text at current print position to tracker screen, gray on black only.

Remarks:
This function is equivalent to
    EYELINK.sendCommand("echo %s"%text)
Parameters:
text text to print in quotes.

def drawCross | ( | self,
 |  | x,
 |  | y,
 |  | color
 | )

Draws a small "+" to mark a target point.

Remarks:
This function is equivalent to
    EYELINK.sendCommand("draw_cross %d %d %d"%(x,y, color));
Parameters:
x | x coordinates for the center point of cross.
y | y coordinates for the center point of cross.
color | 0 to 15 (0 for black; 1 for blue; 2 for green; 3 for cyan; 4 for red; 5 for magenta; 6 for brown; 7 for light gray; 8 for dark gray; 9 for light blue; 10 for light green; 11 for light cyan; 12 for light red; 13 for bright magenta; 14 for yellow; 15 for bright white).

Member Data Documentation

trackeraddress


EyeLink Member List

This is the complete list of members for EyeLink, including all inherited members.

__init__ | EyeLink
pylink::EyeLinkListener::__init__ | EyeLinkListener
abort | EyeLinkCBind
acceptTrigger | EyeLinkCBind
applyDriftCorrect | EyeLinkCBind
bitmapBackdrop | EyeLinkCBind
bitmapSaveAndBackdrop | EyeLinkCBind
breakPressed | EyeLinkCBind
broadcastOpen | EyeLinkCBind
calculateOverallVelocityAndAcceleration | EyeLinkCBind
calculateVelocity | EyeLinkCBind
calculateVelocityXY | EyeLinkCBind
clearScreen | EyeLink
close | EyeLinkCBind
closeDataFile | EyeLinkCBind
commandResult | EyeLinkCBind
dataSwitch | EyeLinkCBind
disableAutoCalibration | EyeLink
doDriftCorrect | EyeLinkCBind
doTrackerSetup | EyeLink
pylink::EyeLinkListener::doTrackerSetup | EyeLinkCBind
drawBox | EyeLink
drawCalTarget | EyeLinkListener
drawCross | EyeLink
drawFilledBox | EyeLink
drawLine | EyeLink
drawText | EyeLink
dummy_open | EyeLinkCBind
echo | EyeLink
echo_key | EyeLinkCBind
enableAutoCalibration | EyeLink
escapePressed | EyeLinkCBind
exitCalibration | EyeLinkCBind
eyeAvailable | EyeLinkCBind
flushKeybuttons | EyeLinkCBind
getButtonStates | EyeLinkCBind
getCalibrationMessage | EyeLinkCBind
getCalibrationResult | EyeLinkCBind
getCRMode | EyeLinkListener
getCurrentMode | EyeLinkCBind
getCurrentTime | EyeLinkListener
getDataCount | EyeLinkCBind
getDummyMode | EyeLink
getEventDataFlags | EyeLinkCBind
getEventTypeFlags | EyeLinkCBind
getEyeUsed | EyeLinkListener
getFileFilter | EyeLinkListener
getFixationUpdateAccumulate | EyeLink
getFixationUpdateInterval | EyeLink
getFloatData | EyeLinkCBind
getImageCrossHairData | EyeLinkCBind
getkey | EyeLinkCBind
getkeyEx | EyeLinkCBind
getLastButtonPress | EyeLinkCBind
getLastButtonStates | EyeLinkCBind
getLastData | EyeLinkCBind
getLastMessage | EyeLinkCBind
getLinkFilter | EyeLinkListener
getModeData | EyeLinkCBind
getNewestSample | EyeLinkCBind
getNextData | EyeLinkCBind
getNode | EyeLinkCBind
getPositionScalar | EyeLinkCBind
getRecordingStatus | EyeLinkCBind
getSample | EyeLinkCBind
getSampleDataFlags | EyeLinkCBind
getSampleRate | EyeLinkListener
getSampleSizeForVelAndAcceleration | EyeLink
getTargetPositionAndState | EyeLinkCBind
getTrackerAddress | EyeLink
getTrackerInfo | EyeLinkListener
getTrackerMode | EyeLinkCBind
getTrackerVersion | EyeLinkCBind
getTrackerVersionString | EyeLinkCBind
getVelocityAccelerationModel | EyeLink
imageModeDisplay | EyeLinkCBind
inSetup | EyeLinkCBind
isConnected | EyeLinkCBind
isInDataBlock | EyeLinkCBind
isRecording | EyeLinkCBind
key_message_pump | EyeLinkCBind
markPlayBackStart | EyeLink
nodeReceive | EyeLinkCBind
nodeRequestTime | EyeLinkCBind
nodeSend | EyeLinkCBind
nodeSendMessage | EyeLinkCBind
open | EyeLinkCBind
openDataFile | EyeLinkCBind
openNode | EyeLinkCBind
pollRemotes | EyeLinkCBind
pollResponses | EyeLinkCBind
pollTrackers | EyeLinkCBind
progressSendDataUpdate | EyeLink
progressUpdate | EyeLink
pumpMessages | EyeLinkCBind
quietMode | EyeLinkCBind
readIOPort | EyeLink
readKeyButton | EyeLinkCBind
readKeyQueue | EyeLinkCBind
readReply | EyeLinkCBind
readRequest | EyeLinkCBind
readTime | EyeLinkCBind
receiveDataFile | EyeLinkCBind
requestTime | EyeLinkCBind
reset | EyeLinkCBind
resetData | EyeLinkCBind
sendCommand | EyeLinkCBind
sendDataFile | EyeLinkCBind
sendKeybutton | EyeLinkCBind
sendMessage | EyeLinkListener
pylink::EyeLinkCBind::sendMessage | EyeLinkCBind
sendTimedCommand | EyeLinkCBind
sendTimedCommandEx | EyeLinkCBind
setAccelerationThreshold | EyeLink
setAcceptTargetFixationButton | EyeLink
setAddress | EyeLinkCBind
setAutoCalibrationPacing | EyeLink
setCalibrationType | EyeLink
setFileEventData | EyeLink
setFileEventFilter | EyeLink
setFileSampleFilter | EyeLink
setFixationUpdateAccumulate | EyeLink
setFixationUpdateAccumulate | EyeLink
setFixationUpdateInterval | EyeLink
setHeuristicFilterOff | EyeLink
setHeuristicFilterOn | EyeLink
setHeuristicLinkAndFileFilter | EyeLink
setLinkEventData | EyeLink
setLinkEventFilter | EyeLink
setLinkSampleFilter | EyeLink
setMotionThreshold | EyeLink
setName | EyeLinkCBind
setNoRecordEvents | EyeLink
setOfflineMode | EyeLinkCBind
setPupilSizeDiameter | EyeLink
setPursuitFixup | EyeLink
setRecordingParseType | EyeLink
setSaccadeVelocityThreshold | EyeLink
setSampleSizeForVelAndAcceleration | EyeLink
setScreenSimulationDistance | EyeLink
setSimulationMode | EyeLink
setUpdateInterval | EyeLink
setVelocityAccelerationModel | EyeLink
setXGazeConstraint | EyeLink
setYGazeConstraint | EyeLink
startData | EyeLinkCBind
startDriftCorrect | EyeLinkCBind
startPlayBack | EyeLinkCBind
startRecording | EyeLinkCBind
startSetup | EyeLinkCBind
stopData | EyeLinkCBind
stopPlayBack | EyeLinkCBind
stopRecording | EyeLinkCBind
targetModeDisplay | EyeLinkCBind
terminalBreak | EyeLinkCBind
trackeraddress | EyeLink
trackerTime | EyeLinkCBind
trackerTimeOffset | EyeLinkCBind
trackerTimeUsec | EyeLinkCBind
trackerTimeUsecOffset | EyeLinkCBind
userMenuSelection | EyeLinkCBind
waitForBlockStart | EyeLinkCBind
waitForData | EyeLinkCBind
waitForModeReady | EyeLinkCBind
writeIOPort | EyeLink


pylink.EyeLinkAddress

EyeLinkAddress Class Reference

The EyeLinkAddress class is used to hold addresses to EyeLink nodes. More...

Inheritance diagram for EyeLinkAddress:

EyelinkMessage List of all members.

Public Member Functions

def | __init__
Constructor.
def | getIP
Returns the IP address of the EyeLink node.
def | getPort
Returns the port number of the EyeLink node.
def | __str__

Public Attributes

ip
port

Detailed Description

The EyeLinkAddress class is used to hold addresses to EyeLink nodes.

An instance of EyeLinkAddress class can be initialized with the class constructor:

    EyeLinkAddress(ip = (100,1,1,1), port = 4000)

where ip is a four-item tuple containing the IP address of the EyeLink node and port is the port number of the connection.

For example,

    myAddress = EyeLinkAddress((100, 1, 1, 1), 4000)

Member Function Documentation

def __init__ | ( | self,
 |  | ip = (100,1,
 |  | port = 4000
 | )

Constructor.

Parameters:
ip | optional ipaddress in tuple form. eg. if the ip address is 192.168.25.48, the tuple form is (192,168,25,48) The default ip address is 100.1.1.1
port | optional port value as integer. The default value is 4000.

def getIP ( self )

Returns the IP address of the EyeLink node.

Returns:
A four-item tuple (integer) containing the IP address of the EyeLink node.

def getPort ( self )

Returns the port number of the EyeLink node.

Returns:
An integer for the port number of the connection.

def __str__ ( self )

Reimplemented in EyelinkMessage.

Member Data Documentation

ip

port


EyeLinkAddress Member List

This is the complete list of members for EyeLinkAddress, including all inherited members.

__init__ | EyeLinkAddress
__str__ | EyeLinkAddress
getIP | EyeLinkAddress
getPort | EyeLinkAddress
ip | EyeLinkAddress
port | EyeLinkAddress


pylink.EyeLinkCBind

EyeLinkCBind Class Reference

Inheritance diagram for EyeLinkCBind:

EyeLinkListener EyeLink List of all members.

Public Member Functions

def | calculateOverallVelocityAndAcceleration
def | getTrackerVersion
def | nodeSendMessage
def | getkey
def | trackerTimeUsecOffset
def | startPlayBack
def | doTrackerSetup
def | inSetup
def | stopData
def | receiveDataFile
def | readKeyQueue
def | sendCommand
def | reset
def | openDataFile
def | sendTimedCommandEx
def | eyeAvailable
def | userMenuSelection
def | dummy_open
def | calculateVelocityXY
def | imageModeDisplay
def | requestTime
def | calculateVelocity
def | waitForBlockStart
def | echo_key
def | sendMessage
def | getNode
def | readKeyButton
def | bitmapBackdrop
def | pollTrackers
def | close
def | key_message_pump
def | closeDataFile
def | getNextData
def | acceptTrigger
def | startRecording
def | getLastMessage
def | readReply
def | trackerTimeUsec
def | getEventDataFlags
def | dataSwitch
def | isRecording
def | readRequest
def | getTrackerMode
def | sendKeybutton
def | startSetup
def | quietMode
def | getModeData
def | nodeSend
def | terminalBreak
def | startData
def | pollResponses
def | getLastButtonStates
def | isConnected
def | waitForData
def | broadcastOpen
def | getRecordingStatus
def | open
def | targetModeDisplay
def | getCalibrationResult
def | nodeReceive
def | getDataCount
def | getLastData
def | getSample
def | doDriftCorrect
def | setOfflineMode
def | getNewestSample
def | breakPressed
def | setName
def | getCurrentMode
def | resetData
def | getCalibrationMessage
def | pollRemotes
def | sendDataFile
def | getTrackerVersionString
def | escapePressed
def | pumpMessages
def | getSampleDataFlags
def | stopRecording
def | getButtonStates
def | abort
def | stopPlayBack
def | sendTimedCommand
def | getLastButtonPress
def | getkeyEx
def | isInDataBlock
def | nodeRequestTime
def | applyDriftCorrect
def | setAddress
def | readTime
def | getImageCrossHairData
def | bitmapSaveAndBackdrop
def | getEventTypeFlags
def | trackerTimeOffset
def | getPositionScalar
def | waitForModeReady
def | exitCalibration
def | openNode
def | flushKeybuttons
def | commandResult
def | getFloatData
def | getTargetPositionAndState
def | startDriftCorrect
def | trackerTime

Detailed Description

C Implementation of EyeLinkListener.

Member Function Documentation

def calculateOverallVelocityAndAcceleration ( )

Calculates overall velocity and acceleration for left and right eyes separately.

Parameters:
[in] slen Sample model to use for velocity calculation. Acceptable models are FIVE_SAMPLE_MODEL, NINE_SAMPLE_MODEL, SEVENTEEN_SAMPLE_MODEL and EL1000_TRACKER_MODEL.
Returns:
A list with 3 elements
  • The first element of the list:
    • overall velocity for left and right eye. Upon return of this function,vel[0] will contain overall velocity for left eye and vel[1] will contain overall velocity for right eye. If velocity cannot be calculated for any reason(eg. insufficient samples, no data) MISSING_DATA is filled for the given velocity.
  • The second element of the list:
    • overall acceleration for left and right eye. Upon return of this function, acc[0] will contain overall acceleration for left eye and acc[1] will contain overall acceleration for right eye. If acceleration cannot be calculated for any reason(eg. insufficient samples, no data) MISSING_DATA is filled for the given acceleration.
  • The third element of the list:
    • vel_sample Velocity for sample.

def getTrackerVersion ( )

After connection, determines if the connected tracker is an EyeLink I or II. Use getTrackerVersionString() to get the string value.

Remarks:
This is equivalent to the C API
    INT16 eyelink_get_tracker_version(char *c);
Returns:
The returned value is a number (0 if not connected, 1 for EyeLink I, 2 for EyeLink II).

def nodeSendMessage ( )

Sends a text message the connected eye tracker. The text will be added to the EDF file.

Remarks:
If the link is initialized but not connected to a tracker, the message will be sent to the tracker set by setAddress() of the pylink module. This function is equivalent to the C API
    INT16 eyelink_node_send_message(ELINKADDR node, char *msg);
Parameters:
address | Address of a specific tracker.
message | Text to send to the tracker.
Returns:
0 if no error, else link error code.

def getkey ( )

Returns the key pressed.

Remarks:
Warning: This function processes and dispatches any waiting messages. This will allow Windows to perform disk access and negates the purpose of realtime mode. Usually these delays will be only a few milliseconds, but delays over 20 milliseconds have been observed. You may wish to call escapePressed() or breakPressed() in recording loops instead of getkey() if timing is critical, for example in a gaze-contingent display. Under Windows XP, these calls will not work in realtime mode at all (although these do work under Windows 2000). Under Windows 95/98/Me, realtime performance is impossible even with this strategy. Some useful keys are:
  • CURS_UP
  • CURS_DOWN
  • CURS_LEFT
  • CURS_RIGHT
  • ESC_KEY
  • ENTER_KEY
  • TERMINATE_KEY
  • JUNK_KEY
This function is equivalent to the C API
    unsigned getkey(void);
Returns:
0 if no key pressed, else key code. TERMINATE_KEY if CTRL-C held down or program has been terminated.

def trackerTimeUsecOffset ( )

Returns the time difference between the tracker time and display pc time.

Remarks:
This is equivalent to the C API
    double eyelink_time_usec_offset();
Returns:
A double precision data for the time difference (in microseconds) between the tracker time and display pc time.

def startPlayBack ( )

Flushes data from queue and starts data playback. An EDF file must be open and have at least one recorded trial. Use waitForData() method to wait for data: this will time out if the playback failed. Playback begins from start of file or from just after the end of the next-but-last recording block. Link data is determined by file contents, not by link sample and event settings.

Remarks:
This function is equivalent to the C API
    INT16 eyelink_playback_start(void);
Returns:
0 if command sent fine, else link error.

def doTrackerSetup ( )

Switches the EyeLink tracker to the Setup menu, from which camera setup, calibration, validation, drift correction, and configuration may be performed. Pressing the 'ESC' key on the tracker keyboard will exit the Setup menu and return from this function. Calling exitCalibration() from an event handler will cause any call to do_tracker_setup() in progress to return immediately.

Parameters:
width | Width of the screen.
height | Height of he screen.

def inSetup ( )

Checks if tracker is still in a Setup menu activity (includes camera image view, calibration, and validation). Used to terminate the subject setup loop.

Remarks:
This function is equivalent to the C API
    INT16 eyelink_in_setup(void);
Returns:
0 if no longer in setup mode.

def stopData ( )

Places tracker in idle (off-line) mode, does not flush data from queue.

Remarks:
Should be followed by a call to waitForModeReady() method. This function is equivalent to the C API
    INT16 eyelink_data_stop(void);
Returns:
0 if command sent fine, else link error.

def receiveDataFile ( )

This receives a data file from the EyeLink tracker PC. Source file name and destination file name should be given.

Remarks:
This function is equivalent to the C API
    int receive_data_file(char *src, char *dest, int is_path=0);
Parameters:
src | Name of eye tracker file (including extension).
dest | Name of local file to write to (including extension).
Returns:
Size of file if successful, Otherwise Runtime Exception is raised.

def readKeyQueue ( )

Read keys from the key queue. It is similar to getkey(), but does not process Windows messages. This can be used to build key-message handlers in languages other than C.

Remarks:
This function is equivalent to the C API
    UINT16 read_getkey_queue(void);
Returns:
0 if no key pressed.
JUNK_KEY (1) if untranslatable key.
TERMINATE_KEY (0x7FFF) if CTRL-C is pressed, terminal_break() was called, or the program has been terminated with ALT-F4.
or code of key if any key pressed.

def sendCommand ( )

Sends the given command to connected eyelink tracker and returns the command result.

Remarks:
This is equivalent to the C API
    int eyecmd_printf(char *fmt, ...); // without any formatting.
Parameters:
command_text Text command to be sent. It does not support printf() kind of formatting.
Returns:
Command result. If there is any problem sending the command, a runtime exception is raised.

def reset ( )

Sends a reset message to the EyeLink tracker.

Remarks:
This function is equivalent to the C API
    INT16 eyelink_close(int send_msg);  // with send_msg parameter 0.
Returns:
0 if successful, otherwise link error.

def openDataFile ( )

Opens a new EDF file on the EyeLink tracker computer's hard disk. By calling this function will close any currently opened file. This may take several seconds to complete. The file name should be formatted for MS-DOS, usually 8 or less characters with only 0-9, A-Z, and '_' allowed.

Remarks:
This function is equivalent to the C API
    int open_data_file(char *name);
Parameters:
name Name of eye tracker file, 8 characters or less.
Returns:
0 if file was opened successfully else error code.

def sendTimedCommandEx ( )

Sends a command to the connected eye tracker, wait for reply.

Returns:
List of 2 items. The first item contains the return value of eyelink_timed_command(). The second item contains a string description of the error message.
Remarks:
If there is an error, no exception is raised.
See also:
sendTimedCommand()

def eyeAvailable ( )

After calling the waitForBlockStart() method, or after at least one sample or eye event has been read, this function can be used to check which eyes data is available for.

Remarks:
This is equivalent to the C API
    INT16 eyelink_eye_available(void);
Returns:
LEFT_EYE (0) if left eye data.
RIGHT_EYE (1) if right eye data.
BINOCULAR (2) if both left and right eye data.
-1 if no eye data is available.

def userMenuSelection ( )

Checks for a user-menu selection, clears response for next call.

Remarks:
This function is equivalent to the C API
    INT16 eyelink_user_menu_selection(void);
Returns:
0 if no selection made since last call, else code of selection.

def dummy_open ( )

Sets the EyeLink library to simulate an eyetracker connection. Functions will return plausible values, but no data.

Remarks:
The function isConnected() will return -1 to indicate a simulated connection.

def calculateVelocityXY ( )

Calculates left x velocity, left y velocity, right x velocity and right y velocity from queue of samples.

Parameters:
[in] slen Sample model to use for velocity calculation. Acceptable models are FIVE_SAMPLE_MODEL, NINE_SAMPLE_MODEL, SEVENTEEN_SAMPLE_MODEL and EL1000_TRACKER_MODEL.
Returns:
A list with 3 elements
  • The first element of the list:
    • leftvel x and y velocity for left eye. The float tuple of 2 filled with x and y velocity values. Upon return of this function leftvel[0] contains the left x velocity data and leftvel[1] contains left y velocity data. If velocity cannot be calculated for any reason (eg. insufficient samples, no data) MISSING_DATA is filled for the given velocity.
  • The second element of the list:
    • rightvel x and y velocity for right eye. The float tuple of 2 filled with x and y velocity values. Upon return of this function rightvel[0] contains the right x velocity data and rightvel[1] contains right y velocity data. If velocity cannot be calculated for any reason (eg. insufficient samples, no data) MISSING_DATA is filled for the given velocity.
  • The third element of the list:
    • vel_sample Velocity for sample.

def imageModeDisplay ( )

This handles display of the EyeLink camera images. While in imaging mode, it contiuously requests and displays the current camera image. It also displays the camera name and threshold setting. Keys on the subject PC keyboard are sent to the tracker, so the experimenter can use it during setup. It will exit when the tracker leaves imaging mode or disconnects.

Returns:
0 if OK, TERMINATE_KEY if pressed, -1 if disconnect.
Remarks:
This function not normally used externally. If you need camera setup use doTrackerSetup() or if you need drift correction use doDriftCorrect()

def requestTime ( )

Sends a request the connected eye tracker to return its current time.

Remarks:
The time reply can be read with readTime().
Returns:
0 if no error, else link error code.
See also:
rackerTime()

def calculateVelocity ( )

Calculates overall velocity for left and right eyes separately.

Parameters:
[in] slen Sample model to use for velocity calculation. Acceptable models are FIVE_SAMPLE_MODEL, NINE_SAMPLE_MODEL, SEVENTEEN_SAMPLE_MODEL and EL1000_TRACKER_MODEL.
Returns:
A list with 3 elements:
  • First two elements of the list:
    • Upon return of this function, vel[0] will contain overall velocity for left eye and vel[1] will contain overall velocity for right eye. If velocity cannot be calculated for any reason(eg. insufficient samples, no data) MISSING_DATA is filled for the given velocity.
  • Third element of the list:
    • vel_sample Velocity for sample.

def waitForBlockStart ( )

Reads and discards events in data queue until in a recording block. Waits for up to <timeout> milliseconds for a block containing samples, events, or both to be opened. Items in the queue are discarded until the block start events are found and processed. This function will fail if both samples and events are selected but only one of link samples and events were enabled by startRecording().

Remarks:
This function did not work in versions previous to 2.0. This function is equivalent to the C API
    INT16 eyelink_wait_for_block_start(UINT32 maxwait,INT16 samples, INT16 events);
Parameters:
timeout | Time in milliseconds to wait.
samples | If non-zero, check if in a block with samples.
events | If non-zero, check if in a block with events.
Exceptions:
Runtime exception is raised if time expires and no data of masked types is available. handling: getLastError()[0]==0
Returns:
true if data is available

def echo_key ( )

Checks for Windows keystroke events and dispatches messages; similar to getkey(), but also sends keystroke to tracker.

Remarks:
Warning: Under Windows XP, this call will not work in realtime mode at all, and will take several seconds to respond if graphics are being drawn continuously. This function works well in realtime mode under Windows 2000. This function is equivalent to the C API
    unsigned echo_key(void);
Returns:
0 if no key pressed, else key code TERMINATE_KEY if CTRL-C held down or program has been terminated.

def sendMessage ( )

Sends the given message to the connected eyelink tracker. The message will be written to the eyelink tracker.

Remarks:
This is equivalent to the C API
    int eyemsg_printf(char *fmt, ...);
Parameters:
message_text Text message to be sent. It does not support printf() kind of formatting.
Returns:
If there is any problem sending the message, a runtime exception is raised.

def getNode ( )

Reads the responses returned by other trackers or remotes in response to pollTrackers() or pollRemotes(). It can also read the tracker broadcast address and remote broadcast addresses.

Remarks:
This function is equivalent to the C API
    INT16 eyelink_get_node(INT16 resp, void *data);
Parameters:
resp Nmber of responses to read: 0 gets our data, 1 get first response, 2 gets the second response, etc. -1 to read the tracker broadcast address. -2 to read remote broadcast addresses.
Returns:
If successful, an instance of EyeLinkMessage class returned.

def readKeyButton ( )

Reads any queued key or button events from tracker.

Remarks:
This function is equivalent to the C API
    UINT16 eyelink_read_keybutton(INT16 *mods,INT16 *state, UINT16 *kcode, UINT32 *time);
Returns:
A five-item tuple, recording (in the following order):
  • Key character if key press/release/repeat, KB_BUTTON (0xFF00) if button press or release,
  • Button number or key modifier (Shift, Alt and Ctrl key states),
  • Key or button change (KB_PRESS, KB_RELEASE, or KB_REPEAT),
  • Key scan code,
  • Tracker time of the key or button change.

def bitmapBackdrop ( )

This function transfers the bitmap to the tracker PC as backdrop for gaze cursors.

Parameters:
iwidth | Original image width.
iheight | Original image height.
pixels | Pixels of the image in one of two possible formats: pixel=[line1, line2, ... linen] line=[pix1,pix2,...,pixn],pix=(r,g,b). pixel=[line1, line2, ... linen] line=[pix1,pix2,...,pixn],pix=0xAARRGGBB.
xs | Crop x position.
ys | Crop y position.
width | Crop width.
height | Crop height.
xd | X position - transfer.
yd | Y position - transfer.
xferoptions Transfer options(BX_AVERAGE,BX_DARKEN,BX_LIGHTEN,BX_MAXCONTRAST,BX_NODITHER,BX_GRAYSCALE). Transfer options set with bitwise OR of the following constants, determines how bitmap is processed:
  • BX_AVERAGE Averaging combined pixels
  • BX_DARKEN Choosing darkest and keep thin dark lines.
  • BX_LIGHTEN Choosing darkest and keep thin white lines and control how bitmap size is reduced to fit tracker display.
  • BX_MAXCONTRAST Maximizes contrast for clearest image.
  • BX_NODITHER Disables the dithering of the image.
  • BX_GREYSCALE Converts the image to grayscale (grayscale works best for EyeLink I, text, etc.).
Remarks:
This function should not be called when timing is critical, as this might take very long to return.

def pollTrackers ( )

Asks all trackers (with EyeLink software running) on the network to send their names and node address.

Remarks:
This function is equivalent to the C API
    INT16 eyelink_poll_trackers(void);
Returns:
0 if successful, otherwise link error.

def close ( )

Sends a disconnect message to the EyeLink tracker.

Remarks:
This function is equivalent to the C API
    INT16 eyelink_close(int send_msg);  // with send_msg parameter 1.
Returns:
0 if successful, otherwise link error.

def key_message_pump ( )

Similar to pumpMessages(), but only processes keypresses. This may help reduce latency.

def closeDataFile ( )

Closes any currently opened EDF file on the EyeLink tracker computer's hard disk. This may take several seconds to complete.

Remarks:
This function is equivalent to the C API
    int close_data_file(void);
Returns:
0 if command executed successfully else error code.

def getNextData ( )

Fetches next data item from link buffer and returns the data item type. If the item is not wanted, simply ignore it. Otherwise, call getFloatData() to read it into a buffer.

Returns:
0 if no data, SAMPLE_TYPE if sample, else event type.

def acceptTrigger ( )

Triggers the EyeLink tracker to accept a fixation on a target, similar to the 'Enter' key or spacebar on the tracker.

Remarks:
This function is equivalent to the C API
    INT16 eyelink_accept_trigger(void);
Returns:
NO_REPLY if drift correction not completed yet.
OK_RESULT (0) if success.
ABORT_REPLY (27) if 'ESC' key aborted operation.
-1 if operation failed.
1 if poor calibration or excessive validation error.

def startRecording ( )

Starts the EyeLink tracker recording, sets up link for data reception if enabled.

Remarks:
Recording may take 10 to 30 milliseconds to begin from this command. The function also waits until at least one of all requested link data types have been received. If the return value is not zero, return the result as the trial result code. This is equivalent to the C API
    INT16 start_recording(INT16 file_samples, INT16 file_events, INT16 link_samples, INT16 link_events);
Parameters:
file_samples | If 1, writes samples to EDF file. If 0, disables sample recording.
file_events | If 1, writes events to EDF file. If 0, disables event recording.
link_samples | If 1, sends samples through link. If 0, disables link sample access.
link_events | If 1, sends events through link. If 0, disables link event access.
Returns:
0 if successful, else trial return code.

def getLastMessage ( )

Returns text associated with last command response: may have error message.

Remarks:
This is equivalent to the C API
    INT16 eyelink_last_message(char *buf);
Returns:
Text associated with last command response or None.

def readReply ( )

Returns text with reply to last read request.

Remarks:
This is equivalent to the C API
    INT16 eyelink_read_reply(char *buf);
Returns:
String to contain text or None.

def trackerTimeUsec ( )

Returns the current tracker time (in microseconds) since the tracker application started.

Remarks:
This is equivalent to the C API
    UINT32 eyelink_tracker_time();
Returns:
A double precision data for the current tracker time (in microseconds) since tracker initialization.

def getEventDataFlags ( )

Returns the event data content flags.

Remarks:
This is equivalent to the C API
    UINT16 eyelink_event_data_flags(void);
Returns:
Possible return values are a set of the following bit flags:
Constant Name Value Description
EVENT_VELOCITY

0x8000

Has velocity data
EVENT_PUPILSIZE

0x4000

Has pupil size data
EVENT_GAZERES

0x2000

Has gaze resolution
EVENT_STATUS

0x1000

Has status flags
EVENT_GAZEXY

0x0400

Has gaze x, y position
EVENT_HREFXY

0x0200

Has head-ref x, y position
EVENT_PUPILXY

0x0100

Has pupil x, y position
FIX_AVG_ONLY

0x0008

Only average data to fixation events
START_TIME_ONLY

0x0004

Only start-time in start events
PARSEDBY_GAZE

0x00C0

Events were generated by GAZE data
PARSEDBY_HREF

0x0080

Events were generated by HREF data
PARSEDBY_PUPIL

0x0040

Events were generated by PUPIL data

def dataSwitch ( )

Sets what data from tracker will be accepted and placed in queue.

Remarks:
This does not start the tracker recording, and so can be used with broadcastOpen(). It also does not clear old data from the queue. This function is equivalent to the C API
    INT16 eyelink_data_switch(UINT16 flags);
Parameters:
flags Bitwise OR of the following flags:
  • RECORD_LINK_SAMPLES - send samples on link.
  • RECORD_LINK_EVENTS - send events on link.
Returns:
0 if no error, else link error code.

def isRecording ( )

Check if we are recording: if not, report an error. Call this function while recording. It will return true if recording is still in progress, otherwise it will throw an exception. It will also handle the EyeLink Abort menu. Any errors returned by this function should be returned by the trial function. On error, this will disable realtime mode and restore the heuristic.

Remarks:
This function is equivalent to the C API
    int check_recording(void);
Returns:
TRIAL_OK (0) if no error.
REPEAT_TRIAL, SKIP_TRIAL, ABORT_EXPT, TRIAL_ERROR if recording aborted.

def readRequest ( )

Sends a text variable name whose value is read and returned by the tracker as a text string.

Remarks:
If the link is initialized but not connected to a tracker, the message will be sent to the tracker set by setAddress(). However, these requests will be ignored by tracker versions older than EyeLink I v2.1 and EyeLink II v1.1. This is equivalent to the C API
    INT16 eyelink_read_request(char *text);
Parameters:
text String with message to send.
Returns:
0 if success, otherwise link error code.

def getTrackerMode ( )

Returns raw EyeLink mode numbers.

Remarks:
This function is equivalent to the C API
    INT16 eyelink_tracker_mode(void);
Returns:
Raw EyeLink mode, -1 if link disconnected.
Constant | Value
EL_IDLE_MODE | 1
EL_IMAGE_MODE | 2
EL_SETUP_MENU_MODE | 3
EL_USER_MENU_1 | 5
EL_USER_MENU_2 | 6
EL_USER_MENU_3 | 7
EL_OPTIONS_MENU_MODE | 8
EL_OUTPUT_MENU_MODE | 9
EL_DEMO_MENU_MODE | 10
EL_CALIBRATE_MODE | 11
EL_VALIDATE_MODE | 12
EL_DRIFT_CORR_MODE | 13
EL_RECORD_MODE | 14
USER_MENU_NUMBER(mode) ((mode)-4)

def sendKeybutton ( )

Sends a key or button event to tracker. Only key events are handled for remote control.

Remarks:
This function is equivalent to the C API
    INT16 eyelink_send_keybutton(UINT16 code, UINT16 mods, INT16 state);
Parameters:
code | Key character, or KB_BUTTON (0xFF00) if sending button event.
mods | Button number, or key modifier (Shift, Alt and Ctrl key states).
state | Key or button change (KB_PRESS or KB_RELEASE).
Returns:
0 if OK, else send link error.

def startSetup ( )

Switches the EyeLink tracker to the setup menu, for calibration, validation, and camera setup. Should be followed by a call to waitForModeReady().

Remarks:
This is equivalent to the C API
    INT16 eyelink_start_setup(void);
Returns:
0 if command send fine.

def quietMode ( )

Controls the level of control an application has over the tracker.

Remarks:
This function is equivalent to the C API
    INT16 eyelink_quiet_mode(INT16 mode);
Parameters:
mode 0 to allow all communication;
1 to block commands (allows only key presses, messages, and time or variable read requests);
2 to disable all commands, requests and messages;
-1 to just return current setting.
Returns:
Returns the previous mode settings.

def getModeData ( )

After calling waitForBlockStart(), or after at least one sample or eye event has been read, returns EyeLink II extended mode data.

Remarks:
This function is equivalent to the C API
    INT16 eyelink2_mode_data(INT16 *sample_rate, INT16 *crmode, INT16 *file_filter, INT16 *link_filter);
Returns:
A five-item tuple holding (in the following order):
  • success value of call to eyelink2_mode_data(). 0 if link state data available, -1 otherwise.
  • sampling rate (samples per second),
  • CR mode flag (0 if pupil-only mode, else pupil-CR mode),
  • filter level applied to file samples (0 = off, 1 = std, 2 = extra),
  • filter level applied to link and analog output samples (0 = off, 1 = std, 2 = extra).

def nodeSend ( )

Sends a given data to the given node.

Remarks:
This function is equivalent to the C API
    INT16 eyelink_node_send(ELINKADDR node, void *data, UINT16 dsize);
Parameters:
addr | the address of the node.
data | Pointer to buffer containing data to send.
length | Number of bytes of data.
Returns:
0 if successful, otherwise link error.

def terminalBreak ( )

This function can be called in an event handler to signal that the program is terminating. Calling this function with an argument of 1 will cause breakPressed() to return 1, and getkey() to return TERMINATE_KEY. These functions can be re-enabled by calling terminalBreak() with an argument of 0.

Remarks:
This function is equivalent to the C API
    void terminal_break(INT16 assert);
Parameters:
assert 1 to signal a program break, 0 to reset break.

def startData ( )

Switches tracker to Record mode, enables data types for recording to EDF file or sending to link. These types are set with a bit wise OR of these flags:

Constant Name | Value | Description
RECORD_FILE_SAMPLES | 1 | Enables sample recording to EDF file
RECORD_FILE_EVENTS | 2 | Enables event recording to EDF file
RECORD_LINK_SAMPLES | 4 | Enables sending samples to the link
RECORD_LINK_EVENTS | 8 | Enables sending events to the link

Remarks:
If <lock> is nonzero, the recording may only be terminated through stopRecording() or stopData() method of the EyeLinkListener class, or by the Abort menu ('Ctrl' 'Alt' 'A' keys on the eye tracker). If zero, the tracker 'ESC' key may be used to halt recording. This function is equivalent to the C API
    INT16 eyelink_data_start(UINT16 flags, INT16 lock);
Parameters:
flags | Bitwise OR of flags to control what data is recorded. If 0, recording will be stopped.
lock | If nonzero, prevents 'ESC' key from ending recording.
Returns:
0 if command sent fine, else link error.

def pollResponses ( )

Returns the count of node addresses received so far following the call of pollRemotes() or pollTrackers().

Remarks:
You should allow about 100 milliseconds for all nodes to respond. Up to 4 node responses are saved. This function is equivalent to the C API
    INT16 eyelink_poll_responses(void);
Returns:
Number of nodes responded. 0 if no responses.

def getLastButtonStates ( )

Returns a flag word with bits set to indicate which tracker buttons are currently pressed. This is button 1 for the LSB, up to button 16 for the MSB. Same as getButtonStates() except, the time is also returned.

Returns:
a list of with values time and states of 7 buttons. Example:
    v = eyelink.getLastButtonStates()
    print "time of last button states ", v[0]
    print "Button states"
    button_states = v[1:]
    button =0
    for x in button_states:
        button = button +1
        if x!=0:
            print "Button ",button," Pressed "
See also:
eyelink_send_keybutton()

def isConnected ( )

Checks whether the connection to the tracker is alive.

Remarks:
This is equivalent to the C API
    INT16 eyelink_is_connected(void);
Returns:
0 if link closed.
-1 if simulating connection.
1 for normal connection.
2 for broadcast connection.

def waitForData ( )

Waits for data to be received from the eye tracker. Can wait for an event, a sample, or either. Typically used after record start to check if data is being sent.

Remarks:
This function is equivalent to the C API
    INT16 eyelink_wait_for_data (UINT32 maxwait, INT16 samples, INT16 events);
Parameters:
maxwait | Time in milliseconds to wait for data.
samples | If 1, return when first sample available.
events | If 1, return when first event available.
Exceptions:
\c Runtime Error if time expires and no data of masked types is available. handling: getLastError()[0] == 0
Returns:
1 if data is available.

def broadcastOpen ( )

Allows a third computer to listen in on a session between the eye tracker and a controlling remote machine. This allows it to receive data during recording and playback, and to monitor the eye tracker mode. The local computer will not be able to send commands to the eye tracker, but may be able to send messages or request the tracker time.

Remarks:
This may not function properly, if there are more than one Ethernet cards installed. This function is equivalent to the C API
    INT16  eyelink_broadcast_open(void);
Returns:
0 if successful.
LINK_INITIALIZE_FAILED if link could not be established.
CONNECT_TIMEOUT_FAILED if tracker did not respond.
WRONG_LINK_VERSION if the versions of the EyeLink library and tracker are incompatible.

def getRecordingStatus ( )

Checks if we are in Abort menu after recording stopped and returns trial exit code. Call this function on leaving a trial. It checks if the EyeLink tracker is displaying the Abort menu, and handles it if required. The return value from this function should be returned as the trial result code.

Remarks:
This function is equivalent to the C API
    INT16 check_record_exit(void);
Returns:
TRIAL_OK if no error.
REPEAT_TRIAL, SKIP_TRIAL, ABORT_EXPT if Abort menu activated.

def open ( )

Opens connection to single tracker. If no parameters are given, it tries to open connection to the default host (100.1.1.1).

Remarks:
This is equivalent to the C API
    INT16 eyelink_open_node(ELINKADDR node, INT16 busytest);
Parameters:
eyelink_address | Optional argument. Text IP address of the host PC (the default value is, "100.1.1.1").
busytest | Optional argument. If non-zero the call to eyelink_open_node() will not disconnect an existing connection.
Returns:
Throws Runtime error exception if it cannot open the connection.

def targetModeDisplay ( )

This function needs some "helper" graphics to clear the scren and draw the fixation targets. Since C graphics are compiler-dependent, these are found in other C source files.

While tracker is in any mode with fixation targets... Reproduce targets tracker needs. (if local_trigger) Local Spacebar acts as trigger. (if local_control) Local keys echoes to tracker.

Returns:
0 if OK, 27 if aborted, TERMINATE_KEY if pressed..

def getCalibrationResult ( )

Checks for a numeric result code returned by calibration, validation, or drift correction.

Remarks:
This function is equivalent to the C API
    INT16  eyelink_cal_result(void);
Returns:
NO_REPLY if drift correction not completed yet.
OK_RESULT (0) if success.
ABORT_REPLY (27) if 'ESC' key aborted operation.
-1 if operation failed.
1 if poor calibration or excessive validation error.

def nodeReceive ( )

Checks for and gets the last packet received, stores the data and the node address sent from.

Remarks:
Data can only be read once, and is overwritten if a new packet arrives before the last packet has been read. This function is equivalent to the C API
    INT16 eyelink_node_receive(ELINKADDR node, void *data);
Returns:
An instance of EyeLinkMessage class is returned, if successful.

def getDataCount ( )

Counts total items in queue: samples, events, or both.

Remarks:
This function is equivalent to the C API
    INT16 eyelink_data_count(INT16 samples, INT16 events);
Parameters:
samples | if non-zero count the samples.
events | if non-zero count the events.
Returns:
Total number of samples and events is in the queue.

def getLastData ( )

Gets an integer (unconverted) copy of the last/newest link data (sample or event) seen by getNextData().

Remarks:
This function is equivalent to the C API
    INT16 eyelink_get_last_data(void *buf);
Returns:
Object of type Sample or Event.

def getSample ( )

Gets an integer (unconverted) sample from end of queue, discards any events encountered.

Remarks:
This is equivalent to the C API
    INT16 eyelink_get_sample(void *sample);
Returns:
Object of type Sample.

def doDriftCorrect ( )

Performs a drift correction before a trial.

Remarks:
This is equivalent to the C API
    int do_drift_correct(int x, int y, int draw, int allow_setup);
Parameters:
x | X Position (in pixels) of drift correction target.
y | Y Position (in pixels) of drift correction target.
draw | If 1, the drift correction will clear the screen to the target background color, draw the target, and clear the screen again when the drift correction is done. If 0, the fixation target must be drawn by the user.
allow_setup | If 1, accesses Setup menu before returning, else aborts drift correction.
Returns:
0 if successful, 27 if 'ESC' key was pressed to enter Setup menu or abort.

def setOfflineMode ( )

Places EyeLink tracker in off-line (idle) mode. Wait till the tracker has finished the mode transition.

Remarks:
This is equivalent to the C API
    INT16 set_offline_mode(void);

def getNewestSample ( )

Check if a new sample has arrived from the link. This is the latest sample, not the oldest sample that is read by getNextData(), and is intended to drive gaze cursors and gaze-contingent displays.

Remarks:
This function is equivalent to the C API
    INT16 CALLTYPE eyelink_newest_float_sample(void FARTYPE *buf);
Returns:
None if there is no sample, instance of Sample type otherwise.

def breakPressed ( )

Tests if the program is being interrupted. You should break out of loops immediately if this function does not return 0, if getkey() return TERMINATE_KEY, or if isConnected() method of the class returns 0.

Remarks:
Under Windows XP, this call will not work in realtime mode at all, and will take several seconds to respond if graphics are being drawn continuously. This function works well in realtime mode under Windows 2000. This function is equivalent to the C API
    INT16 break_pressed(void);
Returns:
1 if CTRL-C is pressed, terminalBreak() was called, or the program has been terminated with ALT-F4; 0 otherwise

def setName ( )

Sets the node name of this computer (up to 35 characters).

Remarks:
This function is equivalent to the C API
    INT16 eyelink_set_name(char *name);
Parameters:
name String to become new name.

def getCurrentMode ( )

This function tests the current tracker mode, and returns a set of flags based of what the mode is doing. The most useful flag using the EyeLink experiment toolkit is IN_USER_MENU to test if the EyeLink Abort menu has been activated.

Remarks:
This is equivalent to the C API
    INT16 eyelink_current_mode(void);
Returns:
Set of bit flags that mark mode function:
IN_DISCONNECT_MODE

if disconnected
IN_IDLE_MODE

if off-line (Idle mode)
IN_SETUP_MODE

if in Setup-menu related mode
IN_RECORD_MODE

if tracking is in progress
IN_PLAYBACK_MODE

if currently playing back data
IN_TARGET_MODE

if in mode that requires a fixation target
IN_DRIFTCORR_MODE

if in drift-correction
IN_IMAGE_MODE

if displaying grayscale camera image
IN_USER_MENU

if displaying Abort or user-defined menu

def resetData ( )

Prepares link buffers to receive new data and removes old data from buffer.

def getCalibrationMessage ( )

Returns text associated with result of last calibration, validation, or drift correction. This usually specifies errors or other statistics.

Remarks:
This function is equivalent to the C API
    INT16 eyelink_cal_message(char *msg);
Returns:
Message string associated with result of last calibration, validation, or drift correction.

def pollRemotes ( )

Asks all non-tracker computers (with EyeLink software running) on the network to send their names and node address.

Remarks:
This function is equivalent to the C API
    INT16 eyelink_poll_ remotes(void);
Returns:
0 if successful, otherwise link error.

def sendDataFile ( )

This sends a file to the EyeLink tracker PC. Source file name and destination file name should be given. Using this function, an image or video can be uploaded from the Display PC to the Tracker PC. The image can later be used as a Gaze Cursor Backdrop via a call to SendCommand("draw_image imagename.ext")

Remarks:
This function is equivalent to the C API
    int send_data_file(char *src, char *dest, int is_path=0)
Parameters:
src | Name of local file (including extension).
dest | Short Name of eye tracker file to write to (including extension).
Returns:
Size of file if successful, Otherwise Runtime Exception is raised.
Example:
    getEYELINK().sendDataFile("ur.jpg", "ur.jpg")             # transfer images as files
    getEYELINK().sendDataFile("small.wmv","small.wmv")        # transfer images as files
    getEYELINK().sendCommand("draw_image ur.jpg")             # draw_image <name>
    getEYELINK().sendCommand("draw_video small.wmv")          # draw_video <name> <-- webui only command
See also:
bitmapSaveAndBackdrop(), bitmapSave(), bitmapBackdrop(), sendCommand()

def getTrackerVersionString ( )

After connection, determines if the connected tracker is an EyeLink I or II (use getTrackerVersion) to get number value.

Remarks:
This is equivalent to the C API
    INT16 eyelink_get_tracker_version(char *c);
Returns:
A string indicating EyeLink tracker version.

def escapePressed ( )

This function tests if the 'ESC' key is held down, and is usually used to break out of nested loops.

Remarks:
Under Windows XP, this call will not work in realtime mode at all, and will take several seconds to respond if graphics are being drawn continuously. This function works well in realtime mode under Windows 2000. This function is equivalent to the C API
    INT16 escape_pressed(void);
Returns:
1 if 'ESC' key held down 0 if not.

def pumpMessages ( )

Forces the graphical environment to process any pending key or mouse events.

Remarks:
This function is equivalent to the C API
    INT16 message_pump(HWND dialog_hook);

def getSampleDataFlags ( )

After calling waitForBlockStart(), or after at least one sample or eye event has been read, returns sample data content flag (0 if not in sample block).

Remarks:
This function is equivalent to the C API
    INT16 eyelink_sample_data_flags(void);
Returns:
Possible return values are a set of the following bit flags:
Constant Name Value Description
SAMPLE_LEFT

0x8000

Data for left eye
SAMPLE_RIGHT

0x4000

Data for right eye
SAMPLE_TIMESTAMP

0x2000

always for link, used to compress files
SAMPLE_PUPILXY

0x1000

pupil x,y pair
SAMPLE_HREFXY

0x0800

head-referenced x,y pair
SAMPLE_GAZEXY

0x0400

gaze x,y pair
SAMPLE_GAZERES

0x0200

gaze res (x,y pixels per degree) pair
SAMPLE_PUPILSIZE

0x0100

pupil size
SAMPLE_STATUS

0x0080

error flags
SAMPLE_INPUTS

0x0040

input data port
SAMPLE_BUTTONS

0x0020

button state: LSBy state, MSBy changes
SAMPLE_HEADPOS

0x0010

head-position: byte tells # words
SAMPLE_TAGGED

0x0008

reserved variable-length tagged
SAMPLE_UTAGGED

0x0004

user-defineabe variable-length tagged

def stopRecording ( )

Stops recording, resets EyeLink data mode. Call 50 to 100 msec after an event occurs that ends the trial. This function waits for mode switch before returning.

Remarks:
This is equivalent to the C API
    void stop_recording(void);

def getButtonStates ( )

Returns a flag word with bits set to indicate which tracker buttons are currently pressed. This is button 1 for the LSB, up to button 16 for the MSB. Buttons above 8 are not realized on the EyeLink tracker.

Remarks:
This function is equivalent to the C API
    UINT16 eyelink_button_states(void);
Returns:
Flag bits for buttons currently pressed.

def abort ( )

Places EyeLink tracker in off-line (idle) mode.

Remarks:
Use before attempting to draw graphics on the tracker display, transferring files, or closing link. Always call waitForModeReady() afterwards to ensure tracker has finished the mode transition. This function pair is implemented by the EyeLink toolkit library function setOfflineMode(). This function is equivalent to the C API
    INT16 eyelink_abort(void);
Returns:
0 if mode switch begun, else link error.

def stopPlayBack ( )

Stops playback if in progress. Flushes any data in queue.

Remarks:
This function is equivalent to the C API
    INT16 eyelink_playback_stop(void);

def sendTimedCommand ( )

Sends a command to the connected eye tracker, wait for reply.

Exceptions:
If there is an error, Runtime exception is raised.
See also:
sendTimedCommandEx()

def getLastButtonPress ( )

Reads the number of the last button detected by the EyeLink tracker. This is 0 if no buttons were pressed since the last call, or since the buttons were flushed. If a pointer to a variable is supplied the eye-tracker timestamp of the button may be read. This could be used to see if a new button has been pressed since the last read. If multiple buttons were pressed since the last call, only the last button is reported.

Remarks:
This function is equivalent to the C API
    UINT16 eyelink_last_button_press(UINT32 *time);
Returns:
Two-item tuple, recording the button last pressed (0 if no button pressed since last read) and the time of the button press.

def getkeyEx ( )

Returns the key pressed. Same as getkey() except, this returns a tuple with the first value contanins the key and the second contains value contains the modifier.

Remarks:
Warning: This function processes and dispatches any waiting messages. This will allow Windows to perform disk access and negates the purpose of realtime mode. Usually these delays will be only a few milliseconds, but delays over 20 milliseconds have been observed. You may wish to call escapePressed() or breakPressed() in recording loops instead of getkey() if timing is critical, for example in a gaze-contingent display. Under Windows XP, these calls will not work in realtime mode at all (although these do work under Windows 2000). Under Windows 95/98/Me, realtime performance is impossible even with this strategy. Some useful keys are:
  • CURS_UP
  • CURS_DOWN
  • CURS_LEFT
  • CURS_RIGHT
  • ESC_KEY
  • ENTER_KEY
  • TERMINATE_KEY
  • JUNK_KEY
This function is equivalent to the C API
    unsigned getkey(void);
Returns:
0 if no key pressed, else key code. TERMINATE_KEY if CTRL-C held down or program has been terminated.

def isInDataBlock ( )

Checks to see if framing events read from queue indicate that the data is in a block containing samples, events, or both.

Remarks:
The first item in queue may not be a block start even, so this should be used in a loop while discarding items using eyelink_get_next_data(NULL). NOTE: this function did not work reliably in versions of the DLL before v2.0 (did not detect end of blocks). This function is equivalent to the C API
    INT16 eyelink_in_data_block(INT16 samples, INT16 events);
Parameters:
samples | if non-zero, check if in a block with samples.
events | if non-zero, check if in a block with events.
Returns:
0 if no data of either masked type is being sent.

def nodeRequestTime ( )

Sends a request the connected eye tracker to return its current time.

Remarks:
The time reply can be read with getTrackerTime(). This function is equivalent to the C API
    UINT32 eyelink_node_request_time(ELINKADDR node);
Parameters:
address Text IP address (for example, "100.1.1.1") for a specific tracker.
Returns:
0 if no error, else link error code.

def applyDriftCorrect ( )

Applies the results of the last drift correction. This is not done automatically after a drift correction, allowing the message returned by getCalibrationMessage() to be examined first.

Remarks:
This function is equivalent to the C API
    INT16 eyelink_apply_driftcorr(void);
Returns:
0 if command sent fine, else link error.

def setAddress ( )

Sets the IP address used for connection to the EyeLink tracker. This is set to "100.1.1.1" in the DLL, but may need to be changed for some network configurations. This must be set before attempting to open a connection to the tracker.

A "broadcast" address ("255.255.255.255") may be used if the tracker address is not known - this will work only if a single Ethernet card is installed, or if DLL version 2.1 or higher, and the latest tracker software versions (EyeLink I v2.1 or higher, and EyeLink II v1.1 or higher) are installed.

Remarks:
This is equivalent to the C API
    INT16 set_eyelink_address(char *addr);
Parameters:
text_IP_address Pointer to a string containing a "dotted" 4-digit IP address;
Returns:
0 if success, -1 if could not parse address string.

def readTime ( )

Returns the tracker time requested by eyelink_request_time() or eyelink_node_request_time().

Returns:
0 if no response yet, else timestamp in millisecond.
See also:
trackerTime()

def getImageCrossHairData ( )

Deprecated:
This function is deprecated. Use lib.tracker.EyeLinkCustomDisplay.draw_cross_hair()

def bitmapSaveAndBackdrop ( )

This function saves the entire bitmap as a .BMP, .JPG, .PNG, or .TIF file, and transfers the image to tracker as backdrop for gaze cursors.

Parameters:
iwidth | Original image width.
iheight | Original image height.
pixels | Pixels of the image in one of two possible formats: pixel=[line1, line2, ... linen] line=[pix1,pix2,...,pixn],pix=(r,g,b). pixel=[line1, line2, ... linen] line=[pix1,pix2,...,pixn],pix=0xAARRGGBB.
xs | Crop x position.
ys | Crop y position.
width | Crop width.
height | Crop height.
fname | File name to save.
path | Path to save.
svoptions | Save options(SV_NOREPLACE, SV_MAKEPATH). If the file exists, it replaces the file unless SV_NOREPLACE is specified.
xd | X position - transfer.
yd | Y position - transfer.
xferoptions Transfer options(BX_AVERAGE,BX_DARKEN,BX_LIGHTEN,BX_MAXCONTRAST,BX_NODITHER,BX_GRAYSCALE). Transfer options set with bitwise OR of the following constants, determines how bitmap is processed:
  • BX_AVERAGE Averaging combined pixels
  • BX_DARKEN Choosing darkest and keep thin dark lines.
  • BX_LIGHTEN Choosing darkest and keep thin white lines and control how bitmap size is reduced to fit tracker display.
  • BX_MAXCONTRAST Maximizes contrast for clearest image.
  • BX_NODITHER Disables the dithering of the image.
  • BX_GREYSCALE Converts the image to grayscale (grayscale works best for EyeLink I, text, etc.).
See also:
bitmapBackdrop(),bitmapSave()

def getEventTypeFlags ( )

After at least one button or eye event has been read, can be used to check what type of events will be available.

Remarks:
This is equivalent to the C API
    UINT16 eyelink_event_type_flags(void);
Returns:
Possible return values are a set of the following bit flags:
Constant Name Value Description
LEFTEYE_EVENTS

0x8000

Has left eye events
RIGHTEYE_EVENTS

0x4000

Has right eye events
BLINK_EVENTS

0x2000

Has blink events
FIXATION_EVENTS

0x1000

Has fixation events
FIXUPDATE_EVENTS

0x0800

Has fixation updates
SACCADE_EVENTS

0x0400

Has saccade events
MESSAGE_EVENTS

0x0200

Has message events
BUTTON_EVENTS

0x0040

Has button events
INPUT_EVENTS

0x0020

Has input port events

def trackerTimeOffset ( )

Returns the time difference between the tracker time and display pc time.

Remarks:
This is equivalent to the C API
    UINT32 eyelink_time_offset();
Returns:
An integer data for the time difference (in milliseconds) between the tracker time and display pc time.

def getPositionScalar ( )

Returns the divisor used to convert integer eye data to floating point data.

Remarks:
This function is equivalent to the C API
    INT16 eyelink_position_prescaler(void);
Returns:
Integer for the divisor (usually 10).

def waitForModeReady ( )

After a mode-change command is given to the EyeLink tracker, an additional 5 to 30 milliseconds may be needed to complete mode setup. Call this function after mode change functions.

Remarks:
If it does not return 0, assume a tracker error has occurred. This function is equivalent to the C API
    INT16 eyelink_wait_for_mode_ready(UINT32 maxwait);
Parameters:
maxwait Maximum milliseconds to wait for the mode to change.
Returns:
0 if mode switching is done, else still waiting.

def exitCalibration ( )

This function should be called from a message or event handler if an ongoing call to doDriftCorrect() or doTrackerSetup() should return immediately.

Remarks:
This function is equivalent to the C API
    void exit_calibration(void);

def openNode ( )

Allows the computer to connect to tracker, where the tracker is on the same network.

Remarks:
This is equivalent to the C API
    INT16 eyelink_open_node(ELINKADDR node, INT16 busytest);
with node parameter converted from text to ELINKADDR.
Parameters:
eyelink_address | Text IP address of the host PC (the default value is, "100.1.1.1").
busytest | If non-zero the call to openNode() will not disconnect an existing connection.
Returns:
Throws Runtime Exception if it connects to the remote host.

def flushKeybuttons ( )

Causes the EyeLink tracker and the EyeLink library to flush any stored button or key events. This should be used before a trial to get rid of old button responses. The <enable_buttons> argument controls whether the EyeLink library will store button press and release events. It always stores tracker key events. Even if disabled, the last button pressed and button flag bits are updated.

Remarks:
This is equivalent to the C API
    INT16 eyelink_flush_keybuttons(INT16 enable_buttons);
Parameters:
enable_buttons Sets to 0 to monitor last button press only, 1 to queue button events.
Returns:
Always 0.

def commandResult ( )

Check for and retrieves the numeric result code sent by the tracker from the last command.

Remarks:
This function is equivalent to the C API
    INT16 eyelink_command_result(void);
Returns:
NO_REPLY if no reply to last command.
OK_RESULT (0) if OK.
Other error codes represent tracker execution error.

def getFloatData ( )

Reads data of a specific type returned by getNextData(). If this function called multiple times without calling getNextData(), the same data is returned.

Remarks:
This function is equivalent to the C API
    INT16 eyelink_get_next_data(void *buf);
Returns:
None if no data available. Otherwise, a valid data is returned. The returned data type can be:
  • Sample
  • StartBlinkEvent
  • EndBlinkEvent
  • StartSacadeEvent
  • EndSacadeEvent
  • StartFixationEvent
  • EndFixationEvent
  • FixUpdateEvent
  • IOEvent
  • MessageEvent

def getTargetPositionAndState ( )

Returns the current target position and state.

Remarks:
This function is equivalent to the C API
    INT16 eyelink_target_check(INT16 *x, INT16 *y);
Returns:
A three-item tuple holding (in the following order):
  • the target visibility (1 if visible, 0 if not),
  • x position of the target,
  • and y position of the target.

def startDriftCorrect ( )

Sets the position of the drift correction target, and switches the tracker to drift-correction mode. Should be followed by a call to waitForModeReady() method.

Remarks:
This function is equivalent to the C API
    INT16 eyelink_driftcorr_start(INT16 x, INT16 y);
Parameters:
x | x position of the target.
y | y position of the target.
Returns:
0 if command sent fine, else link error.

def trackerTime ( )

Returns the current tracker time (in milliseconds) since the tracker application started.

Remarks:
This is equivalent to the C API
    UINT32 eyelink_tracker_time();
Returns:
An integer data for the current tracker time (in milliseconds) since tracker initialization.


EyeLinkCBind Member List

This is the complete list of members for EyeLinkCBind, including all inherited members.

abort | EyeLinkCBind
acceptTrigger | EyeLinkCBind
applyDriftCorrect | EyeLinkCBind
bitmapBackdrop | EyeLinkCBind
bitmapSaveAndBackdrop | EyeLinkCBind
breakPressed | EyeLinkCBind
broadcastOpen | EyeLinkCBind
calculateOverallVelocityAndAcceleration | EyeLinkCBind
calculateVelocity | EyeLinkCBind
calculateVelocityXY | EyeLinkCBind
close | EyeLinkCBind
closeDataFile | EyeLinkCBind
commandResult | EyeLinkCBind
dataSwitch | EyeLinkCBind
doDriftCorrect | EyeLinkCBind
doTrackerSetup | EyeLinkCBind
dummy_open | EyeLinkCBind
echo_key | EyeLinkCBind
escapePressed | EyeLinkCBind
exitCalibration | EyeLinkCBind
eyeAvailable | EyeLinkCBind
flushKeybuttons | EyeLinkCBind
getButtonStates | EyeLinkCBind
getCalibrationMessage | EyeLinkCBind
getCalibrationResult | EyeLinkCBind
getCurrentMode | EyeLinkCBind
getDataCount | EyeLinkCBind
getEventDataFlags | EyeLinkCBind
getEventTypeFlags | EyeLinkCBind
getFloatData | EyeLinkCBind
getImageCrossHairData | EyeLinkCBind
getkey | EyeLinkCBind
getkeyEx | EyeLinkCBind
getLastButtonPress | EyeLinkCBind
getLastButtonStates | EyeLinkCBind
getLastData | EyeLinkCBind
getLastMessage | EyeLinkCBind
getModeData | EyeLinkCBind
getNewestSample | EyeLinkCBind
getNextData | EyeLinkCBind
getNode | EyeLinkCBind
getPositionScalar | EyeLinkCBind
getRecordingStatus | EyeLinkCBind
getSample | EyeLinkCBind
getSampleDataFlags | EyeLinkCBind
getTargetPositionAndState | EyeLinkCBind
getTrackerMode | EyeLinkCBind
getTrackerVersion | EyeLinkCBind
getTrackerVersionString | EyeLinkCBind
imageModeDisplay | EyeLinkCBind
inSetup | EyeLinkCBind
isConnected | EyeLinkCBind
isInDataBlock | EyeLinkCBind
isRecording | EyeLinkCBind
key_message_pump | EyeLinkCBind
nodeReceive | EyeLinkCBind
nodeRequestTime | EyeLinkCBind
nodeSend | EyeLinkCBind
nodeSendMessage | EyeLinkCBind
open | EyeLinkCBind
openDataFile | EyeLinkCBind
openNode | EyeLinkCBind
pollRemotes | EyeLinkCBind
pollResponses | EyeLinkCBind
pollTrackers | EyeLinkCBind
pumpMessages | EyeLinkCBind
quietMode | EyeLinkCBind
readKeyButton | EyeLinkCBind
readKeyQueue | EyeLinkCBind
readReply | EyeLinkCBind
readRequest | EyeLinkCBind
readTime | EyeLinkCBind
receiveDataFile | EyeLinkCBind
requestTime | EyeLinkCBind
reset | EyeLinkCBind
resetData | EyeLinkCBind
sendCommand | EyeLinkCBind
sendDataFile | EyeLinkCBind
sendKeybutton | EyeLinkCBind
sendMessage | EyeLinkCBind
sendTimedCommand | EyeLinkCBind
sendTimedCommandEx | EyeLinkCBind
setAddress | EyeLinkCBind
setName | EyeLinkCBind
setOfflineMode | EyeLinkCBind
startData | EyeLinkCBind
startDriftCorrect | EyeLinkCBind
startPlayBack | EyeLinkCBind
startRecording | EyeLinkCBind
startSetup | EyeLinkCBind
stopData | EyeLinkCBind
stopPlayBack | EyeLinkCBind
stopRecording | EyeLinkCBind
targetModeDisplay | EyeLinkCBind
terminalBreak | EyeLinkCBind
trackerTime | EyeLinkCBind
trackerTimeOffset | EyeLinkCBind
trackerTimeUsec | EyeLinkCBind
trackerTimeUsecOffset | EyeLinkCBind
userMenuSelection | EyeLinkCBind
waitForBlockStart | EyeLinkCBind
waitForData | EyeLinkCBind
waitForModeReady | EyeLinkCBind


pylink.EyeLinkCustomDisplay

EyeLinkCustomDisplay Class Reference

EyeLinkCustomDisplay is an abstract class, that one would implement to present calibration/validation/drift correction targets and camera images. More...

List of all members.

Public Member Functions

def | __init__
Constructor takes no parameters.
def | __updateimgsize__
Internal function to update the mage size.
def | setup_cal_display
This function is called to setup calibration/validation display.
def | exit_cal_display
This function is called just before exiting calibration/validation display.
def | record_abort_hide
This function is called if abort of record.
def | setup_image_display
This function is used to setup image display.
def | image_title
This function displays the camera image title.
def | draw_image_line
This function is used to display an image line.
def | set_image_palette
This function is called to setup the image palettes.
def | exit_image_display
Called to end the image display.
def | clear_cal_display
Called to clear the calibration display.
def | erase_cal_target
Called to erase the calibration or validation target.
def | draw_cal_target
Called to draw the calibration or validation target.
def | play_beep
Called to play target beeps.
def | get_input_key
This function should return list of KeyInput.
def | alert_printf
Called to notify any error message to display or print.
def | draw_line
Called to draw the cross hair, in response to the call to draw_cross_hair().
def | draw_lozenge
Called to draw the cross hair, in response to the call to draw_cross_hair().
def | get_mouse_state
Called to get the mouse location.
def | draw_cross_hair
User call this function to request draw cross hair.

Detailed Description

EyeLinkCustomDisplay is an abstract class, that one would implement to present calibration/validation/drift correction targets and camera images.

In addition, EyeLinkCustomDisplay can also play target beeps and display error messages.

To use custom display do the following.

  • 1. Implement EyeLinkCustomDisplay
  • 2. Create an instance of the custom diplay object
  • 3. Use pylink.openGraphicsEx to let pylink know to use the custom display object

Example:

    genv = EyeLinkCoreGraphicsPyGame(800,600,eyelinktracker)
    openGraphicsEx(genv)
Code to implement EyeLinkCustomDisplay using pygame.

Member Function Documentation

def __init__ ( self )

Constructor takes no parameters.

def __updateimgsize__ | ( | self,
 |  | width,
 |  | height
 | )

Internal function to update the mage size.

The size set by this function is used to draw cross hair when draw_cross_hair() is called This function should not be overrided and should not be called other than the display mechanism.

Parameters:
width | Width of the image.
height | Height of the image.

def setup_cal_display ( self )

This function is called to setup calibration/validation display.

This will be called just before we enter into the calibration or validataion or drift correction mode. Any allocation per calibration or validation drift corretion can be done here. Also, it is normal to clear the display in this call.

def exit_cal_display ( self )

This function is called just before exiting calibration/validation display.

Any resource allocation done in setup_cal_display() can be cleared.

def record_abort_hide ( self )

This function is called if abort of record.

It is used to hide display from subject.

def setup_image_display | ( | self,
 |  | width,
 |  | height
 | )

This function is used to setup image display.

It takes expected image size of the source image. This may be called repeatedly for same display. If this fails, It should return 1 if success and 0 otherwise.

Parameters:
width | Width of the incoming image.
height | Height of the incoming image.
Returns:
1 if success, 0 otherwise.

def image_title | ( | self,
 |  | title
 | )

This function displays the camera image title.

This is called whenever the title changes

Parameters:
title title change

def draw_image_line | ( | self,
 |  | width,
 |  | line,
 |  | totlines,
 |  | buff
 | )

This function is used to display an image line.

This function is called with an array of bytes containing picture colors. The byte on pixels are just palette indexes. This index should be used against the palette created on the call to set_image_palette_hook(). The image is given line by line from top to bottom. It may be efficient to collect one full image and do a full blit of the entire image.

    i =0
    imline = self.imagebuffer[line-1]
    while i <width:
            imline[i] = self.pal[buff[i]]
    i= i+1

def set_image_palette | ( | self,
 |  | red,
 |  | green,
 |  | blue
 | )

This function is called to setup the image palettes.

The function is called with a set of RGB colors to set up for next image.

    self.pal = []
    while i < sz:
        rf = int(b[i])
        gf = int(g[i])
        bf = int(r[i])
        self.pal.append((rf<<16) | (gf<<8) | (bf))
        i = i+1

def exit_image_display ( self )

Called to end the image display.

def clear_cal_display ( self )

Called to clear the calibration display.

def erase_cal_target ( self )

Called to erase the calibration or validation target.

Erase the target drawn by the previous call to draw_cal_target().

def draw_cal_target | ( | self,
 |  | x,
 |  | y
 | )

Called to draw the calibration or validation target.

Draw a target at x,y and display it.

Remarks:
x and y values are relative to the active screen_pixel_coords command.
Parameters:
x | X location to draw the target.
y | Y location to draw the target.

def play_beep | ( | self,
 |  | beepid
 | )

Called to play target beeps.

Parameters:
beepid Id of the beep to be played. Possible values for beepid are:
  • CAL_ERR_BEEP =-1
  • DC_ERR_BEEP =-2
  • CAL_GOOD_BEEP = 0
  • CAL_TARG_BEEP = 1
  • DC_GOOD_BEEP = 2
  • DC_TARG_BEEP = 3

def get_input_key ( self )

This function should return list of KeyInput.

If there are not keys, return an empty list or None.

def alert_printf | ( | self,
 |  | msg
 | )

Called to notify any error message to display or print.

def draw_line | ( | self,
 |  | x1,
 |  | y1,
 |  | x2,
 |  | y2,
 |  | colorindex
 | )

Called to draw the cross hair, in response to the call to draw_cross_hair().

This function should draw a line from (x1,y1) to (x2,y2). The x and y values are relative to the width and height of the image, given at setup_image_display().

Parameters:
x1 | Starting x position.
y1 | Starting y position.
x2 | Ending x position.
y2 | Ending y position.
colorindex Color id of the line. Possible value for colorindex are:
  • CR_HAIR_COLOR=1
  • PUPIL_HAIR_COLOR=2
  • PUPIL_BOX_COLOR=3
  • SEARCH_LIMIT_BOX_COLOR=4
  • MOUSE_CURSOR_COLOR=5

def draw_lozenge | ( | self,
 |  | x,
 |  | y,
 |  | width,
 |  | height,
 |  | colorindex
 | )

Called to draw the cross hair, in response to the call to draw_cross_hair().

This function should draw an lozenge bounded by the box (x,y),(width,height). The x and y values are relative to the width and height of the image, given at setup_image_display().

Remarks:
This function is not used at the moment.
Parameters:
x | Starting x position.
y | Starting y position.
width | bounding width
height | bounding height
colorindex Color id of the ellipse. Possible value for colorindex are:
  • CR_HAIR_COLOR=1
  • PUPIL_HAIR_COLOR=2
  • PUPIL_BOX_COLOR=3
  • SEARCH_LIMIT_BOX_COLOR=4
  • MOUSE_CURSOR_COLOR=5

def get_mouse_state ( self )

Called to get the mouse location.

This function should return the mouse location and the state at the time of call. ((x,y),state). At the moment we only care if the mouse is clicked or not. So, if clicked the state = 1, 0 otherwise. This function is only useful for EyeLink1000.

def draw_cross_hair ( self )

User call this function to request draw cross hair.

After completion of filling in the camera image, call this function to draw the cross hair on the camera image.


EyeLinkCustomDisplay Member List

This is the complete list of members for EyeLinkCustomDisplay, including all inherited members.

__init__ | EyeLinkCustomDisplay
__updateimgsize__ | EyeLinkCustomDisplay
alert_printf | EyeLinkCustomDisplay
clear_cal_display | EyeLinkCustomDisplay
draw_cal_target | EyeLinkCustomDisplay
draw_cross_hair | EyeLinkCustomDisplay
draw_image_line | EyeLinkCustomDisplay
draw_line | EyeLinkCustomDisplay
draw_lozenge | EyeLinkCustomDisplay
erase_cal_target | EyeLinkCustomDisplay
exit_cal_display | EyeLinkCustomDisplay
exit_image_display | EyeLinkCustomDisplay
get_input_key | EyeLinkCustomDisplay
get_mouse_state | EyeLinkCustomDisplay
image_title | EyeLinkCustomDisplay
play_beep | EyeLinkCustomDisplay
record_abort_hide | EyeLinkCustomDisplay
set_image_palette | EyeLinkCustomDisplay
setup_cal_display | EyeLinkCustomDisplay
setup_image_display | EyeLinkCustomDisplay


pylink.EyeLinkListener

EyeLinkListener Class Reference

EyeLinkListener class implements most of the core EyeLink interface. More...

Inheritance diagram for EyeLinkListener:

EyeLinkCBind EyeLink List of all members.

Public Member Functions

def | __init__
def | getTrackerInfo
Returns the current tracker information.
def | drawCalTarget
Allow the normal calibration target drawing to proceed at different locations.
def | getCurrentTime
returns the current tracker time.
def | getSampleRate
returns the current sample rate.
def | getCRMode
returns the current mode data, either PUPIL_ONLY or PUPIL_CR.
def | getLinkFilter
returns the Link Filter Level.
def | getFileFilter
returns the File Filter Level.
def | getEyeUsed
returns the eye used.
def | sendMessage
Sends the given message to the connected EyeLink tracker.

Detailed Description

EyeLinkListener class implements most of the core EyeLink interface.

This includes the simple connection to the eye tracker, sending commands and messages to the tracker, opening and saving a recording file, performing calibration and drift correction, real-time access to tracker data and eye movement events (such as fixations, blinks, and saccades), as well as other important operations.

An instance of EyeLinkListener class can be created by using the class constructor function. For example,

    try:
        EYELINK = EyeLinkListener()
    except:
        EYELINK = None

All of the methods should be called in the format of: EYELINK.functionName(parameters), where EYELINK is an instance of the EyeLinkListener class.

Member Function Documentation

def __init__ ( self )

def getTrackerInfo ( self )

Returns the current tracker information.

Returns:
An instance of the ILinkData class.

def drawCalTarget | ( | self,
 |  | position
 | )

Allow the normal calibration target drawing to proceed at different locations.

This is equivalent to the C API

    INT16 CALLTYPE set_draw_cal_target_hook(INT16 (CALLBACK * erase_cal_target_hook)(HDC hdc), INT16 options);

Parameters:
position A tuple in the format of (x, y), passing along the position of drift correction target. X and y are in screen pixels.

def getCurrentTime ( self )

returns the current tracker time.

def getSampleRate ( self )

returns the current sample rate.

def getCRMode ( self )

returns the current mode data, either PUPIL_ONLY or PUPIL_CR.

def getLinkFilter ( self )

returns the Link Filter Level.

def getFileFilter ( self )

returns the File Filter Level.

def getEyeUsed ( self )

returns the eye used.

def sendMessage | ( | self,
 |  | message_text,
 |  | offset = 0
 | )

Sends the given message to the connected EyeLink tracker.

The message will be written to the EyeLink tracker.

Remarks:
This is equivalent to the C API
    int eyecmd_printf(char *fmt, ...);
The maximum text length is 130 characters. If the given string has more than 130 characters, the first 130 characters will be sent and if the send passes this function will return 1. If the text is not truncated, 0 will be returnd on a successful message send.
Parameters:
message_text text message to be sent. It does not support printf() kind of formatting.
Returns:
If there is any problem sending the message, a runtime exception is raised.


EyeLinkListener Member List

This is the complete list of members for EyeLinkListener, including all inherited members.

__init__ | EyeLinkListener
abort | EyeLinkCBind
acceptTrigger | EyeLinkCBind
applyDriftCorrect | EyeLinkCBind
bitmapBackdrop | EyeLinkCBind
bitmapSaveAndBackdrop | EyeLinkCBind
breakPressed | EyeLinkCBind
broadcastOpen | EyeLinkCBind
calculateOverallVelocityAndAcceleration | EyeLinkCBind
calculateVelocity | EyeLinkCBind
calculateVelocityXY | EyeLinkCBind
close | EyeLinkCBind
closeDataFile | EyeLinkCBind
commandResult | EyeLinkCBind
dataSwitch | EyeLinkCBind
doDriftCorrect | EyeLinkCBind
doTrackerSetup | EyeLinkCBind
drawCalTarget | EyeLinkListener
dummy_open | EyeLinkCBind
echo_key | EyeLinkCBind
escapePressed | EyeLinkCBind
exitCalibration | EyeLinkCBind
eyeAvailable | EyeLinkCBind
flushKeybuttons | EyeLinkCBind
getButtonStates | EyeLinkCBind
getCalibrationMessage | EyeLinkCBind
getCalibrationResult | EyeLinkCBind
getCRMode | EyeLinkListener
getCurrentMode | EyeLinkCBind
getCurrentTime | EyeLinkListener
getDataCount | EyeLinkCBind
getEventDataFlags | EyeLinkCBind
getEventTypeFlags | EyeLinkCBind
getEyeUsed | EyeLinkListener
getFileFilter | EyeLinkListener
getFloatData | EyeLinkCBind
getImageCrossHairData | EyeLinkCBind
getkey | EyeLinkCBind
getkeyEx | EyeLinkCBind
getLastButtonPress | EyeLinkCBind
getLastButtonStates | EyeLinkCBind
getLastData | EyeLinkCBind
getLastMessage | EyeLinkCBind
getLinkFilter | EyeLinkListener
getModeData | EyeLinkCBind
getNewestSample | EyeLinkCBind
getNextData | EyeLinkCBind
getNode | EyeLinkCBind
getPositionScalar | EyeLinkCBind
getRecordingStatus | EyeLinkCBind
getSample | EyeLinkCBind
getSampleDataFlags | EyeLinkCBind
getSampleRate | EyeLinkListener
getTargetPositionAndState | EyeLinkCBind
getTrackerInfo | EyeLinkListener
getTrackerMode | EyeLinkCBind
getTrackerVersion | EyeLinkCBind
getTrackerVersionString | EyeLinkCBind
imageModeDisplay | EyeLinkCBind
inSetup | EyeLinkCBind
isConnected | EyeLinkCBind
isInDataBlock | EyeLinkCBind
isRecording | EyeLinkCBind
key_message_pump | EyeLinkCBind
nodeReceive | EyeLinkCBind
nodeRequestTime | EyeLinkCBind
nodeSend | EyeLinkCBind
nodeSendMessage | EyeLinkCBind
open | EyeLinkCBind
openDataFile | EyeLinkCBind
openNode | EyeLinkCBind
pollRemotes | EyeLinkCBind
pollResponses | EyeLinkCBind
pollTrackers | EyeLinkCBind
pumpMessages | EyeLinkCBind
quietMode | EyeLinkCBind
readKeyButton | EyeLinkCBind
readKeyQueue | EyeLinkCBind
readReply | EyeLinkCBind
readRequest | EyeLinkCBind
readTime | EyeLinkCBind
receiveDataFile | EyeLinkCBind
requestTime | EyeLinkCBind
reset | EyeLinkCBind
resetData | EyeLinkCBind
sendCommand | EyeLinkCBind
sendDataFile | EyeLinkCBind
sendKeybutton | EyeLinkCBind
sendMessage | EyeLinkListener
pylink::EyeLinkCBind::sendMessage | EyeLinkCBind
sendTimedCommand | EyeLinkCBind
sendTimedCommandEx | EyeLinkCBind
setAddress | EyeLinkCBind
setName | EyeLinkCBind
setOfflineMode | EyeLinkCBind
startData | EyeLinkCBind
startDriftCorrect | EyeLinkCBind
startPlayBack | EyeLinkCBind
startRecording | EyeLinkCBind
startSetup | EyeLinkCBind
stopData | EyeLinkCBind
stopPlayBack | EyeLinkCBind
stopRecording | EyeLinkCBind
targetModeDisplay | EyeLinkCBind
terminalBreak | EyeLinkCBind
trackerTime | EyeLinkCBind
trackerTimeOffset | EyeLinkCBind
trackerTimeUsec | EyeLinkCBind
trackerTimeUsecOffset | EyeLinkCBind
userMenuSelection | EyeLinkCBind
waitForBlockStart | EyeLinkCBind
waitForData | EyeLinkCBind
waitForModeReady | EyeLinkCBind


pylink.EyelinkMessage

EyelinkMessage Class Reference

EyelinkMessage class, derived from EyeLinkAddress class, is used to send and receive messages between EyeLink nodes. More...

Inheritance diagram for EyelinkMessage:

EyeLinkAddress List of all members.

Public Member Functions

def | __init__
Constructor.
def | __str__
def | getText
Returns the message to be sent to or received from the node.

Public Attributes

msg

Detailed Description

EyelinkMessage class, derived from EyeLinkAddress class, is used to send and receive messages between EyeLink nodes.

Instances of this class are commonly used as the return values of the nodeReceive() and getNode() methods of the EyeLinkListener or EyeLink class. An instance of EyelinkMessage class can be initialized with the class constructor:

    EyelinkMessage(ip = (100,1,1,1), port = 4000, msg = "")

where ip is a four-item tuple containing the IP address of the EyeLink node, port is the port number of the connection, msg is the message to be sent to or received from the node.

For example,

    myMessage = EyelinkMessage((100, 1, 1, 1), 4000, "test")

Member Function Documentation

def __init__ | ( | self,
 |  | ip = (100,1,
 |  | port = 4000,
 |  | msg = ""
 | )

Constructor.

Parameters:
ip | optional ipaddress in tuple form. eg. if the ip address is 192.168.25.48, the tuple form is (192,168,25,48) The default ip address is 100.1.1.1
port | optional port value as integer. The default value is 4000.
msg | text message.

def __str__ ( self )

Reimplemented from EyeLinkAddress.

def getText ( )

Returns the message to be sent to or received from the node.

Returns:
Text message.

Member Data Documentation

msg


EyelinkMessage Member List

This is the complete list of members for EyelinkMessage, including all inherited members.

__init__ | EyelinkMessage
pylink::EyeLinkAddress::__init__ | EyeLinkAddress
__str__ | EyelinkMessage
getIP | EyeLinkAddress
getPort | EyeLinkAddress
getText | EyelinkMessage
ip | EyeLinkAddress
msg | EyelinkMessage
port | EyeLinkAddress


pylink.FixUpdateEvent

FixUpdateEvent Class Reference

Class to represent the Fix Update event. More...

Inheritance diagram for FixUpdateEvent:

StartNonBlinkEvent EndNonBlinkEvent EyeEvent List of all members.

Public Member Functions

def | __init__
def | getStartPupilSize
Pupil size (in arbitrary units, area or diameter as selected) at the start of a fixation interval.
def | getAverageGaze
The average gaze position during the fixation period (in pixel coordinates set by the screen_pixel_coords command).
def | getAverageHREF
Average HEADREF position during the fixation period.
def | getAveragePupilSize
Average pupil size (in arbitrary units, area or diameter as selected) during a fixation.
def | getEndPupilSize
Pupil size (in arbitrary units, area or diameter as selected) at the end of a fixation interval.
def | __str__

Detailed Description

Class to represent the Fix Update event.

This also inherits all properties from StartNonBlinkEvent and EndNonBlinkEvent.

Member Function Documentation

def __init__ | ( | self,
 |  | time,
 |  | type,
 |  | eye,
 |  | read,
 |  | sttime,
 |  | gstx,
 |  | gsty,
 |  | hstx,
 |  | hsty,
 |  | sta,
 |  | svel,
 |  | supd_x,
 |  | supd_y,
 |  | entime,
 |  | genx,
 |  | geny,
 |  | gavx,
 |  | gavy,
 |  | henx,
 |  | heny,
 |  | havx,
 |  | havy,
 |  | ena,
 |  | ava,
 |  | evel,
 |  | avel,
 |  | pvel,
 |  | eupd_x,
 |  | eupd_y
 | )

def getStartPupilSize ( self )

Pupil size (in arbitrary units, area or diameter as selected) at the start of a fixation interval.

Returns:
Float.

def getAverageGaze ( self )

The average gaze position during the fixation period (in pixel coordinates set by the screen_pixel_coords command).

Returns:
Two-item tuple in the format of (float, float).

def getAverageHREF ( self )

Average HEADREF position during the fixation period.

Returns:
Two-item tuple in the format of (float, float).

def getAveragePupilSize ( self )

Average pupil size (in arbitrary units, area or diameter as selected) during a fixation.

Returns:
Float.

def getEndPupilSize ( self )

Pupil size (in arbitrary units, area or diameter as selected) at the end of a fixation interval.

Returns:
Float.

def __str__ ( self )


FixUpdateEvent Member List

This is the complete list of members for FixUpdateEvent, including all inherited members.

__init__ | FixUpdateEvent
pylink::StartNonBlinkEvent::__init__ | StartNonBlinkEvent
pylink::EyeEvent::__init__ | EyeEvent
pylink::EndNonBlinkEvent::__init__ | EndNonBlinkEvent
__str__ | FixUpdateEvent
getAverageGaze | FixUpdateEvent
getAverageHREF | FixUpdateEvent
getAveragePupilSize | FixUpdateEvent
getAverageVelocity | EndNonBlinkEvent
getEndGaze | EndNonBlinkEvent
getEndHREF | EndNonBlinkEvent
getEndPPD | EndNonBlinkEvent
getEndPupilSize | FixUpdateEvent
getEndTime | EndNonBlinkEvent
getEndVelocity | EndNonBlinkEvent
getEye | EyeEvent
getPeakVelocity | EndNonBlinkEvent
getRead | EyeEvent
getStartGaze | StartNonBlinkEvent
getStartHREF | StartNonBlinkEvent
getStartPPD | StartNonBlinkEvent
getStartPupilSize | FixUpdateEvent
getStartTime | EyeEvent
getStartVelocity | StartNonBlinkEvent
getStatus | EyeEvent
getTime | EyeEvent
getType | EyeEvent


pylink.ILinkData

ILinkData Class Reference

Class to represent tracker status information such as time stamps, flags, tracker addresses and so on. More...

List of all members.

Public Member Functions

def | __init__
def | getTime
Time of last control event.
def | getSampleRate
10*sample rate (0 if no samples, 1 if nonconstant).
def | getSampleDivisor
Sample "divisor" (min msec between samples).
def | getPrescaler
Amount to divide gaze x,y,res by.
def | getVelocityPrescaler
Amount to divide velocity by.
def | getPupilPrescaler
Pupil prescale (1 if area, greater if diameter).
def | getHeadDistencePrescaler
Head-distance prescale (to mm).
def | getSampleDataFlags
0 if off, else all flags.
def | getEventDataFlags
0 if off, else all flags.
def | getEventTypeFlags
0 if off, else event-type flags.
def | isInBlockWithSamples
Set if in block with samples.
def | isInBlockWithEvents
Set if in block with events.
def | haveLeftEye
Set if any left-eye data expected.
def | haveRightEye
Set if any right-eye data expected.
def | getLostDataTypes
Flags what we lost before last item.
def | getLastBufferType
Buffer-type code.
def | getLastBufferSize
Buffer size of last item.
def | isControlEvent
Set if control event read with last data.
def | isNewBlock
Set if control event started new block.
def | getLastItemTimeStamp
Time field of item.
def | getLastItemType
Type: 100 = sample, 0 = none, else event type.
def | getLastItemContent
Content: <read> (IEVENT), <flags> (ISAMPLE).
def | getBlockNumber
Block in file.
def | getSamplesInBlock
Samples read in block so far.
def | getEventsInBlock
Events (excl.
def | getLastResX
Updated by samples only.
def | getLastResY
Updated by samples only.
def | getLastPupil
Updated by samples only.
def | getLastItemStatus
Updated by samples, events.
def | getSampleQueueLength
Number of items in queue.
def | getEventQueueLength
Includes control events.
def | getQueueSize
Total queue buffer size.
def | getFreeQueueLength
Unused bytes in queue.
def | getLastReceiveTime
Time tracker last sent packet.
def | isSamplesEnabled
Data type rcve enable (switch).
def | isEventsEnabled
Data type rcve enable (switch).
def | getPacketFlags
Status flags from data packet.
def | getLinkFlags
Status flags from link packet header.
def | getStateFlags
Tracker error state flags.
def | getTrackerDataOutputState
Tracker data output state.
def | getPendingCommands
Tracker commands pending.
def | isPoolingRemote
1 if polling remotes, else polling trackers.
def | getPoolResponse
Total nodes responding to polling.
def | getReserved
0 for EyeLink I or original EyeLink API DLL.
def | getName
A name for our machine.
def | getTrackerName
Name of tracker connected to.
def | getNodes
Data on nodes.
def | getLastItem
Buffer containing last item.
def | getAddress
Address of our machine.
def | getTrackerAddress
Address of the connected tracker.
def | getTrackerBroadcastAddress
Broadcast address for eye trackers.
def | getRemoteBroadcastAddress
Broadcast address for remotes Equivalent field in ILINKDATA "C": rbroadcast_address.

Detailed Description

Class to represent tracker status information such as time stamps, flags, tracker addresses and so on.

A valid reference to this object can be obtained by calling the function EYELINK.getTrackerInfo().

Member Function Documentation

def __init__ ( self )

def getTime ( self )

Time of last control event.

Equivalent field in ILINKDATA "C": Time.

def getSampleRate ( self )

10*sample rate (0 if no samples, 1 if nonconstant).

Equivalent field in ILINKDATA "C": samrate.

def getSampleDivisor ( self )

Sample "divisor" (min msec between samples).

Equivalent field in ILINKDATA "C": samdiv.

def getPrescaler ( self )

Amount to divide gaze x,y,res by.

Equivalent field in ILINKDATA "C": prescaler.

def getVelocityPrescaler ( self )

Amount to divide velocity by.

Equivalent field in ILINKDATA "C": vprescaler.

def getPupilPrescaler ( self )

Pupil prescale (1 if area, greater if diameter).

Equivalent field in ILINKDATA "C": pprescaler.

def getHeadDistencePrescaler ( self )

Head-distance prescale (to mm).

Equivalent field in ILINKDATA "C": hprescaler.

def getSampleDataFlags ( self )

0 if off, else all flags.

Equivalent field in ILINKDATA "C": sample_data.

def getEventDataFlags ( self )

0 if off, else all flags.

Equivalent field in ILINKDATA "C": event_data.

def getEventTypeFlags ( self )

0 if off, else event-type flags.

Equivalent field in ILINKDATA "C": event_types.

def isInBlockWithSamples ( self )

Set if in block with samples.

Equivalent field in ILINKDATA "C": in_sample_block.

def isInBlockWithEvents ( self )

Set if in block with events.

Equivalent field in ILINKDATA "C": in_event_block.

def haveLeftEye ( self )

Set if any left-eye data expected.

Equivalent field in ILINKDATA "C": have_left_eye.

def haveRightEye ( self )

Set if any right-eye data expected.

Equivalent field in ILINKDATA "C": have_right_eye.

def getLostDataTypes ( self )

Flags what we lost before last item.

Equivalent field in ILINKDATA "C": last_data_gap_types.

def getLastBufferType ( self )

Buffer-type code.

Equivalent field in ILINKDATA "C": last_data_buffer_type.

def getLastBufferSize ( self )

Buffer size of last item.

Equivalent field in ILINKDATA "C": last_data_buffer_size.

def isControlEvent ( self )

Set if control event read with last data.

Equivalent field in ILINKDATA "C": control_read.

def isNewBlock ( self )

Set if control event started new block.

Equivalent field in ILINKDATA "C": first_in_block.

def getLastItemTimeStamp ( self )

Time field of item.

Equivalent field in ILINKDATA "C": last_data_item_time.

def getLastItemType ( self )

Type: 100 = sample, 0 = none, else event type.

Equivalent field in ILINKDATA "C": last_data_item_type.

def getLastItemContent ( self )

Content: <read> (IEVENT), <flags> (ISAMPLE).

Equivalent field in ILINKDATA "C": last_data_item_contents.

def getBlockNumber ( self )

Block in file.

Equivalent field in ILINKDATA "C": block_number.

def getSamplesInBlock ( self )

Samples read in block so far.

Equivalent field in ILINKDATA "C": block_sample.

def getEventsInBlock ( self )

Events (excl.

control read in block). Equivalent field in ILINKDATA "C": block_event.

def getLastResX ( self )

Updated by samples only.

Equivalent field in ILINKDATA "C": last_resx.

def getLastResY ( self )

Updated by samples only.

Equivalent field in ILINKDATA "C": last_resy.

def getLastPupil ( self )

Updated by samples only.

Equivalent field in ILINKDATA "C": last_pupil.

def getLastItemStatus ( self )

Updated by samples, events.

Equivalent field in ILINKDATA "C": last_status.

def getSampleQueueLength ( self )

Number of items in queue.

Equivalent field in ILINKDATA "C": queued_samples.

def getEventQueueLength ( self )

Includes control events.

Equivalent field in ILINKDATA "C": queued_events.

def getQueueSize ( self )

Total queue buffer size.

Equivalent field in ILINKDATA "C": queue_size.

def getFreeQueueLength ( self )

Unused bytes in queue.

Equivalent field in ILINKDATA "C": queue_free.

def getLastReceiveTime ( self )

Time tracker last sent packet.

Equivalent field in ILINKDATA "C": last_rcve_time.

def isSamplesEnabled ( self )

Data type rcve enable (switch).

Equivalent field in ILINKDATA "C": samples_on.

def isEventsEnabled ( self )

Data type rcve enable (switch).

Equivalent field in ILINKDATA "C": events_on.

def getPacketFlags ( self )

Status flags from data packet.

Equivalent field in ILINKDATA "C": packet_flags.

def getLinkFlags ( self )

Status flags from link packet header.

Equivalent field in ILINKDATA "C": link_flags.

def getStateFlags ( self )

Tracker error state flags.

Equivalent field in ILINKDATA "C": state_flags.

def getTrackerDataOutputState ( self )

Tracker data output state.

Equivalent field in ILINKDATA "C": link_dstatus.

def getPendingCommands ( self )

Tracker commands pending.

Equivalent field in ILINKDATA "C": link_pendcmd.

def isPoolingRemote ( self )

1 if polling remotes, else polling trackers.

Equivalent field in ILINKDATA "C": polling_remotes.

def getPoolResponse ( self )

Total nodes responding to polling.

Equivalent field in ILINKDATA "C": poll_responses.

def getReserved ( self )

0 for EyeLink I or original EyeLink API DLL.

Equivalent field in ILINKDATA "C": reserved.

def getName ( self )

A name for our machine.

Equivalent field in ILINKDATA "C": our_name.

def getTrackerName ( self )

Name of tracker connected to.

Equivalent field in ILINKDATA "C": eye_name.

def getNodes ( self )

Data on nodes.

Equivalent field in ILINKDATA "C": nodes.

def getLastItem ( self )

Buffer containing last item.

Equivalent field in ILINKDATA "C": last_data_item.

def getAddress ( self )

Address of our machine.

Equivalent field in ILINKDATA "C": our_address.

def getTrackerAddress ( self )

Address of the connected tracker.

Equivalent field in ILINKDATA "C": eye_address.

def getTrackerBroadcastAddress ( self )

Broadcast address for eye trackers.

Equivalent field in ILINKDATA "C": ebroadcast_address.

def getRemoteBroadcastAddress ( self )

Broadcast address for remotes Equivalent field in ILINKDATA "C": rbroadcast_address.


ILinkData Member List

This is the complete list of members for ILinkData, including all inherited members.

__init__ | ILinkData
getAddress | ILinkData
getBlockNumber | ILinkData
getEventDataFlags | ILinkData
getEventQueueLength | ILinkData
getEventsInBlock | ILinkData
getEventTypeFlags | ILinkData
getFreeQueueLength | ILinkData
getHeadDistencePrescaler | ILinkData
getLastBufferSize | ILinkData
getLastBufferType | ILinkData
getLastItem | ILinkData
getLastItemContent | ILinkData
getLastItemStatus | ILinkData
getLastItemTimeStamp | ILinkData
getLastItemType | ILinkData
getLastPupil | ILinkData
getLastReceiveTime | ILinkData
getLastResX | ILinkData
getLastResY | ILinkData
getLinkFlags | ILinkData
getLostDataTypes | ILinkData
getName | ILinkData
getNodes | ILinkData
getPacketFlags | ILinkData
getPendingCommands | ILinkData
getPoolResponse | ILinkData
getPrescaler | ILinkData
getPupilPrescaler | ILinkData
getQueueSize | ILinkData
getRemoteBroadcastAddress | ILinkData
getReserved | ILinkData
getSampleDataFlags | ILinkData
getSampleDivisor | ILinkData
getSampleQueueLength | ILinkData
getSampleRate | ILinkData
getSamplesInBlock | ILinkData
getStateFlags | ILinkData
getTime | ILinkData
getTrackerAddress | ILinkData
getTrackerBroadcastAddress | ILinkData
getTrackerDataOutputState | ILinkData
getTrackerName | ILinkData
getVelocityPrescaler | ILinkData
haveLeftEye | ILinkData
haveRightEye | ILinkData
isControlEvent | ILinkData
isEventsEnabled | ILinkData
isInBlockWithEvents | ILinkData
isInBlockWithSamples | ILinkData
isNewBlock | ILinkData
isPoolingRemote | ILinkData
isSamplesEnabled | ILinkData


pylink.IOEvent

IOEvent Class Reference

IOEvent class is used to handle BUTTONEVENT and INPUTEVENT types, which report changes in button status or in the input port data. More...

Inheritance diagram for IOEvent:

ButtonEvent List of all members.

Public Member Functions

def | __init__
def | getTime
Timestamp of the sample causing event (in milliseconds since EyeLink tracker was activated).
def | getType
The event code.
def | getData
Coded event data.
def | __str__

Detailed Description

IOEvent class is used to handle BUTTONEVENT and INPUTEVENT types, which report changes in button status or in the input port data.

The getTime() method records the timestamp of the eye-data sample where the change occurred, although the event itself is usually sent before that sample. Button events from the link are rarely used; monitoring buttons with one of readKeybutton(), lastButtonPress(), or buttonStates() of the EyeLink class methods is preferable, since these can report button states at any time, not just during recording.

Returned by getFloatData() whenever there is an IOEvent.

Member Function Documentation

def __init__ | ( | self,
 |  | iotype,
 |  | time,
 |  | data
 | )

def getTime ( self )

Timestamp of the sample causing event (in milliseconds since EyeLink tracker was activated).

Returns:
Long integer.

def getType ( self )

The event code.

This should be BUTTONEVENT (i.e., 25) or INPUTEVENT (i.e., 28).

Returns:
Integer.

def getData ( self )

Coded event data.

Returns:
Long integer.

def __str__ ( self )

Reimplemented in ButtonEvent.


IOEvent Member List

This is the complete list of members for IOEvent, including all inherited members.

__init__ | IOEvent
__str__ | IOEvent
getData | IOEvent
getTime | IOEvent
getType | IOEvent


pylink.KeyInput

KeyInput Class Reference

This represents a key input. More...

List of all members.

Public Member Functions

def __init__

Detailed Description

This represents a key input.

This is used with EyeLinkCustomDisplay to notify the eyelink_core.dll that a key input is available.

Member Function Documentation

def __init__ | ( | self,
 |  | key,
 |  | mod = 0,
 |  | state = 0
 | )


KeyInput Member List

This is the complete list of members for KeyInput, including all inherited members.

__init__ KeyInput


pylink.MessageEvent

MessageEvent Class Reference

A message event is created by your experiment program and placed in the EDF file. More...

List of all members.

Public Member Functions

def | __init__
def | getTime
Timestamp of the sample causing event (when camera imaged eye, in milliseconds since EyeLink tracker was activated).
def | getType
The event code.
def | getText
Message contents (max length 255 characters).

Detailed Description

A message event is created by your experiment program and placed in the EDF file.

It is possible to enable the sending of these messages back through the link, although there is rarely a reason to do this. The MessageEvent class is designed to hold information on EyeLink message events retrieved from the link. Please note that all methods for the MessageEvent class do not take a parameter.

Returned by getFloatData() whenever there is a Message Event.

Member Function Documentation

def __init__ | ( | self,
 |  | time,
 |  | type,
 |  | msg
 | )

def getTime ( self )

Timestamp of the sample causing event (when camera imaged eye, in milliseconds since EyeLink tracker was activated).

Returns:
Long integer.

def getType ( self )

The event code.

This should be MESSAGEEVENT (i.e., 24).

Returns:
Integer.

def getText ( self )

Message contents (max length 255 characters).

Returns:
String.


MessageEvent Member List

This is the complete list of members for MessageEvent, including all inherited members.

__init__ | MessageEvent
getText | MessageEvent
getTime | MessageEvent
getType | MessageEvent


pylink.Sample

Sample Class Reference

The EyeLink toolkit library defines special data classes that allow the same programming calls to be used on different platforms such as MS-DOS, Windows, and Macintosh. More...

List of all members.

Public Member Functions

def | __init__
def | initFromSample
Convenient method to clone a sample.
def | isLeftSample
1 if the sample contains the left eye data; 0 if not.
def | isRightSample
1 if the sample contains the right eye data; 0 if not.
def | isBinocular
1 if the sample contains data from both eyes; 0 if not.
def | getTime
Timestamp when camera imaged eye (in milliseconds since EyeLink tracker was activated).
def | getType
Always SAMPLE_TYPE.
def | getPPD
Angular resolution at current gaze position in screen pixels per visual degree.
def | getStatus
Error and status flags (only useful for EyeLink II, report CR status and tracking error).
def | getInput
Data from input port(s).
def | getFlags
Bits indicating what types of data are present, and for which eye(s).
def | getButtons
Button input data: high 8 bits indicate changes from last sample, low 8 bits indicate current state of buttons 8 (MSB) to 1 (LSB).
def | getRightEye
Returns the sample data information from the desired eye.
def | getLeftEye
Returns the sample data information from the desired eye.
def | getHData
Returns the href data.
def | getEye
Returns Eye data status.
def | getTargetDistance
Target Distance.
def | getTargetX
Target X.
def | getTargetY
Target Y.
def | getTargetFlags
Target Flags.
def | __str__

Detailed Description

The EyeLink toolkit library defines special data classes that allow the same programming calls to be used on different platforms such as MS-DOS, Windows, and Macintosh.

You will need to know these classes to read the examples and to write your own experiments. In this documentation, the common data classes are: Sample class, Eye Event Classes, MessageEvent Class, and IOEvent Class. You only need to read this section if you are planning to use real-time link data for gaze-contingent displays or gaze-controlled interfaces, or to use data playback.

The EyeLink tracker measures eye position 250 or 500 times per second depending on the tracking mode you are working with, and computes true gaze position on the display using the head camera data. This data is stored in the EDF file, and made available through the link in as little as 3 milliseconds after a physical eye movement.

Samples can be read from the link by getFloatData() or getNewestSample() method of the EyeLink/EyeLinkLisenter class. These functions can return instances of Sample class. For example,

    newSample = EYELINK.getFloatData()

The following methods can be used to retrieve properties of a Sample class instance. For example, the time of the sample can be retrieved as newSample.getTime(). Please note that all methods for the Sample class do not take a parameter whereas the return values are noted.

Member Function Documentation

def __init__ | ( | self,
 |  | time,
 |  | type,
 |  | flags,
 |  | px,
 |  | py,
 |  | hx,
 |  | hy,
 |  | pa,
 |  | gx,
 |  | gy,
 |  | rx,
 |  | ry,
 |  | status,
 |  | input,
 |  | buttons,
 |  | htype,
 |  | hdata
 | )

def initFromSample | ( | self,
 |  | sample
 | )

Convenient method to clone a sample.

def isLeftSample ( self )

1 if the sample contains the left eye data; 0 if not.

Returns:
Integer.

def isRightSample ( self )

1 if the sample contains the right eye data; 0 if not.

Returns:
Integer.

def isBinocular ( self )

1 if the sample contains data from both eyes; 0 if not.

Returns:
Integer.

def getTime ( self )

Timestamp when camera imaged eye (in milliseconds since EyeLink tracker was activated).

Returns:
Long integer.

def getType ( self )

Always SAMPLE_TYPE.

Returns:
Integer.

def getPPD ( self )

Angular resolution at current gaze position in screen pixels per visual degree.

The first item of the tuple stores the x-coordinate resolution and the second item of the tuple stores the y-coordinate resolution.

Returns:
Two-item tuple in the format of (float, float).

def getStatus ( self )

Error and status flags (only useful for EyeLink II, report CR status and tracking error).

See eye_data.h for useful bits.

Returns:
Integer.

def getInput ( self )

Data from input port(s).

Returns:
Integer.

def getFlags ( self )

Bits indicating what types of data are present, and for which eye(s).

See eye_data.h for useful bits.

Returns:
Integer.

def getButtons ( self )

Button input data: high 8 bits indicate changes from last sample, low 8 bits indicate current state of buttons 8 (MSB) to 1 (LSB).

Returns:
Integer.

def getRightEye ( self )

Returns the sample data information from the desired eye.

Returns:
Instance of sample data class.

def getLeftEye ( self )

Returns the sample data information from the desired eye.

Returns:
Instance of sample data class.

def getHData ( self )

Returns the href data.

def getEye ( self )

Returns Eye data status.

Returns:
  • 2 if both left and right eye data are present
  • 1 if right eye data present
  • 0 if left eye data present

def getTargetDistance ( self )

Target Distance.

Returns:
Float.

def getTargetX ( self )

Target X.

Returns:
Float.

def getTargetY ( self )

Target Y.

Returns:
Float.

def getTargetFlags ( self )

Target Flags.

Returns:
Float.

def __str__ ( self )


Sample Member List

This is the complete list of members for Sample, including all inherited members.

__init__ | Sample
__str__ | Sample
getButtons | Sample
getEye | Sample
getFlags | Sample
getHData | Sample
getInput | Sample
getLeftEye | Sample
getPPD | Sample
getRightEye | Sample
getStatus | Sample
getTargetDistance | Sample
getTargetFlags | Sample
getTargetX | Sample
getTargetY | Sample
getTime | Sample
getType | Sample
initFromSample | Sample
isBinocular | Sample
isLeftSample | Sample
isRightSample | Sample


pylink.SampleData

SampleData Class Reference

Sample data for left and right eye. More...

List of all members.

Public Member Functions

def | __init__
def | getGaze
Display gaze position (in pixel coordinates set by the screen_pixel_coords command).
def | getHREF
HREF angular coordinates.
def | getRawPupil
Camera x, y of pupil center.
def | getPupilSize
Pupil size (in arbitrary units, area or diameter as selected).
def | __str__

Detailed Description

Sample data for left and right eye.

The getRightEye() or getLeftEye() functions returns an instance of SampleData class, which contains the current sample position (raw, HREF, or gaze) and pupil size information of the desired eye. The following methods can be used to retrieve the attributes of an instance of the SampleData class.

For example, the x gaze position of the left eye for a given sample can be retrieved as:

    newSample = EYELINK.getFloatData()
    gaze = newSample. getLeftEye().getGaze()
    left_eye_gaze_x = gaze[0]

If certain property information not sent for this sample, the value MISSING_DATA (or 0, depending on the field) will be returned, and the corresponding bit in the flags field will be zero (see eye_data.h for a list of bits). Data may be missing because of the tracker configuration (set by commands sent at the start of the experiment, from the Set Options screen of the EyeLink II tracker, or from the default configuration set by the DATA.INI file for the EyeLink I tracker). Eye position data may also be set to MISSING_VALUE during a blink.

Member Function Documentation

def __init__ | ( | self,
 |  | px,
 |  | py,
 |  | hx,
 |  | hy,
 |  | pa,
 |  | gx,
 |  | gy
 | )

def getGaze ( self )

Display gaze position (in pixel coordinates set by the screen_pixel_coords command).

The first and second item of the tuple store the x- and y- coordinate gaze position respectively.

Returns:
Two-item tuple in the format of (float, float).

def getHREF ( self )

HREF angular coordinates.

The first and second items of the tuple are for the x and y coordinates, respectively.

Returns:
Two-item tuple in the format of (float, float).

def getRawPupil ( self )

Camera x, y of pupil center.

The first and second items of the tuple store pupil center in the x- and y- coordinate respectively.

Returns:
Two-item tuple in the format of (float, float).

def getPupilSize ( self )

Pupil size (in arbitrary units, area or diameter as selected).

Returns:
Float.

def __str__ ( self )


SampleData Member List

This is the complete list of members for SampleData, including all inherited members.

__init__ | SampleData
__str__ | SampleData
getGaze | SampleData
getHREF | SampleData
getPupilSize | SampleData
getRawPupil | SampleData


pylink.StartBlinkEvent

StartBlinkEvent Class Reference

Class to represent Start Blink event. More...

Inheritance diagram for StartBlinkEvent:

EyeEvent List of all members.

Public Member Functions

def __init__

Detailed Description

Class to represent Start Blink event.

There are no direct properties for this interface. All properties are inherited from EyeEvent.

Member Function Documentation

def __init__ | ( | self,
 |  | time,
 |  | type,
 |  | eye,
 |  | read,
 |  | sttime
 | )

Reimplemented from EyeEvent.


StartBlinkEvent Member List

This is the complete list of members for StartBlinkEvent, including all inherited members.

__init__ | StartBlinkEvent
getEye | EyeEvent
getRead | EyeEvent
getStartTime | EyeEvent
getStatus | EyeEvent
getTime | EyeEvent
getType | EyeEvent


pylink.StartFixationEvent

StartFixationEvent Class Reference

Class to represent Start Fixation event. More...

Inheritance diagram for StartFixationEvent:

StartNonBlinkEvent EyeEvent EndFixationEvent List of all members.

Public Member Functions

def | __init__
def | getStartPupilSize
Pupil size (in arbitrary units, area or diameter as selected) at the start of a fixation interval.

Detailed Description

Class to represent Start Fixation event.

This also inherits all properties from StartNonBlinkEvent.

Member Function Documentation

def __init__ | ( | self,
 |  | time,
 |  | type,
 |  | eye,
 |  | read,
 |  | sttime,
 |  | gstx,
 |  | gsty,
 |  | hstx,
 |  | hsty,
 |  | sta,
 |  | svel,
 |  | supd_x,
 |  | supd_y
 | )

def getStartPupilSize ( self )

Pupil size (in arbitrary units, area or diameter as selected) at the start of a fixation interval.

Returns:
Float.


StartFixationEvent Member List

This is the complete list of members for StartFixationEvent, including all inherited members.

__init__ | StartFixationEvent
pylink::StartNonBlinkEvent::__init__ | StartNonBlinkEvent
pylink::EyeEvent::__init__ | EyeEvent
getEye | EyeEvent
getRead | EyeEvent
getStartGaze | StartNonBlinkEvent
getStartHREF | StartNonBlinkEvent
getStartPPD | StartNonBlinkEvent
getStartPupilSize | StartFixationEvent
getStartTime | EyeEvent
getStartVelocity | StartNonBlinkEvent
getStatus | EyeEvent
getTime | EyeEvent
getType | EyeEvent


pylink.StartNonBlinkEvent

StartNonBlinkEvent Class Reference

This interface is never used as is. More...

Inheritance diagram for StartNonBlinkEvent:

EyeEvent FixUpdateEvent StartFixationEvent StartSaccadeEvent EndFixationEvent EndSaccadeEvent List of all members.

Public Member Functions

def | __init__
def | getStartGaze
Gaze position at the start of the event (in pixel coordinates set by the screen_pixel_coords command).
def | getStartHREF
HEADREF position at the start of the event.
def | getStartVelocity
Gaze velocity at the start of the event (in visual degrees per second).
def | getStartPPD
Angular resolution at the start of the event (in screen pixels per visual degree, PPD).

Detailed Description

This interface is never used as is.

FixUpdateEvent, StartFixationEvent and StartSaccadeEvent types inherit this. This also inherits all properties from EyeEvent.

Member Function Documentation

def __init__ | ( | self,
 |  | time,
 |  | type,
 |  | eye,
 |  | read,
 |  | sttime,
 |  | gstx,
 |  | gsty,
 |  | hstx,
 |  | hsty,
 |  | svel,
 |  | supd_x,
 |  | supd_y
 | )

Reimplemented in StartSaccadeEvent.

def getStartGaze ( self )

Gaze position at the start of the event (in pixel coordinates set by the screen_pixel_coords command).

The first and second items of the tuple store the x- and y- gaze position respectively.

Returns:
Two-item tuple in the format of (float, float).

def getStartHREF ( self )

HEADREF position at the start of the event.

The first and second items of the tuple store the x- and y- HREF data respectively.

Returns:
Two-item tuple in the format of (float, float).

def getStartVelocity ( self )

Gaze velocity at the start of the event (in visual degrees per second).

Returns:
Float.

def getStartPPD ( self )

Angular resolution at the start of the event (in screen pixels per visual degree, PPD).

The first item of the tuple stores the x-coordinate PPD resolution and the second item of the tuple stores the y-coordinate PPD resolution.

Returns:
Two-item tuple in the format of (float, float).


StartNonBlinkEvent Member List

This is the complete list of members for StartNonBlinkEvent, including all inherited members.

__init__ | StartNonBlinkEvent
pylink::EyeEvent::__init__ | EyeEvent
getEye | EyeEvent
getRead | EyeEvent
getStartGaze | StartNonBlinkEvent
getStartHREF | StartNonBlinkEvent
getStartPPD | StartNonBlinkEvent
getStartTime | EyeEvent
getStartVelocity | StartNonBlinkEvent
getStatus | EyeEvent
getTime | EyeEvent
getType | EyeEvent


pylink.StartSaccadeEvent

StartSaccadeEvent Class Reference

Class to represent Start Saccade event. More...

Inheritance diagram for StartSaccadeEvent:

StartNonBlinkEvent EyeEvent EndSaccadeEvent List of all members.

Public Member Functions

def __init__

Detailed Description

Class to represent Start Saccade event.

There are no direct properties for this interface. All properties are inherited from StartNonBlinkEvent.

Member Function Documentation

def __init__ | ( | self,
 |  | time,
 |  | type,
 |  | eye,
 |  | read,
 |  | sttime,
 |  | gstx,
 |  | gsty,
 |  | hstx,
 |  | hsty,
 |  | svel,
 |  | supd_x,
 |  | supd_y
 | )

Reimplemented from StartNonBlinkEvent.


StartSaccadeEvent Member List

This is the complete list of members for StartSaccadeEvent, including all inherited members.

__init__ | StartSaccadeEvent
pylink::EyeEvent::__init__ | EyeEvent
getEye | EyeEvent
getRead | EyeEvent
getStartGaze | StartNonBlinkEvent
getStartHREF | StartNonBlinkEvent
getStartPPD | StartNonBlinkEvent
getStartTime | EyeEvent
getStartVelocity | StartNonBlinkEvent
getStatus | EyeEvent
getTime | EyeEvent
getType | EyeEvent


PyLink Related Pages

Here is a list of all related documentation pages:
  • Example implementation of EyeLinkCustomDisplay
  • Deprecated List


Deprecated List

Member pylink::EyeLinkCBind.getImageCrossHairData
This function is deprecated. Use lib.tracker.EyeLinkCustomDisplay.draw_cross_hair()


Example implementation of EyeLinkCustomDisplay

import pygame
import pygame.mixer
import pygame.event
import pygame.image
import pygame.draw
import pygame.mouse
import array

import Image
import pylink
from pygame.constants import *

class EyeLinkCoreGraphicsPyGame(pylink.EyeLinkCustomDisplay):
    def __init__(self,w,h, tracker):
        pylink.EyeLinkCustomDisplay.__init__(self)
        pygame.init()
        pygame.display.init()
        pygame.mixer.init()
        pygame.display.set_mode((w, h), FULLSCREEN |DOUBLEBUF |RLEACCEL,32)
        pygame.mouse.set_visible(False)
        self.__target_beep__ = pygame.mixer.Sound("type.wav")
        self.__target_beep__done__ = pygame.mixer.Sound("qbeep.wav")
        self.__target_beep__error__ = pygame.mixer.Sound("error.wav")
        self.imagebuffer = array.array('l')
        self.pal = None
        self.size = (0,0)
        if(not pygame.font.get_init()):
            pygame.font.init()
        self.fnt = pygame.font.Font("cour.ttf",25)
        self.fnt.set_bold(1)
        self.setTracker(tracker)
        self.last_mouse_state = -1

    def setTracker(self, tracker):
        self.tracker = tracker
        self.tracker_version = tracker.getTrackerVersion()
        if(self.tracker_version >=3):
            self.tracker.sendCommand("enable_search_limits=YES")
            self.tracker.sendCommand("track_search_limits=YES")
            self.tracker.sendCommand("autothreshold_click=YES")
            self.tracker.sendCommand("autothreshold_repeat=YES")
            self.tracker.sendCommand("enable_camera_position_detect=YES")

    def setup_cal_display (self):
        surf = pygame.display.get_surface()
        surf.fill((255,255,255,255))
        pygame.display.flip()

    def exit_cal_display(self):
        self.clear_cal_display()

    def record_abort_hide(self):
        pass

    def clear_cal_display(self):
        surf = pygame.display.get_surface()
        surf.fill((255,255,255,255))
        pygame.display.flip()
        surf.fill((255,255,255,255))

    def erase_cal_target(self):
        surf = pygame.display.get_surface()
        surf.fill((255,255,255,255))

    def draw_cal_target(self, x, y):
        outsz=10
        insz=4
        surf = pygame.display.get_surface()
        rect = pygame.Rect(x-outsz,y-outsz,outsz*2,outsz*2)
        pygame.draw.ellipse(surf,(0,0,0), rect)
        rect = pygame.Rect(x-insz,y-insz,insz*2,insz*2)
        pygame.draw.ellipse(surf,(255,255,255), rect)
        pygame.display.flip()

    def play_beep(self,beepid):
        if beepid == pylink.DC_TARG_BEEP or beepid == pylink.CAL_TARG_BEEP:
            self.__target_beep__.play()
        elif beepid == pylink.CAL_ERR_BEEP or beepid == pylink.DC_ERR_BEEP:
            self.__target_beep__error__.play()
        else:#  CAL_GOOD_BEEP or DC_GOOD_BEEP
            self.__target_beep__done__.play()

    def draw_line(self,x1,y1,x2,y2,colorindex):
        imr = self.__img__.get_rect()
        x1=int((float(x1)/float(self.size[0]))*imr.w)
        x2=int((float(x2)/float(self.size[0]))*imr.w)
        y1=int((float(y1)/float(self.size[1]))*imr.h)
        y2=int((float(y2)/float(self.size[1]))*imr.h)

        if colorindex   ==  pylink.CR_HAIR_COLOR:          color = (255,255,255,255)
        elif colorindex ==  pylink.PUPIL_HAIR_COLOR:       color = (255,255,255,255)
        elif colorindex ==  pylink.PUPIL_BOX_COLOR:        color = (0,255,0,255)
        elif colorindex ==  pylink.SEARCH_LIMIT_BOX_COLOR: color = (255,0,0,255)
        elif colorindex ==  pylink.MOUSE_CURSOR_COLOR:     color = (255,0,0,255)
        else: color =(0,0,0,0)
        pygame.draw.line(self.__img__,color,(x1,y1),(x2,y2))

    def get_input_key(self):
        ky=[]
        v = pygame.event.get()
        for key in v:
            if key.type != KEYDOWN:
                continue
            keycode = key.key
            if keycode == K_F1:  keycode = pylink.F1_KEY
            elif keycode ==  K_F2:  keycode = pylink.F2_KEY
            elif keycode ==   K_F3:  keycode = pylink.F3_KEY
            elif keycode ==   K_F4:  keycode = pylink.F4_KEY
            elif keycode ==   K_F5:  keycode = pylink.F5_KEY
            elif keycode ==   K_F6:  keycode = pylink.F6_KEY
            elif keycode ==   K_F7:  keycode = pylink.F7_KEY
            elif keycode ==   K_F8:  keycode = pylink.F8_KEY
            elif keycode ==   K_F9:  keycode = pylink.F9_KEY
            elif keycode ==   K_F10: keycode = pylink.F10_KEY

            elif keycode ==   K_PAGEUP: keycode = pylink.PAGE_UP
            elif keycode ==   K_PAGEDOWN:  keycode = pylink.PAGE_DOWN
            elif keycode ==   K_UP:    keycode = pylink.CURS_UP
            elif keycode ==   K_DOWN:  keycode = pylink.CURS_DOWN
            elif keycode ==   K_LEFT:  keycode = pylink.CURS_LEFT
            elif keycode ==   K_RIGHT: keycode = pylink.CURS_RIGHT

            elif keycode ==   K_BACKSPACE:    keycode = ord('\b')
            elif keycode ==   K_RETURN:  keycode = pylink.ENTER_KEY
            elif keycode ==   K_ESCAPE:  keycode = pylink.ESC_KEY
            elif keycode ==   K_TAB:     keycode = ord('\t')
            elif(keycode==pylink.JUNK_KEY): keycode= 0
            ky.append(KeyInput(keycode))
        return ky

    def exit_image_display(self):
        self.clear_cal_display()

    def alert_printf(self,msg):
        print "alert_printf"

    def setup_image_display(self, width, height):
        self.size = (width,height)
        self.clear_cal_display()
        self.last_mouse_state = -1

    def image_title(self, threshold, text):
        text = text + " " +str(threshold)

        sz = self.fnt.size(text[0])
        txt = self.fnt.render(text,len(text),(0,0,0,255), (255,255,255,255))
        surf = pygame.display.get_surface()
        imgsz=(self.size[0]*3,self.size[1]*3)
        topleft = ((surf.get_rect().w-imgsz[0])/2,(surf.get_rect().h-imgsz[1])/2)
        imsz=(topleft[0]+imgsz[0]/2,topleft[1]+imgsz[1]+10)
        surf.blit(txt, imsz)
        pygame.display.flip()
        surf.blit(txt, imsz)

    def draw_image_line(self, width, line, totlines,buff):
        #print "draw_image_line", len(buff)
        i =0
        while i <width:
            self.imagebuffer.append(self.pal[buff[i]])
            i= i+1

        if line == totlines:
            imgsz = (self.size[0]*3,self.size[1]*3)
            bufferv = self.imagebuffer.tostring()
            img =Image.new("RGBX",self.size)
            img.fromstring(bufferv)
            img = img.resize(imgsz)

            img = pygame.image.fromstring(img.tostring(),imgsz,"RGBX");

            self.__img__ = img
            self.draw_cross_hair()
            self.__img__ = None
            surf = pygame.display.get_surface()
            surf.blit(img,((surf.get_rect().w-imgsz[0])/2,(surf.get_rect().h-imgsz[1])/2))
            pygame.display.flip()
            self.imagebuffer = array.array('l')

    def set_image_palette(self, r,g,b):
        self.imagebuffer = array.array('l')
        self.clear_cal_display()
        sz = len(r)
        i =0
        self.pal = []
        while i < sz:
            rf = int(b[i])
            gf = int(g[i])
            bf = int(r[i])
            self.pal.append((rf<<16) | (gf<<8) | (bf))
            i = i+1


eyelinkmodule.c File Reference

Defines

#define | bitmapSaveAndBackdrop_doc
#define | bitmapSave_doc
#define | bitmapBackdrop_doc
#define | eyelink_calculate_velocity_doc "calculates velocity from queue of samples"
#define | eyelink_calculate_velocity_x_y_doc "calculates velocity from queue of samples. The value is x,y are separate"
#define | eyelink_calculate_overallvelocity_and_acceleration_doc "calculates velocity and acceleration from queue of samples"
#define | PyVarObject_HEAD_INIT(type, size) PyObject_HEAD_INIT(type) size,
#define | PYGAMEAPI_LOCAL_ENTRY "_PYGAME_C_API"
#define | PyInit_pylink initpylink
#define | PyInit_sdlmain_osx initsdlmain_osx
#define | Py_TYPE(ob) (((PyObject*)(ob))->ob_type)
#define | PyCapsule_New(pointer, name, destructor) (PyCObject_FromVoidPtr(pointer, destructor))
#define | TEXTVALUE(x, y) PyString_AsString(PyObject_GetAttrString(x,y)
#define | RETURNERROR(rv, x)

Functions

INT32 | eyelink_in_realtime_mode (void)
GENERICFCNPROTO (eyemsg_printf)
GENERICFCNPROTO (timemsg_printf)
DOUBLEVOIDFCN (double_usec_offset)
DOUBLEVOIDFCN (tracker_double_usec)
DOUBLEVOIDFCN (msec_offset)
DOUBLEVOIDFCN (tracker_msec)
GENERICFCNPROTO (set_name)
GENERICFCNPROTO (node_send)
GENERICFCNPROTO (timed_command)
GENERICFCNPROTO (timed_commandEx)
GENERICFCNPROTO (node_send_message)
GENERICFCNPROTO (node_request_time)
GENERICFCNPROTO (open)
GENERICFCNPROTO (get_node)
GENERICFCNPROTO (node_receive)
GENERICFCNPROTO (open_node)
GENERICFCNPROTO (last_button_press)
GENERICFCNPROTO (target_check)
GENERICFCNPROTO (mode_data)
GENERICFCNPROTO (read_keybutton)
GENERICFCNPROTO (receiveDataFile)
GENERICFCNPROTO (sendDataFile)
GENERICFCNPROTO (map_eyelink_py_draw_cal_target_hook)
GENERICFCNPROTO (eyelink_last_button_states)
GENERICFCNPROTO (set_calibration_colors)
GENERICFCNPROTO (set_target_size)
GENERICFCNPROTO (set_cal_sounds)
GENERICFCNPROTO (set_dcorr_sounds)
GENERICFCNPROTO (set_camera_image_position)
GENERICFCNPROTO (get_display_information)
GENERICFCNPROTO (init_expt_graphics)
GENERICFCNPROTO (close_expt_graphics)
GENERICFCNPROTO (get_image_xhair_data)
GENERICFCNPROTO (setCalibrationAnimationTarget)
GENERICFCNPROTO (enableExternalCalibrationDevice)
GENERICFCNPROTO (data_status)
VOIDUINT32FCN (pump_delay)
VOIDUINT32FCN (begin_realtime_mode)
VOIDUINT32FCN (msec_delay)
VOIDUINT16FCN (terminal_break)
VOIDSTR2FCN (alert_printf)
GENERICFCNPROTO (bitmapSaveAndBackdrop)
GENERICFCNPROTO (bitmapSave)
GENERICFCNPROTO (bitmapBackdrop)
GENERICFCNPROTO (eyelink_calculate_velocity)
GENERICFCNPROTO (eyelink_calculate_velocity_x_y)
GENERICFCNPROTO (eyelink_calculate_overallvelocity_and_acceleration)
PyObject * | eyelink_eyelink_init_custom_graphics (PyObject *self, PyObject *args)
PyObject * | eyelink_eyelink_request_cross_hair_draw (PyObject *self, PyObject *args)
void | getTrackerModule ()
PyMODINIT_FUNC | PyInit_sdlmain_osx (void)
PyMODINIT_FUNC | PyInit_pylink (void)
INT16 ELCALLTYPE | text_to_elinkaddr (char *addr, ELINKADDR node, int remote)
void | printELINKADDR (ELINKADDR addr)
void * | toELINKADDR (PyObject *addr, ELINKADDR node)
GENERICFCNPROTO (open_eyelink_system)
int | isCustomGraphicsActive ()
void ELCALLBACK | eyelink_py_draw_cal_target_hook (INT16 x, INT16 y)
void | setup_remap_hooks (PyObject *self)
int ELCALLBACK | _checkKeys (CCDBS *ccdbs)

Define Documentation

#define bitmapSaveAndBackdrop_doc

Value:

"bitmapSaveAndBackdrop(iwidth,iheight,pixels,xs, ys, width,  height,fname,path, sv_options,xd,yd,  xferoptions)"\
"iwidth  - original image width"\
"iheight - original image height"\
"pixels  - Pixels of the image in one of two possible formats: "\
"       pixel=[line1, line2, ... linen] line=[pix1,pix2,...,pixn],pix=(r,g,b)."\
"       pixel=[line1, line2, ... linen] line=[pix1,pix2,...,pixn],pix=0xAARRGGBB."\
"xs - crop x position"\
"ys - crop y position"\
"width - crop width"\
"height - crop height"\
"fname - file name to save"\
"path -  path to save"\
"svoptions - save options(SV_NOREPLACE,SV_MAKEPATH)"\
"xd - xposition - transfer"\
"yd - yposition - transfer"\
"xferoptions - transfer options(BX_AVERAGE,BX_DARKEN,BX_LIGHTEN,BX_MAXCONTRAST,BX_NODITHER,BX_GRAYSCALE)"

#define bitmapSave_doc

Value:

"bitmapSave(iwidth,iheight,pixels,xs, ys, width,  height,fname,path, sv_options)"\
"iwidth  - original image width"\
"iheight - original image height"\
"pixels  - Pixels of the image in one of two possible formats: "\
"       pixel=[line1, line2, ... linen] line=[pix1,pix2,...,pixn],pix=(r,g,b)."\
"       pixel=[line1, line2, ... linen] line=[pix1,pix2,...,pixn],pix=0xAARRGGBB."\
"xs - crop x position"\
"ys - crop y position"\
"width - crop width"\
"height - crop height"\
"fname - file name to save"\
"path -  path to save"\
"svoptions - save options(SV_NOREPLACE,SV_MAKEPATH)"

#define bitmapBackdrop_doc

Value:

"bitmapBackdrop(iwidth,iheight,pixels,xs, ys, width,  height,xd,yd,  xferoptions)"\
"iwidth  - original image width"\
"iheight - original image height"\
"pixels  - Pixels of the image in one of two possible formats: "\
"       pixel=[line1, line2, ... linen] line=[pix1,pix2,...,pixn],pix=(r,g,b)."\
"       pixel=[line1, line2, ... linen] line=[pix1,pix2,...,pixn],pix=0xAARRGGBB."\
"xs - crop x position"\
"ys - crop y position"\
"width - crop width"\
"height - crop height"\
"xd - xposition - transfer"\
"yd - yposition - transfer"\
"xferoptions - transfer options(BX_AVERAGE,BX_DARKEN,BX_LIGHTEN,BX_MAXCONTRAST,BX_NODITHER,BX_GRAYSCALE)"

#define eyelink_calculate_velocity_doc "calculates velocity from queue of samples"

#define eyelink_calculate_velocity_x_y_doc "calculates velocity from queue of samples. The value is x,y are separate"

#define eyelink_calculate_overallvelocity_and_acceleration_doc "calculates velocity and acceleration from queue of samples"

#define PyVarObject_HEAD_INIT | ( | type,
 |  | size | ) | PyObject_HEAD_INIT(type) size,

#define PYGAMEAPI_LOCAL_ENTRY "_PYGAME_C_API"

#define PyInit_pylink initpylink

#define PyInit_sdlmain_osx initsdlmain_osx

#define Py_TYPE ( ob ) (((PyObject*)(ob))->ob_type)

#define PyCapsule_New | ( | pointer,
 |  | name,
 |  | destructor | ) | (PyCObject_FromVoidPtr(pointer, destructor))

#define TEXTVALUE | ( | x,
 |  | y | ) | PyString_AsString(PyObject_GetAttrString(x,y)

#define RETURNERROR | ( | rv,
 |  | x | )

Value:

{\
    char *rvm = eyelink_get_error(rv, #x);\
        if(!rvm || !strlen(rvm))\
            return Py_BuildValue("i",rv);\
        else \
            RETURNEXCEPTION(rv, "%s", rvm);\
    }

Function Documentation

INT32 eyelink_in_realtime_mode ( void )

GENERICFCNPROTO ( eyemsg_printf )

GENERICFCNPROTO ( timemsg_printf )

DOUBLEVOIDFCN ( double_usec_offset )

DOUBLEVOIDFCN ( tracker_double_usec )

DOUBLEVOIDFCN ( msec_offset )

DOUBLEVOIDFCN ( tracker_msec )

GENERICFCNPROTO ( set_name )

GENERICFCNPROTO ( node_send )

GENERICFCNPROTO ( timed_command )

GENERICFCNPROTO ( timed_commandEx )

GENERICFCNPROTO ( node_send_message )

GENERICFCNPROTO ( node_request_time )

GENERICFCNPROTO ( open )

GENERICFCNPROTO ( get_node )

GENERICFCNPROTO ( node_receive )

GENERICFCNPROTO ( open_node )

GENERICFCNPROTO ( last_button_press )

GENERICFCNPROTO ( target_check )

GENERICFCNPROTO ( mode_data )

GENERICFCNPROTO ( read_keybutton )

GENERICFCNPROTO ( receiveDataFile )

GENERICFCNPROTO ( sendDataFile )

GENERICFCNPROTO ( map_eyelink_py_draw_cal_target_hook )

GENERICFCNPROTO ( eyelink_last_button_states )

GENERICFCNPROTO ( set_calibration_colors )

GENERICFCNPROTO ( set_target_size )

GENERICFCNPROTO ( set_cal_sounds )

GENERICFCNPROTO ( set_dcorr_sounds )

GENERICFCNPROTO ( set_camera_image_position )

GENERICFCNPROTO ( get_display_information )

GENERICFCNPROTO ( init_expt_graphics )

GENERICFCNPROTO ( close_expt_graphics )

GENERICFCNPROTO ( get_image_xhair_data )

GENERICFCNPROTO ( setCalibrationAnimationTarget )

GENERICFCNPROTO ( enableExternalCalibrationDevice )

GENERICFCNPROTO ( data_status )

VOIDUINT32FCN ( pump_delay )

VOIDUINT32FCN ( begin_realtime_mode )

VOIDUINT32FCN ( msec_delay )

VOIDUINT16FCN ( terminal_break )

VOIDSTR2FCN ( alert_printf )

GENERICFCNPROTO ( bitmapSaveAndBackdrop )

GENERICFCNPROTO ( bitmapSave )

GENERICFCNPROTO ( bitmapBackdrop )

GENERICFCNPROTO ( eyelink_calculate_velocity )

GENERICFCNPROTO ( eyelink_calculate_velocity_x_y )

GENERICFCNPROTO ( eyelink_calculate_overallvelocity_and_acceleration )

PyObject* eyelink_eyelink_init_custom_graphics | ( | PyObject * | self,
 |  | PyObject * | args
 | ) |

PyObject* eyelink_eyelink_request_cross_hair_draw | ( | PyObject * | self,
 |  | PyObject * | args
 | ) |

void getTrackerModule ( )

PyMODINIT_FUNC PyInit_sdlmain_osx ( void )

PyMODINIT_FUNC PyInit_pylink ( void )

INT16 ELCALLTYPE text_to_elinkaddr | ( | char * | addr,
 |  | ELINKADDR | node,
 |  | int | remote
 | ) |

void printELINKADDR ( ELINKADDR addr )

void* toELINKADDR | ( | PyObject * | addr,
 |  | ELINKADDR | node
 | ) |

GENERICFCNPROTO ( open_eyelink_system )

int isCustomGraphicsActive ( )

void ELCALLBACK eyelink_py_draw_cal_target_hook | ( | INT16 | x,
 |  | INT16 | y
 | ) |

void setup_remap_hooks ( PyObject * self )

int ELCALLBACK _checkKeys ( CCDBS * ccdbs )


PyLink File List

Here is a list of all files with brief descriptions:
eyelinkmodule.c
pylink.py
PylinkDoc.h


  • All
  • Functions
  • Variables
  • _
  • a
  • b
  • c
  • d
  • e
  • f
  • g
  • h
  • i
  • k
  • m
  • n
  • o
  • p
  • q
  • r
  • s
  • t
  • u
  • w

Here is a list of all class members with links to the classes they belong to:

- _ -

  • __init__() : EyeLinkCustomDisplay, KeyInput, ILinkData, DisplayInfo, ButtonEvent, IOEvent, MessageEvent, FixUpdateEvent, EndFixationEvent, EndSaccadeEvent, EndNonBlinkEvent, EndBlinkEvent, StartFixationEvent, StartSaccadeEvent, StartNonBlinkEvent, StartBlinkEvent, EyeEvent, Sample, SampleData, EyelinkMessage, EyeLinkAddress, EyeLink, EyeLinkListener
  • __str__() : ButtonEvent, IOEvent, FixUpdateEvent, Sample, SampleData, EyelinkMessage, EyeLinkAddress
  • __updateimgsize__() : EyeLinkCustomDisplay


  • All
  • Functions
  • Variables
  • _
  • a
  • b
  • c
  • d
  • e
  • f
  • g
  • h
  • i
  • k
  • m
  • n
  • o
  • p
  • q
  • r
  • s
  • t
  • u
  • w

Here is a list of all class members with links to the classes they belong to:

- k -

  • key_message_pump() : EyeLinkCBind


  • All
  • Functions
  • Variables
  • _
  • a
  • b
  • c
  • d
  • e
  • f
  • g
  • h
  • i
  • k
  • m
  • n
  • o
  • p
  • q
  • r
  • s
  • t
  • u
  • w

Here is a list of all class members with links to the classes they belong to:

- m -

  • markPlayBackStart() : EyeLink
  • msg : EyelinkMessage


  • All
  • Functions
  • Variables
  • _
  • a
  • b
  • c
  • d
  • e
  • f
  • g
  • h
  • i
  • k
  • m
  • n
  • o
  • p
  • q
  • r
  • s
  • t
  • u
  • w

Here is a list of all class members with links to the classes they belong to:

- n -

  • nodeReceive() : EyeLinkCBind
  • nodeRequestTime() : EyeLinkCBind
  • nodeSend() : EyeLinkCBind
  • nodeSendMessage() : EyeLinkCBind


  • All
  • Functions
  • Variables
  • _
  • a
  • b
  • c
  • d
  • e
  • f
  • g
  • h
  • i
  • k
  • m
  • n
  • o
  • p
  • q
  • r
  • s
  • t
  • u
  • w

Here is a list of all class members with links to the classes they belong to:

- o -

  • open() : EyeLinkCBind
  • openDataFile() : EyeLinkCBind
  • openNode() : EyeLinkCBind


  • All
  • Functions
  • Variables
  • _
  • a
  • b
  • c
  • d
  • e
  • f
  • g
  • h
  • i
  • k
  • m
  • n
  • o
  • p
  • q
  • r
  • s
  • t
  • u
  • w

Here is a list of all class members with links to the classes they belong to:

- a -

  • abort() : EyeLinkCBind
  • acceptTrigger() : EyeLinkCBind
  • alert_printf() : EyeLinkCustomDisplay
  • applyDriftCorrect() : EyeLinkCBind


  • All
  • Functions
  • Variables
  • _
  • a
  • b
  • c
  • d
  • e
  • f
  • g
  • h
  • i
  • k
  • m
  • n
  • o
  • p
  • q
  • r
  • s
  • t
  • u
  • w

Here is a list of all class members with links to the classes they belong to:

- b -

  • bitmapBackdrop() : EyeLinkCBind
  • bitmapSaveAndBackdrop() : EyeLinkCBind
  • bits : DisplayInfo
  • breakPressed() : EyeLinkCBind
  • broadcastOpen() : EyeLinkCBind


  • All
  • Functions
  • Variables
  • _
  • a
  • b
  • c
  • d
  • e
  • f
  • g
  • h
  • i
  • k
  • m
  • n
  • o
  • p
  • q
  • r
  • s
  • t
  • u
  • w

Here is a list of all class members with links to the classes they belong to:

- c -

  • calculateOverallVelocityAndAcceleration() : EyeLinkCBind
  • calculateVelocity() : EyeLinkCBind
  • calculateVelocityXY() : EyeLinkCBind
  • clear_cal_display() : EyeLinkCustomDisplay
  • clearScreen() : EyeLink
  • close() : EyeLinkCBind
  • closeDataFile() : EyeLinkCBind
  • commandResult() : EyeLinkCBind


  • All
  • Functions
  • Variables
  • _
  • a
  • b
  • c
  • d
  • e
  • f
  • g
  • h
  • i
  • k
  • m
  • n
  • o
  • p
  • q
  • r
  • s
  • t
  • u
  • w

Here is a list of all class members with links to the classes they belong to:

- d -

  • dataSwitch() : EyeLinkCBind
  • disableAutoCalibration() : EyeLink
  • doDriftCorrect() : EyeLinkCBind
  • doTrackerSetup() : EyeLink, EyeLinkCBind
  • draw_cal_target() : EyeLinkCustomDisplay
  • draw_cross_hair() : EyeLinkCustomDisplay
  • draw_image_line() : EyeLinkCustomDisplay
  • draw_line() : EyeLinkCustomDisplay
  • draw_lozenge() : EyeLinkCustomDisplay
  • drawBox() : EyeLink
  • drawCalTarget() : EyeLinkListener
  • drawCross() : EyeLink
  • drawFilledBox() : EyeLink
  • drawLine() : EyeLink
  • drawText() : EyeLink
  • dummy_open() : EyeLinkCBind


  • All
  • Functions
  • Variables
  • _
  • a
  • b
  • c
  • d
  • e
  • f
  • g
  • h
  • i
  • k
  • m
  • n
  • o
  • p
  • q
  • r
  • s
  • t
  • u
  • w

Here is a list of all class members with links to the classes they belong to:

- e -

  • echo() : EyeLink
  • echo_key() : EyeLinkCBind
  • enableAutoCalibration() : EyeLink
  • erase_cal_target() : EyeLinkCustomDisplay
  • escapePressed() : EyeLinkCBind
  • exit_cal_display() : EyeLinkCustomDisplay
  • exit_image_display() : EyeLinkCustomDisplay
  • exitCalibration() : EyeLinkCBind
  • eyeAvailable() : EyeLinkCBind


  • All
  • Functions
  • Variables
  • _
  • a
  • b
  • c
  • d
  • e
  • f
  • g
  • h
  • i
  • k
  • m
  • n
  • o
  • p
  • q
  • r
  • s
  • t
  • u
  • w

Here is a list of all class members with links to the classes they belong to:

- f -

  • flushKeybuttons() : EyeLinkCBind


  • All
  • Functions
  • Variables
  • _
  • a
  • b
  • c
  • d
  • e
  • f
  • g
  • h
  • i
  • k
  • m
  • n
  • o
  • p
  • q
  • r
  • s
  • t
  • u
  • w

Here is a list of all class members with links to the classes they belong to:

- g -

  • get_input_key() : EyeLinkCustomDisplay
  • get_mouse_state() : EyeLinkCustomDisplay
  • getAddress() : ILinkData
  • getAmplitude() : EndSaccadeEvent
  • getAngle() : EndSaccadeEvent
  • getAverageGaze() : FixUpdateEvent, EndFixationEvent
  • getAverageHREF() : FixUpdateEvent, EndFixationEvent
  • getAveragePupilSize() : FixUpdateEvent, EndFixationEvent
  • getAverageVelocity() : EndNonBlinkEvent
  • getBlockNumber() : ILinkData
  • getButtons() : ButtonEvent, Sample
  • getButtonStates() : EyeLinkCBind
  • getCalibrationMessage() : EyeLinkCBind
  • getCalibrationResult() : EyeLinkCBind
  • getCRMode() : EyeLinkListener
  • getCurrentMode() : EyeLinkCBind
  • getCurrentTime() : EyeLinkListener
  • getData() : IOEvent
  • getDataCount() : EyeLinkCBind
  • getDummyMode() : EyeLink
  • getEndGaze() : EndNonBlinkEvent
  • getEndHREF() : EndNonBlinkEvent
  • getEndPPD() : EndNonBlinkEvent
  • getEndPupilSize() : FixUpdateEvent, EndFixationEvent
  • getEndTime() : EndNonBlinkEvent, EndBlinkEvent
  • getEndVelocity() : EndNonBlinkEvent
  • getEventDataFlags() : ILinkData, EyeLinkCBind
  • getEventQueueLength() : ILinkData
  • getEventsInBlock() : ILinkData
  • getEventTypeFlags() : ILinkData, EyeLinkCBind
  • getEye() : EyeEvent, Sample
  • getEyeUsed() : EyeLinkListener
  • getFileFilter() : EyeLinkListener
  • getFixationUpdateAccumulate() : EyeLink
  • getFixationUpdateInterval() : EyeLink
  • getFlags() : Sample
  • getFloatData() : EyeLinkCBind
  • getFreeQueueLength() : ILinkData
  • getGaze() : SampleData
  • getHData() : Sample
  • getHeadDistencePrescaler() : ILinkData
  • getHREF() : SampleData
  • getImageCrossHairData() : EyeLinkCBind
  • getInput() : Sample
  • getIP() : EyeLinkAddress
  • getkey() : EyeLinkCBind
  • getkeyEx() : EyeLinkCBind
  • getLastBufferSize() : ILinkData
  • getLastBufferType() : ILinkData
  • getLastButtonPress() : EyeLinkCBind
  • getLastButtonStates() : EyeLinkCBind
  • getLastData() : EyeLinkCBind
  • getLastItem() : ILinkData
  • getLastItemContent() : ILinkData
  • getLastItemStatus() : ILinkData
  • getLastItemTimeStamp() : ILinkData
  • getLastItemType() : ILinkData
  • getLastMessage() : EyeLinkCBind
  • getLastPupil() : ILinkData
  • getLastReceiveTime() : ILinkData
  • getLastResX() : ILinkData
  • getLastResY() : ILinkData
  • getLeftEye() : Sample
  • getLinkFilter() : EyeLinkListener
  • getLinkFlags() : ILinkData
  • getLostDataTypes() : ILinkData
  • getModeData() : EyeLinkCBind
  • getName() : ILinkData
  • getNewestSample() : EyeLinkCBind
  • getNextData() : EyeLinkCBind
  • getNode() : EyeLinkCBind
  • getNodes() : ILinkData
  • getPacketFlags() : ILinkData
  • getPeakVelocity() : EndNonBlinkEvent
  • getPendingCommands() : ILinkData
  • getPoolResponse() : ILinkData
  • getPort() : EyeLinkAddress
  • getPositionScalar() : EyeLinkCBind
  • getPPD() : Sample
  • getPrescaler() : ILinkData
  • getPupilPrescaler() : ILinkData
  • getPupilSize() : SampleData
  • getQueueSize() : ILinkData
  • getRawPupil() : SampleData
  • getRead() : EyeEvent
  • getRecordingStatus() : EyeLinkCBind
  • getRemoteBroadcastAddress() : ILinkData
  • getReserved() : ILinkData
  • getRightEye() : Sample
  • getSample() : EyeLinkCBind
  • getSampleDataFlags() : ILinkData, EyeLinkCBind
  • getSampleDivisor() : ILinkData
  • getSampleQueueLength() : ILinkData
  • getSampleRate() : ILinkData, EyeLinkListener
  • getSamplesInBlock() : ILinkData
  • getSampleSizeForVelAndAcceleration() : EyeLink
  • getStartGaze() : StartNonBlinkEvent
  • getStartHREF() : StartNonBlinkEvent
  • getStartPPD() : StartNonBlinkEvent
  • getStartPupilSize() : FixUpdateEvent, StartFixationEvent
  • getStartTime() : EyeEvent
  • getStartVelocity() : StartNonBlinkEvent
  • getStateFlags() : ILinkData
  • getStates() : ButtonEvent
  • getStatus() : EyeEvent, Sample
  • getTargetDistance() : Sample
  • getTargetFlags() : Sample
  • getTargetPositionAndState() : EyeLinkCBind
  • getTargetX() : Sample
  • getTargetY() : Sample
  • getText() : MessageEvent, EyelinkMessage
  • getTime() : ILinkData, IOEvent, MessageEvent, EyeEvent, Sample
  • getTrackerAddress() : ILinkData, EyeLink
  • getTrackerBroadcastAddress() : ILinkData
  • getTrackerDataOutputState() : ILinkData
  • getTrackerInfo() : EyeLinkListener
  • getTrackerMode() : EyeLinkCBind
  • getTrackerName() : ILinkData
  • getTrackerVersion() : EyeLinkCBind
  • getTrackerVersionString() : EyeLinkCBind
  • getType() : IOEvent, MessageEvent, EyeEvent, Sample
  • getVelocityAccelerationModel() : EyeLink
  • getVelocityPrescaler() : ILinkData


  • All
  • Functions
  • Variables
  • _
  • a
  • b
  • c
  • d
  • e
  • f
  • g
  • h
  • i
  • k
  • m
  • n
  • o
  • p
  • q
  • r
  • s
  • t
  • u
  • w

Here is a list of all class members with links to the classes they belong to:

- h -

  • haveLeftEye() : ILinkData
  • haveRightEye() : ILinkData
  • height : DisplayInfo


  • All
  • Functions
  • Variables
  • _
  • a
  • b
  • c
  • d
  • e
  • f
  • g
  • h
  • i
  • k
  • m
  • n
  • o
  • p
  • q
  • r
  • s
  • t
  • u
  • w

Here is a list of all class members with links to the classes they belong to:

- i -

  • image_title() : EyeLinkCustomDisplay
  • imageModeDisplay() : EyeLinkCBind
  • initFromSample() : Sample
  • inSetup() : EyeLinkCBind
  • ip : EyeLinkAddress
  • isBinocular() : Sample
  • isConnected() : EyeLinkCBind
  • isControlEvent() : ILinkData
  • isEventsEnabled() : ILinkData
  • isInBlockWithEvents() : ILinkData
  • isInBlockWithSamples() : ILinkData
  • isInDataBlock() : EyeLinkCBind
  • isLeftSample() : Sample
  • isNewBlock() : ILinkData
  • isPoolingRemote() : ILinkData
  • isRecording() : EyeLinkCBind
  • isRightSample() : Sample
  • isSamplesEnabled() : ILinkData


  • All
  • Functions
  • Variables
  • _
  • a
  • b
  • c
  • d
  • e
  • f
  • g
  • h
  • i
  • k
  • m
  • n
  • o
  • p
  • q
  • r
  • s
  • t
  • u
  • w

Here is a list of all class members with links to the classes they belong to:

- p -

  • play_beep() : EyeLinkCustomDisplay
  • pollRemotes() : EyeLinkCBind
  • pollResponses() : EyeLinkCBind
  • pollTrackers() : EyeLinkCBind
  • port : EyeLinkAddress
  • progressSendDataUpdate() : EyeLink
  • progressUpdate() : EyeLink
  • pumpMessages() : EyeLinkCBind


  • All
  • Functions
  • Variables
  • _
  • a
  • b
  • c
  • d
  • e
  • f
  • g
  • h
  • i
  • k
  • m
  • n
  • o
  • p
  • q
  • r
  • s
  • t
  • u
  • w

Here is a list of all class members with links to the classes they belong to:

- q -

  • quietMode() : EyeLinkCBind


  • All
  • Functions
  • Variables
  • _
  • a
  • b
  • c
  • d
  • e
  • f
  • g
  • h
  • i
  • k
  • m
  • n
  • o
  • p
  • q
  • r
  • s
  • t
  • u
  • w

Here is a list of all class members with links to the classes they belong to:

- r -

  • readIOPort() : EyeLink
  • readKeyButton() : EyeLinkCBind
  • readKeyQueue() : EyeLinkCBind
  • readReply() : EyeLinkCBind
  • readRequest() : EyeLinkCBind
  • readTime() : EyeLinkCBind
  • receiveDataFile() : EyeLinkCBind
  • record_abort_hide() : EyeLinkCustomDisplay
  • refresh : DisplayInfo
  • requestTime() : EyeLinkCBind
  • reset() : EyeLinkCBind
  • resetData() : EyeLinkCBind


  • All
  • Functions
  • Variables
  • _
  • a
  • b
  • c
  • d
  • e
  • f
  • g
  • h
  • i
  • k
  • m
  • n
  • o
  • p
  • q
  • r
  • s
  • t
  • u
  • w

Here is a list of all class members with links to the classes they belong to:

- s -

  • sendCommand() : EyeLinkCBind
  • sendDataFile() : EyeLinkCBind
  • sendKeybutton() : EyeLinkCBind
  • sendMessage() : EyeLinkListener, EyeLinkCBind
  • sendTimedCommand() : EyeLinkCBind
  • sendTimedCommandEx() : EyeLinkCBind
  • set_image_palette() : EyeLinkCustomDisplay
  • setAccelerationThreshold() : EyeLink
  • setAcceptTargetFixationButton() : EyeLink
  • setAddress() : EyeLinkCBind
  • setAutoCalibrationPacing() : EyeLink
  • setCalibrationType() : EyeLink
  • setFileEventData() : EyeLink
  • setFileEventFilter() : EyeLink
  • setFileSampleFilter() : EyeLink
  • setFixationUpdateAccumulate() : EyeLink
  • setFixationUpdateInterval() : EyeLink
  • setHeuristicFilterOff() : EyeLink
  • setHeuristicFilterOn() : EyeLink
  • setHeuristicLinkAndFileFilter() : EyeLink
  • setLinkEventData() : EyeLink
  • setLinkEventFilter() : EyeLink
  • setLinkSampleFilter() : EyeLink
  • setMotionThreshold() : EyeLink
  • setName() : EyeLinkCBind
  • setNoRecordEvents() : EyeLink
  • setOfflineMode() : EyeLinkCBind
  • setPupilSizeDiameter() : EyeLink
  • setPursuitFixup() : EyeLink
  • setRecordingParseType() : EyeLink
  • setSaccadeVelocityThreshold() : EyeLink
  • setSampleSizeForVelAndAcceleration() : EyeLink
  • setScreenSimulationDistance() : EyeLink
  • setSimulationMode() : EyeLink
  • setup_cal_display() : EyeLinkCustomDisplay
  • setup_image_display() : EyeLinkCustomDisplay
  • setUpdateInterval() : EyeLink
  • setVelocityAccelerationModel() : EyeLink
  • setXGazeConstraint() : EyeLink
  • setYGazeConstraint() : EyeLink
  • startData() : EyeLinkCBind
  • startDriftCorrect() : EyeLinkCBind
  • startPlayBack() : EyeLinkCBind
  • startRecording() : EyeLinkCBind
  • startSetup() : EyeLinkCBind
  • stopData() : EyeLinkCBind
  • stopPlayBack() : EyeLinkCBind
  • stopRecording() : EyeLinkCBind


  • All
  • Functions
  • Variables
  • _
  • a
  • b
  • c
  • d
  • e
  • f
  • g
  • h
  • i
  • k
  • m
  • n
  • o
  • p
  • q
  • r
  • s
  • t
  • u
  • w

Here is a list of all class members with links to the classes they belong to:

- t -

  • targetModeDisplay() : EyeLinkCBind
  • terminalBreak() : EyeLinkCBind
  • trackeraddress : EyeLink
  • trackerTime() : EyeLinkCBind
  • trackerTimeOffset() : EyeLinkCBind
  • trackerTimeUsec() : EyeLinkCBind
  • trackerTimeUsecOffset() : EyeLinkCBind


  • All
  • Functions
  • Variables
  • _
  • a
  • b
  • c
  • d
  • e
  • f
  • g
  • h
  • i
  • k
  • m
  • n
  • o
  • p
  • q
  • r
  • s
  • t
  • u
  • w

Here is a list of all class members with links to the classes they belong to:

- u -

  • userMenuSelection() : EyeLinkCBind


  • All
  • Functions
  • Variables
  • _
  • a
  • b
  • c
  • d
  • e
  • f
  • g
  • h
  • i
  • k
  • m
  • n
  • o
  • p
  • q
  • r
  • s
  • t
  • u
  • w

Here is a list of all class members with links to the classes they belong to:

- w -

  • waitForBlockStart() : EyeLinkCBind
  • waitForData() : EyeLinkCBind
  • waitForModeReady() : EyeLinkCBind
  • width : DisplayInfo
  • writeIOPort() : EyeLink


  • All
  • Functions
  • Variables
  • _
  • a
  • b
  • c
  • d
  • e
  • f
  • g
  • h
  • i
  • k
  • m
  • n
  • o
  • p
  • q
  • r
  • s
  • t
  • u
  • w

- _ -

  • __init__() : EyeLinkCustomDisplay, KeyInput, ILinkData, DisplayInfo, ButtonEvent, IOEvent, MessageEvent, FixUpdateEvent, EndFixationEvent, EndSaccadeEvent, EndNonBlinkEvent, EndBlinkEvent, StartFixationEvent, StartSaccadeEvent, StartNonBlinkEvent, StartBlinkEvent, EyeEvent, Sample, SampleData, EyelinkMessage, EyeLinkAddress, EyeLink, EyeLinkListener
  • __str__() : ButtonEvent, IOEvent, FixUpdateEvent, Sample, SampleData, EyelinkMessage, EyeLinkAddress
  • __updateimgsize__() : EyeLinkCustomDisplay


  • All
  • Functions
  • Variables
  • _
  • a
  • b
  • c
  • d
  • e
  • f
  • g
  • h
  • i
  • k
  • m
  • n
  • o
  • p
  • q
  • r
  • s
  • t
  • u
  • w

- k -

  • key_message_pump() : EyeLinkCBind


  • All
  • Functions
  • Variables
  • _
  • a
  • b
  • c
  • d
  • e
  • f
  • g
  • h
  • i
  • k
  • m
  • n
  • o
  • p
  • q
  • r
  • s
  • t
  • u
  • w

- m -

  • markPlayBackStart() : EyeLink


  • All
  • Functions
  • Variables
  • _
  • a
  • b
  • c
  • d
  • e
  • f
  • g
  • h
  • i
  • k
  • m
  • n
  • o
  • p
  • q
  • r
  • s
  • t
  • u
  • w

- n -

  • nodeReceive() : EyeLinkCBind
  • nodeRequestTime() : EyeLinkCBind
  • nodeSend() : EyeLinkCBind
  • nodeSendMessage() : EyeLinkCBind


  • All
  • Functions
  • Variables
  • _
  • a
  • b
  • c
  • d
  • e
  • f
  • g
  • h
  • i
  • k
  • m
  • n
  • o
  • p
  • q
  • r
  • s
  • t
  • u
  • w

- o -

  • open() : EyeLinkCBind
  • openDataFile() : EyeLinkCBind
  • openNode() : EyeLinkCBind


  • All
  • Functions
  • Variables
  • _
  • a
  • b
  • c
  • d
  • e
  • f
  • g
  • h
  • i
  • k
  • m
  • n
  • o
  • p
  • q
  • r
  • s
  • t
  • u
  • w

- a -

  • abort() : EyeLinkCBind
  • acceptTrigger() : EyeLinkCBind
  • alert_printf() : EyeLinkCustomDisplay
  • applyDriftCorrect() : EyeLinkCBind


  • All
  • Functions
  • Variables
  • _
  • a
  • b
  • c
  • d
  • e
  • f
  • g
  • h
  • i
  • k
  • m
  • n
  • o
  • p
  • q
  • r
  • s
  • t
  • u
  • w

- b -

  • bitmapBackdrop() : EyeLinkCBind
  • bitmapSaveAndBackdrop() : EyeLinkCBind
  • breakPressed() : EyeLinkCBind
  • broadcastOpen() : EyeLinkCBind


  • All
  • Functions
  • Variables
  • _
  • a
  • b
  • c
  • d
  • e
  • f
  • g
  • h
  • i
  • k
  • m
  • n
  • o
  • p
  • q
  • r
  • s
  • t
  • u
  • w

- c -

  • calculateOverallVelocityAndAcceleration() : EyeLinkCBind
  • calculateVelocity() : EyeLinkCBind
  • calculateVelocityXY() : EyeLinkCBind
  • clear_cal_display() : EyeLinkCustomDisplay
  • clearScreen() : EyeLink
  • close() : EyeLinkCBind
  • closeDataFile() : EyeLinkCBind
  • commandResult() : EyeLinkCBind


  • All
  • Functions
  • Variables
  • _
  • a
  • b
  • c
  • d
  • e
  • f
  • g
  • h
  • i
  • k
  • m
  • n
  • o
  • p
  • q
  • r
  • s
  • t
  • u
  • w

- d -

  • dataSwitch() : EyeLinkCBind
  • disableAutoCalibration() : EyeLink
  • doDriftCorrect() : EyeLinkCBind
  • doTrackerSetup() : EyeLink, EyeLinkCBind
  • draw_cal_target() : EyeLinkCustomDisplay
  • draw_cross_hair() : EyeLinkCustomDisplay
  • draw_image_line() : EyeLinkCustomDisplay
  • draw_line() : EyeLinkCustomDisplay
  • draw_lozenge() : EyeLinkCustomDisplay
  • drawBox() : EyeLink
  • drawCalTarget() : EyeLinkListener
  • drawCross() : EyeLink
  • drawFilledBox() : EyeLink
  • drawLine() : EyeLink
  • drawText() : EyeLink
  • dummy_open() : EyeLinkCBind


  • All
  • Functions
  • Variables
  • _
  • a
  • b
  • c
  • d
  • e
  • f
  • g
  • h
  • i
  • k
  • m
  • n
  • o
  • p
  • q
  • r
  • s
  • t
  • u
  • w

- e -

  • echo() : EyeLink
  • echo_key() : EyeLinkCBind
  • enableAutoCalibration() : EyeLink
  • erase_cal_target() : EyeLinkCustomDisplay
  • escapePressed() : EyeLinkCBind
  • exit_cal_display() : EyeLinkCustomDisplay
  • exit_image_display() : EyeLinkCustomDisplay
  • exitCalibration() : EyeLinkCBind
  • eyeAvailable() : EyeLinkCBind


  • All
  • Functions
  • Variables
  • _
  • a
  • b
  • c
  • d
  • e
  • f
  • g
  • h
  • i
  • k
  • m
  • n
  • o
  • p
  • q
  • r
  • s
  • t
  • u
  • w

- f -

  • flushKeybuttons() : EyeLinkCBind


  • All
  • Functions
  • Variables
  • _
  • a
  • b
  • c
  • d
  • e
  • f
  • g
  • h
  • i
  • k
  • m
  • n
  • o
  • p
  • q
  • r
  • s
  • t
  • u
  • w

- g -

  • get_input_key() : EyeLinkCustomDisplay
  • get_mouse_state() : EyeLinkCustomDisplay
  • getAddress() : ILinkData
  • getAmplitude() : EndSaccadeEvent
  • getAngle() : EndSaccadeEvent
  • getAverageGaze() : FixUpdateEvent, EndFixationEvent
  • getAverageHREF() : FixUpdateEvent, EndFixationEvent
  • getAveragePupilSize() : FixUpdateEvent, EndFixationEvent
  • getAverageVelocity() : EndNonBlinkEvent
  • getBlockNumber() : ILinkData
  • getButtons() : ButtonEvent, Sample
  • getButtonStates() : EyeLinkCBind
  • getCalibrationMessage() : EyeLinkCBind
  • getCalibrationResult() : EyeLinkCBind
  • getCRMode() : EyeLinkListener
  • getCurrentMode() : EyeLinkCBind
  • getCurrentTime() : EyeLinkListener
  • getData() : IOEvent
  • getDataCount() : EyeLinkCBind
  • getDummyMode() : EyeLink
  • getEndGaze() : EndNonBlinkEvent
  • getEndHREF() : EndNonBlinkEvent
  • getEndPPD() : EndNonBlinkEvent
  • getEndPupilSize() : FixUpdateEvent, EndFixationEvent
  • getEndTime() : EndNonBlinkEvent, EndBlinkEvent
  • getEndVelocity() : EndNonBlinkEvent
  • getEventDataFlags() : ILinkData, EyeLinkCBind
  • getEventQueueLength() : ILinkData
  • getEventsInBlock() : ILinkData
  • getEventTypeFlags() : ILinkData, EyeLinkCBind
  • getEye() : EyeEvent, Sample
  • getEyeUsed() : EyeLinkListener
  • getFileFilter() : EyeLinkListener
  • getFixationUpdateAccumulate() : EyeLink
  • getFixationUpdateInterval() : EyeLink
  • getFlags() : Sample
  • getFloatData() : EyeLinkCBind
  • getFreeQueueLength() : ILinkData
  • getGaze() : SampleData
  • getHData() : Sample
  • getHeadDistencePrescaler() : ILinkData
  • getHREF() : SampleData
  • getImageCrossHairData() : EyeLinkCBind
  • getInput() : Sample
  • getIP() : EyeLinkAddress
  • getkey() : EyeLinkCBind
  • getkeyEx() : EyeLinkCBind
  • getLastBufferSize() : ILinkData
  • getLastBufferType() : ILinkData
  • getLastButtonPress() : EyeLinkCBind
  • getLastButtonStates() : EyeLinkCBind
  • getLastData() : EyeLinkCBind
  • getLastItem() : ILinkData
  • getLastItemContent() : ILinkData
  • getLastItemStatus() : ILinkData
  • getLastItemTimeStamp() : ILinkData
  • getLastItemType() : ILinkData
  • getLastMessage() : EyeLinkCBind
  • getLastPupil() : ILinkData
  • getLastReceiveTime() : ILinkData
  • getLastResX() : ILinkData
  • getLastResY() : ILinkData
  • getLeftEye() : Sample
  • getLinkFilter() : EyeLinkListener
  • getLinkFlags() : ILinkData
  • getLostDataTypes() : ILinkData
  • getModeData() : EyeLinkCBind
  • getName() : ILinkData
  • getNewestSample() : EyeLinkCBind
  • getNextData() : EyeLinkCBind
  • getNode() : EyeLinkCBind
  • getNodes() : ILinkData
  • getPacketFlags() : ILinkData
  • getPeakVelocity() : EndNonBlinkEvent
  • getPendingCommands() : ILinkData
  • getPoolResponse() : ILinkData
  • getPort() : EyeLinkAddress
  • getPositionScalar() : EyeLinkCBind
  • getPPD() : Sample
  • getPrescaler() : ILinkData
  • getPupilPrescaler() : ILinkData
  • getPupilSize() : SampleData
  • getQueueSize() : ILinkData
  • getRawPupil() : SampleData
  • getRead() : EyeEvent
  • getRecordingStatus() : EyeLinkCBind
  • getRemoteBroadcastAddress() : ILinkData
  • getReserved() : ILinkData
  • getRightEye() : Sample
  • getSample() : EyeLinkCBind
  • getSampleDataFlags() : ILinkData, EyeLinkCBind
  • getSampleDivisor() : ILinkData
  • getSampleQueueLength() : ILinkData
  • getSampleRate() : ILinkData, EyeLinkListener
  • getSamplesInBlock() : ILinkData
  • getSampleSizeForVelAndAcceleration() : EyeLink
  • getStartGaze() : StartNonBlinkEvent
  • getStartHREF() : StartNonBlinkEvent
  • getStartPPD() : StartNonBlinkEvent
  • getStartPupilSize() : FixUpdateEvent, StartFixationEvent
  • getStartTime() : EyeEvent
  • getStartVelocity() : StartNonBlinkEvent
  • getStateFlags() : ILinkData
  • getStates() : ButtonEvent
  • getStatus() : EyeEvent, Sample
  • getTargetDistance() : Sample
  • getTargetFlags() : Sample
  • getTargetPositionAndState() : EyeLinkCBind
  • getTargetX() : Sample
  • getTargetY() : Sample
  • getText() : MessageEvent, EyelinkMessage
  • getTime() : ILinkData, IOEvent, MessageEvent, EyeEvent, Sample
  • getTrackerAddress() : ILinkData, EyeLink
  • getTrackerBroadcastAddress() : ILinkData
  • getTrackerDataOutputState() : ILinkData
  • getTrackerInfo() : EyeLinkListener
  • getTrackerMode() : EyeLinkCBind
  • getTrackerName() : ILinkData
  • getTrackerVersion() : EyeLinkCBind
  • getTrackerVersionString() : EyeLinkCBind
  • getType() : IOEvent, MessageEvent, EyeEvent, Sample
  • getVelocityAccelerationModel() : EyeLink
  • getVelocityPrescaler() : ILinkData


  • All
  • Functions
  • Variables
  • _
  • a
  • b
  • c
  • d
  • e
  • f
  • g
  • h
  • i
  • k
  • m
  • n
  • o
  • p
  • q
  • r
  • s
  • t
  • u
  • w

- h -

  • haveLeftEye() : ILinkData
  • haveRightEye() : ILinkData


  • All
  • Functions
  • Variables
  • _
  • a
  • b
  • c
  • d
  • e
  • f
  • g
  • h
  • i
  • k
  • m
  • n
  • o
  • p
  • q
  • r
  • s
  • t
  • u
  • w

- i -

  • image_title() : EyeLinkCustomDisplay
  • imageModeDisplay() : EyeLinkCBind
  • initFromSample() : Sample
  • inSetup() : EyeLinkCBind
  • isBinocular() : Sample
  • isConnected() : EyeLinkCBind
  • isControlEvent() : ILinkData
  • isEventsEnabled() : ILinkData
  • isInBlockWithEvents() : ILinkData
  • isInBlockWithSamples() : ILinkData
  • isInDataBlock() : EyeLinkCBind
  • isLeftSample() : Sample
  • isNewBlock() : ILinkData
  • isPoolingRemote() : ILinkData
  • isRecording() : EyeLinkCBind
  • isRightSample() : Sample
  • isSamplesEnabled() : ILinkData


  • All
  • Functions
  • Variables
  • _
  • a
  • b
  • c
  • d
  • e
  • f
  • g
  • h
  • i
  • k
  • m
  • n
  • o
  • p
  • q
  • r
  • s
  • t
  • u
  • w

- p -

  • play_beep() : EyeLinkCustomDisplay
  • pollRemotes() : EyeLinkCBind
  • pollResponses() : EyeLinkCBind
  • pollTrackers() : EyeLinkCBind
  • progressSendDataUpdate() : EyeLink
  • progressUpdate() : EyeLink
  • pumpMessages() : EyeLinkCBind


  • All
  • Functions
  • Variables
  • _
  • a
  • b
  • c
  • d
  • e
  • f
  • g
  • h
  • i
  • k
  • m
  • n
  • o
  • p
  • q
  • r
  • s
  • t
  • u
  • w

- q -

  • quietMode() : EyeLinkCBind


  • All
  • Functions
  • Variables
  • _
  • a
  • b
  • c
  • d
  • e
  • f
  • g
  • h
  • i
  • k
  • m
  • n
  • o
  • p
  • q
  • r
  • s
  • t
  • u
  • w

- r -

  • readIOPort() : EyeLink
  • readKeyButton() : EyeLinkCBind
  • readKeyQueue() : EyeLinkCBind
  • readReply() : EyeLinkCBind
  • readRequest() : EyeLinkCBind
  • readTime() : EyeLinkCBind
  • receiveDataFile() : EyeLinkCBind
  • record_abort_hide() : EyeLinkCustomDisplay
  • requestTime() : EyeLinkCBind
  • reset() : EyeLinkCBind
  • resetData() : EyeLinkCBind


  • All
  • Functions
  • Variables
  • _
  • a
  • b
  • c
  • d
  • e
  • f
  • g
  • h
  • i
  • k
  • m
  • n
  • o
  • p
  • q
  • r
  • s
  • t
  • u
  • w

- s -

  • sendCommand() : EyeLinkCBind
  • sendDataFile() : EyeLinkCBind
  • sendKeybutton() : EyeLinkCBind
  • sendMessage() : EyeLinkListener, EyeLinkCBind
  • sendTimedCommand() : EyeLinkCBind
  • sendTimedCommandEx() : EyeLinkCBind
  • set_image_palette() : EyeLinkCustomDisplay
  • setAccelerationThreshold() : EyeLink
  • setAcceptTargetFixationButton() : EyeLink
  • setAddress() : EyeLinkCBind
  • setAutoCalibrationPacing() : EyeLink
  • setCalibrationType() : EyeLink
  • setFileEventData() : EyeLink
  • setFileEventFilter() : EyeLink
  • setFileSampleFilter() : EyeLink
  • setFixationUpdateAccumulate() : EyeLink
  • setFixationUpdateInterval() : EyeLink
  • setHeuristicFilterOff() : EyeLink
  • setHeuristicFilterOn() : EyeLink
  • setHeuristicLinkAndFileFilter() : EyeLink
  • setLinkEventData() : EyeLink
  • setLinkEventFilter() : EyeLink
  • setLinkSampleFilter() : EyeLink
  • setMotionThreshold() : EyeLink
  • setName() : EyeLinkCBind
  • setNoRecordEvents() : EyeLink
  • setOfflineMode() : EyeLinkCBind
  • setPupilSizeDiameter() : EyeLink
  • setPursuitFixup() : EyeLink
  • setRecordingParseType() : EyeLink
  • setSaccadeVelocityThreshold() : EyeLink
  • setSampleSizeForVelAndAcceleration() : EyeLink
  • setScreenSimulationDistance() : EyeLink
  • setSimulationMode() : EyeLink
  • setup_cal_display() : EyeLinkCustomDisplay
  • setup_image_display() : EyeLinkCustomDisplay
  • setUpdateInterval() : EyeLink
  • setVelocityAccelerationModel() : EyeLink
  • setXGazeConstraint() : EyeLink
  • setYGazeConstraint() : EyeLink
  • startData() : EyeLinkCBind
  • startDriftCorrect() : EyeLinkCBind
  • startPlayBack() : EyeLinkCBind
  • startRecording() : EyeLinkCBind
  • startSetup() : EyeLinkCBind
  • stopData() : EyeLinkCBind
  • stopPlayBack() : EyeLinkCBind
  • stopRecording() : EyeLinkCBind


  • All
  • Functions
  • Variables
  • _
  • a
  • b
  • c
  • d
  • e
  • f
  • g
  • h
  • i
  • k
  • m
  • n
  • o
  • p
  • q
  • r
  • s
  • t
  • u
  • w

- t -

  • targetModeDisplay() : EyeLinkCBind
  • terminalBreak() : EyeLinkCBind
  • trackerTime() : EyeLinkCBind
  • trackerTimeOffset() : EyeLinkCBind
  • trackerTimeUsec() : EyeLinkCBind
  • trackerTimeUsecOffset() : EyeLinkCBind


  • All
  • Functions
  • Variables
  • _
  • a
  • b
  • c
  • d
  • e
  • f
  • g
  • h
  • i
  • k
  • m
  • n
  • o
  • p
  • q
  • r
  • s
  • t
  • u
  • w

- u -

  • userMenuSelection() : EyeLinkCBind


  • All
  • Functions
  • Variables
  • _
  • a
  • b
  • c
  • d
  • e
  • f
  • g
  • h
  • i
  • k
  • m
  • n
  • o
  • p
  • q
  • r
  • s
  • t
  • u
  • w

- w -

  • waitForBlockStart() : EyeLinkCBind
  • waitForData() : EyeLinkCBind
  • waitForModeReady() : EyeLinkCBind
  • writeIOPort() : EyeLink


  • All
  • Functions
  • Variables

  • bits : DisplayInfo
  • height : DisplayInfo
  • ip : EyeLinkAddress
  • msg : EyelinkMessage
  • port : EyeLinkAddress
  • refresh : DisplayInfo
  • trackeraddress : EyeLink
  • width : DisplayInfo


  • All
  • Functions
  • Defines
  • _
  • a
  • b
  • c
  • d
  • e
  • f
  • g
  • i
  • m
  • n
  • o
  • p
  • r
  • s
  • t
  • v

Here is a list of all file members with links to the files they belong to:

- _ -

  • _checkKeys() : eyelinkmodule.c
  • _updateAddresses() : pylink.py
  • _updateBooleanFlags() : pylink.py
  • _updateNetworkData() : pylink.py
  • _updatePerTrialDynamic() : pylink.py
  • _updateReserved() : pylink.py
  • _updateSampleEventData() : pylink.py
  • _updateStatusFlags() : pylink.py
  • _updateTimeStamps() : pylink.py
  • _updateTypeFlags() : pylink.py

- a -

  • alert() : pylink.py

- b -

  • beginRealTimeMode() : pylink.py
  • bitmapBackdrop_doc : eyelinkmodule.c
  • bitmapSave() : pylink.py
  • bitmapSave_doc : eyelinkmodule.c
  • bitmapSaveAndBackdrop_doc : eyelinkmodule.c

- c -

  • closeGraphics() : pylink.py
  • closeMessageFile() : pylink.py
  • currentDoubleUsec() : pylink.py
  • currentTime() : pylink.py
  • currentUsec() : pylink.py

- d -

  • disableCustomBackgroundOnImageMode() : pylink.py
  • DOUBLEVOIDFCN() : eyelinkmodule.c
  • drawCalTarget() : pylink.py

- e -

  • enableExtendedRealtime() : pylink.py
  • enableExternalCalibrationDevice() : pylink.py
  • enableUTF8EyeLinkMessages() : pylink.py
  • endRealTimeMode() : pylink.py
  • eyelink_calculate_overallvelocity_and_acceleration_doc : eyelinkmodule.c
  • eyelink_calculate_velocity_doc : eyelinkmodule.c
  • eyelink_calculate_velocity_x_y_doc : eyelinkmodule.c
  • eyelink_eyelink_init_custom_graphics() : eyelinkmodule.c
  • eyelink_eyelink_request_cross_hair_draw() : eyelinkmodule.c
  • eyelink_in_realtime_mode() : eyelinkmodule.c
  • eyelink_py_draw_cal_target_hook() : eyelinkmodule.c

- f -

  • flushGetkeyQueue() : pylink.py

- g -

  • GENERICFCNPROTO() : eyelinkmodule.c
  • getAngle() : pylink.py
  • getDisplayInformation() : pylink.py
  • getEYELINK() : pylink.py
  • getLastError() : pylink.py
  • getLevelTextInternal() : pylink.py
  • getTrackerModule() : eyelinkmodule.c

- i -

  • inRealTimeMode() : pylink.py
  • isCustomGraphicsActive() : eyelinkmodule.c

- m -

  • msecDelay() : pylink.py

- n -

  • newDisplayInfo() : pylink.py
  • newEndBlinkEvent() : pylink.py
  • newEndFixationEvent() : pylink.py
  • newEndSaccadeEvent() : pylink.py
  • newFixUpdateEvent() : pylink.py
  • newIOEvent() : pylink.py
  • newMessageEvent() : pylink.py
  • newSample() : pylink.py
  • newStartBlinkEvent() : pylink.py
  • newStartFixationEvent() : pylink.py
  • newStartSaccadeEvent() : pylink.py

- o -

  • openCustomGraphicsInternal() : pylink.py
  • openGraphics() : pylink.py
  • openGraphicsEx() : pylink.py
  • openMessageFile() : pylink.py

- p -

  • printELINKADDR() : eyelinkmodule.c
  • pumpDelay() : pylink.py
  • Py_TYPE : eyelinkmodule.c
  • PyCapsule_New : eyelinkmodule.c
  • PYGAMEAPI_LOCAL_ENTRY : eyelinkmodule.c
  • PyInit_pylink : eyelinkmodule.c
  • PyInit_sdlmain_osx : eyelinkmodule.c
  • PyVarObject_HEAD_INIT : eyelinkmodule.c

- r -

  • request_cross_hair_draw() : pylink.py
  • resetBackground() : pylink.py
  • RETURNERROR : eyelinkmodule.c

- s -

  • sendMessageToFile() : pylink.py
  • setCalibrationAnimationTarget() : pylink.py
  • setCalibrationColors() : pylink.py
  • setCalibrationSounds() : pylink.py
  • setCameraPosition() : pylink.py
  • setDriftCorrectSounds() : pylink.py
  • setTargetSize() : pylink.py
  • setup_remap_hooks() : eyelinkmodule.c

- t -

  • text_to_elinkaddr() : eyelinkmodule.c
  • TEXTVALUE : eyelinkmodule.c
  • toELINKADDR() : eyelinkmodule.c

- v -

  • VOIDSTR2FCN() : eyelinkmodule.c
  • VOIDUINT16FCN() : eyelinkmodule.c
  • VOIDUINT32FCN() : eyelinkmodule.c


  • All
  • Functions
  • Defines

  • bitmapBackdrop_doc : eyelinkmodule.c
  • bitmapSave_doc : eyelinkmodule.c
  • bitmapSaveAndBackdrop_doc : eyelinkmodule.c
  • eyelink_calculate_overallvelocity_and_acceleration_doc : eyelinkmodule.c
  • eyelink_calculate_velocity_doc : eyelinkmodule.c
  • eyelink_calculate_velocity_x_y_doc : eyelinkmodule.c
  • Py_TYPE : eyelinkmodule.c
  • PyCapsule_New : eyelinkmodule.c
  • PYGAMEAPI_LOCAL_ENTRY : eyelinkmodule.c
  • PyInit_pylink : eyelinkmodule.c
  • PyInit_sdlmain_osx : eyelinkmodule.c
  • PyVarObject_HEAD_INIT : eyelinkmodule.c
  • RETURNERROR : eyelinkmodule.c
  • TEXTVALUE : eyelinkmodule.c


  • All
  • Functions
  • Defines
  • _
  • a
  • b
  • c
  • d
  • e
  • f
  • g
  • i
  • m
  • n
  • o
  • p
  • r
  • s
  • t
  • v

- _ -

  • _checkKeys() : eyelinkmodule.c
  • _updateAddresses() : pylink.py
  • _updateBooleanFlags() : pylink.py
  • _updateNetworkData() : pylink.py
  • _updatePerTrialDynamic() : pylink.py
  • _updateReserved() : pylink.py
  • _updateSampleEventData() : pylink.py
  • _updateStatusFlags() : pylink.py
  • _updateTimeStamps() : pylink.py
  • _updateTypeFlags() : pylink.py

- a -

  • alert() : pylink.py

- b -

  • beginRealTimeMode() : pylink.py
  • bitmapSave() : pylink.py

- c -

  • closeGraphics() : pylink.py
  • closeMessageFile() : pylink.py
  • currentDoubleUsec() : pylink.py
  • currentTime() : pylink.py
  • currentUsec() : pylink.py

- d -

  • disableCustomBackgroundOnImageMode() : pylink.py
  • DOUBLEVOIDFCN() : eyelinkmodule.c
  • drawCalTarget() : pylink.py

- e -

  • enableExtendedRealtime() : pylink.py
  • enableExternalCalibrationDevice() : pylink.py
  • enableUTF8EyeLinkMessages() : pylink.py
  • endRealTimeMode() : pylink.py
  • eyelink_eyelink_init_custom_graphics() : eyelinkmodule.c
  • eyelink_eyelink_request_cross_hair_draw() : eyelinkmodule.c
  • eyelink_in_realtime_mode() : eyelinkmodule.c
  • eyelink_py_draw_cal_target_hook() : eyelinkmodule.c

- f -

  • flushGetkeyQueue() : pylink.py

- g -

  • GENERICFCNPROTO() : eyelinkmodule.c
  • getAngle() : pylink.py
  • getDisplayInformation() : pylink.py
  • getEYELINK() : pylink.py
  • getLastError() : pylink.py
  • getLevelTextInternal() : pylink.py
  • getTrackerModule() : eyelinkmodule.c

- i -

  • inRealTimeMode() : pylink.py
  • isCustomGraphicsActive() : eyelinkmodule.c

- m -

  • msecDelay() : pylink.py

- n -

  • newDisplayInfo() : pylink.py
  • newEndBlinkEvent() : pylink.py
  • newEndFixationEvent() : pylink.py
  • newEndSaccadeEvent() : pylink.py
  • newFixUpdateEvent() : pylink.py
  • newIOEvent() : pylink.py
  • newMessageEvent() : pylink.py
  • newSample() : pylink.py
  • newStartBlinkEvent() : pylink.py
  • newStartFixationEvent() : pylink.py
  • newStartSaccadeEvent() : pylink.py

- o -

  • openCustomGraphicsInternal() : pylink.py
  • openGraphics() : pylink.py
  • openGraphicsEx() : pylink.py
  • openMessageFile() : pylink.py

- p -

  • printELINKADDR() : eyelinkmodule.c
  • pumpDelay() : pylink.py
  • PyInit_pylink() : eyelinkmodule.c
  • PyInit_sdlmain_osx() : eyelinkmodule.c

- r -

  • request_cross_hair_draw() : pylink.py
  • resetBackground() : pylink.py

- s -

  • sendMessageToFile() : pylink.py
  • setCalibrationAnimationTarget() : pylink.py
  • setCalibrationColors() : pylink.py
  • setCalibrationSounds() : pylink.py
  • setCameraPosition() : pylink.py
  • setDriftCorrectSounds() : pylink.py
  • setTargetSize() : pylink.py
  • setup_remap_hooks() : eyelinkmodule.c

- t -

  • text_to_elinkaddr() : eyelinkmodule.c
  • toELINKADDR() : eyelinkmodule.c

- v -

  • VOIDSTR2FCN() : eyelinkmodule.c
  • VOIDUINT16FCN() : eyelinkmodule.c
  • VOIDUINT32FCN() : eyelinkmodule.c


PyLink Class Hierarchy

This inheritance list is sorted roughly, but not completely, alphabetically:
  • DisplayInfo
  • EndNonBlinkEvent
    • EndFixationEvent
    • EndSaccadeEvent
    • FixUpdateEvent
  • EyeEvent
    • EndBlinkEvent
    • StartBlinkEvent
    • StartNonBlinkEvent
      • FixUpdateEvent
      • StartFixationEvent
        • EndFixationEvent
      • StartSaccadeEvent
        • EndSaccadeEvent
  • EyeLinkAddress
    • EyelinkMessage
  • EyeLinkCBind
    • EyeLinkListener
      • EyeLink
  • EyeLinkCustomDisplay
  • ILinkData
  • IOEvent
    • ButtonEvent
  • KeyInput
  • MessageEvent
  • Sample
  • SampleData


  • All
  • Functions
  • _
  • a
  • b
  • c
  • d
  • e
  • f
  • g
  • i
  • m
  • n
  • o
  • p
  • r
  • s

Here is a list of all namespace members with links to the namespace documentation for each member:

- _ -

  • _updateAddresses() : pylink
  • _updateBooleanFlags() : pylink
  • _updateNetworkData() : pylink
  • _updatePerTrialDynamic() : pylink
  • _updateReserved() : pylink
  • _updateSampleEventData() : pylink
  • _updateStatusFlags() : pylink
  • _updateTimeStamps() : pylink
  • _updateTypeFlags() : pylink

- a -

  • alert() : pylink

- b -

  • beginRealTimeMode() : pylink
  • bitmapSave() : pylink

- c -

  • closeGraphics() : pylink
  • closeMessageFile() : pylink
  • currentDoubleUsec() : pylink
  • currentTime() : pylink
  • currentUsec() : pylink

- d -

  • disableCustomBackgroundOnImageMode() : pylink
  • drawCalTarget() : pylink

- e -

  • enableExtendedRealtime() : pylink
  • enableExternalCalibrationDevice() : pylink
  • enableUTF8EyeLinkMessages() : pylink
  • endRealTimeMode() : pylink

- f -

  • flushGetkeyQueue() : pylink

- g -

  • getAngle() : pylink
  • getDisplayInformation() : pylink
  • getEYELINK() : pylink
  • getLastError() : pylink
  • getLevelTextInternal() : pylink

- i -

  • inRealTimeMode() : pylink

- m -

  • msecDelay() : pylink

- n -

  • newDisplayInfo() : pylink
  • newEndBlinkEvent() : pylink
  • newEndFixationEvent() : pylink
  • newEndSaccadeEvent() : pylink
  • newFixUpdateEvent() : pylink
  • newIOEvent() : pylink
  • newMessageEvent() : pylink
  • newSample() : pylink
  • newStartBlinkEvent() : pylink
  • newStartFixationEvent() : pylink
  • newStartSaccadeEvent() : pylink

- o -

  • openCustomGraphicsInternal() : pylink
  • openGraphics() : pylink
  • openGraphicsEx() : pylink
  • openMessageFile() : pylink

- p -

  • pumpDelay() : pylink

- r -

  • request_cross_hair_draw() : pylink
  • resetBackground() : pylink

- s -

  • sendMessageToFile() : pylink
  • setCalibrationAnimationTarget() : pylink
  • setCalibrationColors() : pylink
  • setCalibrationSounds() : pylink
  • setCameraPosition() : pylink
  • setDriftCorrectSounds() : pylink
  • setTargetSize() : pylink


  • All
  • Functions
  • _
  • a
  • b
  • c
  • d
  • e
  • f
  • g
  • i
  • m
  • n
  • o
  • p
  • r
  • s

- _ -

  • _updateAddresses() : pylink
  • _updateBooleanFlags() : pylink
  • _updateNetworkData() : pylink
  • _updatePerTrialDynamic() : pylink
  • _updateReserved() : pylink
  • _updateSampleEventData() : pylink
  • _updateStatusFlags() : pylink
  • _updateTimeStamps() : pylink
  • _updateTypeFlags() : pylink

- a -

  • alert() : pylink

- b -

  • beginRealTimeMode() : pylink
  • bitmapSave() : pylink

- c -

  • closeGraphics() : pylink
  • closeMessageFile() : pylink
  • currentDoubleUsec() : pylink
  • currentTime() : pylink
  • currentUsec() : pylink

- d -

  • disableCustomBackgroundOnImageMode() : pylink
  • drawCalTarget() : pylink

- e -

  • enableExtendedRealtime() : pylink
  • enableExternalCalibrationDevice() : pylink
  • enableUTF8EyeLinkMessages() : pylink
  • endRealTimeMode() : pylink

- f -

  • flushGetkeyQueue() : pylink

- g -

  • getAngle() : pylink
  • getDisplayInformation() : pylink
  • getEYELINK() : pylink
  • getLastError() : pylink
  • getLevelTextInternal() : pylink

- i -

  • inRealTimeMode() : pylink

- m -

  • msecDelay() : pylink

- n -

  • newDisplayInfo() : pylink
  • newEndBlinkEvent() : pylink
  • newEndFixationEvent() : pylink
  • newEndSaccadeEvent() : pylink
  • newFixUpdateEvent() : pylink
  • newIOEvent() : pylink
  • newMessageEvent() : pylink
  • newSample() : pylink
  • newStartBlinkEvent() : pylink
  • newStartFixationEvent() : pylink
  • newStartSaccadeEvent() : pylink

- o -

  • openCustomGraphicsInternal() : pylink
  • openGraphics() : pylink
  • openGraphicsEx() : pylink
  • openMessageFile() : pylink

- p -

  • pumpDelay() : pylink

- r -

  • request_cross_hair_draw() : pylink
  • resetBackground() : pylink

- s -

  • sendMessageToFile() : pylink
  • setCalibrationAnimationTarget() : pylink
  • setCalibrationColors() : pylink
  • setCalibrationSounds() : pylink
  • setCameraPosition() : pylink
  • setDriftCorrectSounds() : pylink
  • setTargetSize() : pylink


Package pylink

Classes

class | EyeLinkCBind
class | EyeLinkListener
EyeLinkListener class implements most of the core EyeLink interface. More...
class | EyeLink
The EyeLink class is an extension of the EyeLinkListener class with additional utility functions. More...
class | EyeLinkAddress
The EyeLinkAddress class is used to hold addresses to EyeLink nodes. More...
class | EyelinkMessage
EyelinkMessage class, derived from EyeLinkAddress class, is used to send and receive messages between EyeLink nodes. More...
class | SampleData
Sample data for left and right eye. More...
class | Sample
The EyeLink toolkit library defines special data classes that allow the same programming calls to be used on different platforms such as MS-DOS, Windows, and Macintosh. More...
class | EyeEvent
The EyeLink tracker simplifies data analysis by detecting important changes in the sample data and placing corresponding events into the data stream. More...
class | StartBlinkEvent
Class to represent Start Blink event. More...
class | StartNonBlinkEvent
This interface is never used as is. More...
class | StartSaccadeEvent
Class to represent Start Saccade event. More...
class | StartFixationEvent
Class to represent Start Fixation event. More...
class | EndBlinkEvent
Class to represent End Blink event. More...
class | EndNonBlinkEvent
This interface is never used as is. More...
class | EndSaccadeEvent
Class to represent End Saccade event. More...
class | EndFixationEvent
Class to represent End Fixation event. More...
class | FixUpdateEvent
Class to represent the Fix Update event. More...
class | MessageEvent
A message event is created by your experiment program and placed in the EDF file. More...
class | IOEvent
IOEvent class is used to handle BUTTONEVENT and INPUTEVENT types, which report changes in button status or in the input port data. More...
class | ButtonEvent
A ButtonEvent class, derived from the IOEvent class, is created to handle specifics of button events. More...
class | DisplayInfo
The DisplayInfo class is used to contain information on display configurations, including width, height, color bits, and refresh rate. More...
class | ILinkData
Class to represent tracker status information such as time stamps, flags, tracker addresses and so on. More...
class | KeyInput
This represents a key input. More...
class | EyeLinkCustomDisplay
EyeLinkCustomDisplay is an abstract class, that one would implement to present calibration/validation/drift correction targets and camera images. More...

Functions

def | enableExternalCalibrationDevice
def | setTargetSize
def | setDriftCorrectSounds
def | currentDoubleUsec
def | inRealTimeMode
def | disableCustomBackgroundOnImageMode
def | setCameraPosition
def | endRealTimeMode
def | flushGetkeyQueue
def | resetBackground
def | sendMessageToFile
def | getLastError
def | openCustomGraphicsInternal
def | setCalibrationSounds
def | setCalibrationAnimationTarget
def | bitmapSave
def | enableExtendedRealtime
def | closeMessageFile
def | enableUTF8EyeLinkMessages
def | currentUsec
def | alert
def | msecDelay
def | setCalibrationColors
def | closeGraphics
def | request_cross_hair_draw
def | openGraphics
def | beginRealTimeMode
def | currentTime
def | openMessageFile
def | getDisplayInformation
def | pumpDelay
def | getLevelTextInternal
def | getEYELINK
def | openGraphicsEx
def | newSample
def | newStartBlinkEvent
def | newStartSaccadeEvent
def | newStartFixationEvent
def | newEndBlinkEvent
def | getAngle
def | newEndSaccadeEvent
def | newEndFixationEvent
def | newFixUpdateEvent
def | newMessageEvent
def | newIOEvent
def | newDisplayInfo
def | _updatePerTrialDynamic
def | _updateBooleanFlags
def | _updateTimeStamps
def | _updateStatusFlags
def | _updateTypeFlags
def | _updateSampleEventData
def | _updateNetworkData
def | _updateAddresses
def | _updateReserved
def | drawCalTarget

Function Documentation

def pylink.enableExternalCalibrationDevice ( )

def setTargetSize ( )

The standard calibration and drift correction target is a disk (for peripheral delectability) with a central "hole" target (for accurate fixation). The sizes of these features may be set with this function.

Remarks:
This function is equivalent to the C API
    void set_target_size(UINT16 diameter, UINT16 holesize);
Parameters:
diameter | Size of outer disk, in pixels.
holesize | Size of central feature, in pixels. If holesize is 0, no central feature will be drawn. The disk is drawn in the calibration foreground color, and the hole is drawn in the calibration background color.

def pylink.setDriftCorrectSounds ( )

def currentDoubleUsec ( )

Returns the current microsecond time (as a double type) since the initialization of the EyeLink library.

Remarks:
Same as currentUsec() except, this function can return large microseconds. That is the currentUsec() can return up to 2147483648 microseconds starting from initialization. The currentDoubleUsec() can return up to 36028797018963968 microseconds. This is equivalent to the C API
    double current_double_usec(void);
Returns:
A float data for the current microsecond time since the initialization of the EyeLink library.

def inRealTimeMode ( )

returns whether the current mode is real-time.

Returns:
1 if in realtime mode, else 0.

def disableCustomBackgroundOnImageMode ( )

Internal function. This should not be used externally.

def setCameraPosition ( )

Sets the camera position on the display computer. Moves the top left hand corner of the camera position to new location.

Parameters:
left | X coordinate of upper-left corner of the camera image window.
top | Y coordinate of upper-left corner of the camera image window.
right | X coordinate of lower-right corner of the camera image window.
bottom | Y coordinate of lower-right corner of the camera image window.

def endRealTimeMode ( )

Returns the application to a priority slightly above normal, to end realtime mode. This function should execute rapidly, but there is the possibility that Windows will allow other tasks to run after this call, causing delays of 1-20 milliseconds.

Remarks:
This function is equivalent to the C API
    void end_realtime_mode(void);

def flushGetkeyQueue ( )

Initializes the key queue used by getkey(). It may be called at any time to get rid any of old keys from the queue.

Remarks:
This is equivalent to the C API
    void flush_getkey_queue(void);

def resetBackground ( )

Internal function. This should not be used externally.

def pylink.sendMessageToFile ( )

def getLastError ( )

Retrieves a tuple containing the error number and error message generated by last Pylink call to have failed

Remarks:
This has no equivalence in C API. This can be used to help identify the Runtime Error last raised by a Pylink call
Returns:
(Error-Number, Error-Message) tuple or (0,'') if no Runtime Error has been raised.
Example:
    try:
        getEYELINK().waitForBlockStart(500,1,0)
    except RuntimeError:
        if getLastError()[0] == 0: # wait time expired without link data
            print ("ERROR: No link samples received!")
            return TRIAL_ERROR
        else: # for any other status simply re-raise the exception
            raise
See also:
commandResult()

def pylink.openCustomGraphicsInternal ( )

def pylink.setCalibrationSounds ( )

def pylink.setCalibrationAnimationTarget ( )

def bitmapSave ( )

This function saves the entire bitmap or selected part of a bitmap in an image file (with an extension of .png, .bmp, .jpg, or .tif). It creates the specified file if this file does not exist.

Parameters:
iwidth | Original image width.
iheight | Original image height.
pixels | Pixels of the image in one of two possible formats: pixel=[line1, line2, ... linen] line=[pix1,pix2,...,pixn],pix=(r,g,b). pixel=[line1, line2, ... linen] line=[pix1,pix2,...,pixn],pix=0xAARRGGBB.
xs | Crop x position.
ys | Crop y position.
width | Crop width.
height | Crop height.
fname | File name to save.
path | Path to save.
svoptions | Save options(SV_NOREPLACE, SV_MAKEPATH). If the file exists, it replaces the file unless SV_NOREPLACE is specified.
This function is equivalent to the C API el_bitmap_save()

def enableExtendedRealtime ( )

Internal function. This should not be used externally.

def closeMessageFile ( )

Flush and close message file, opened by openMessageFile().

def pylink.enableUTF8EyeLinkMessages ( )

def currentUsec ( )

Returns the current microsecond time since the initialization of the EyeLink library.

Remarks:
This is equivalent to the C API
    UINT32 current_usec(void);
Returns:
Long integer for the current microsecond time since the initialization of the EyeLink library.

def alert ( )

This method is used to give a notification to the user when an error occurs.

Remarks:
This function does not allow printf formatting as in c. However you can do a formatted string argument in python. This is equivalent to the C API
    void alert_printf(char *fmt, ...);
Parameters:
message Text message to be displayed.

def msecDelay ( )

Does a unblocked delay using currentTime().

Remarks:
This is equivalent to the C API
    void msec_delay(UINT32 n);
Parameters:
delay An integer for number of milliseconds to delay.

def setCalibrationColors ( )

Passes the colors of the display background and fixation target to the eyelink_core_graphics library. During calibration, camera image display, and drift correction, the display background should match the brightness of the experimental stimuli as closely as possible, in order to maximize tracking accuracy. This function passes the colors of the display background and fixation target to the eyelink_core_graphics library. This also prevents flickering of the display at the beginning and end of drift correction.

Remarks:
This is equivalent to the C API
    void set_calibration_colors(SDL_Color *fg, SDL_Color *bg);
Parameters:
foreground_color | Color for foreground calibration target.
background_color | Color for foreground calibration background.
Both colors must be a three-integer (from 0 to 255) tuple encoding the red, blue, and green color component.

Example:

    setCalibrationColors((0, 0, 0), (255, 255, 255))

    This sets the calibration target in black and calibration background in white.

def closeGraphics ( )

Notifies the eyelink_core_graphics to close or release the graphics.

Remarks:
This is equivalent to the C API
    void close_expt_graphics(void);

def pylink.request_cross_hair_draw ( )

def openGraphics ( )

Opens the graphics if the display mode is not set. If the display mode is already set, uses the existing display mode.

Remarks:
This is equivalent to the SDL version C API
    INT16 init_expt_graphics(SDL_Surface * s, DISPLAYINFO *info);
Parameters:
dimension | Two-item tuple of display containing width and height information.
bits | Color bits.
Returns:
None or run-time error.

def beginRealTimeMode ( )

Sets the application priority and cleans up pending Windows activity to place the application in realtime mode. This could take up to 100 milliseconds, depending on the operation system, to set the application priority.

Remarks:
This function is equivalent to the C API
    void begin_realtime_mode(UINT32 delay);
Parameters:
delay An integer, used to set the minimum time this function takes, so that this function can act as a useful delay.

def currentTime ( )

Returns the current millisecond time since the initialization of the EyeLink library.

Remarks:
This function is equivalent to the C API
    UINT32 current_time(void);
Returns:
Long integer for the current millisecond time since the initialization of the EyeLink library.

def openMessageFile ( )

Creates message file, once open call to sendMessageToFile(), will not send messages to tracker. Messages are kept in a queue if the application is in realtime mode, and written to disk on non real-time mode except when closeMessageFile() is called while in real-time mode.

Parameters:
[in] fname Message file name

def getDisplayInformation ( )

Returns the display configuration.

Returns:
Instance of DisplayInfo class. The width, height, bits, and refresh rate of the display can be accessed from the returned value.
Example:
    display = getDisplayInformation()
    print display.width, display.height, display.bits, display.refresh

def pumpDelay ( )

During calls to msecDelay(), Windows is not able to handle messages. One result of this is that windows may not appear. This is the preferred delay function when accurate timing is not needed. It calls pumpMessages() until the last 20 milliseconds of the delay, allowing Windows to function properly. In rare cases, the delay may be longer than expected. It does not process modeless dialog box messages.

Remarks:
This is equivalent to the C API
    void pump_delay(UINT32 delay);
Parameters:
delay An integer, which sets number of milliseconds to delay.

def pylink.getLevelTextInternal ( level )

def pylink.getEYELINK ( )

def pylink.openGraphicsEx ( eyeCustomDisplay )

def pylink.newSample | ( | time,
 |  | flags,
 |  | px,
 |  | py,
 |  | hx,
 |  | hy,
 |  | pa,
 |  | gx,
 |  | gy,
 |  | rx,
 |  | ry,
 |  | status,
 |  | input,
 |  | buttons,
 |  | htype,
 |  | hdata
 | )

def pylink.newStartBlinkEvent | ( | time,
 |  | type,
 |  | eye,
 |  | read,
 |  | sttime
 | )

def pylink.newStartSaccadeEvent | ( | time,
 |  | type,
 |  | eye,
 |  | read,
 |  | sttime,
 |  | gstx,
 |  | gsty,
 |  | hstx,
 |  | hsty,
 |  | svel,
 |  | supd_x,
 |  | supd_y
 | )

def pylink.newStartFixationEvent | ( | time,
 |  | type,
 |  | eye,
 |  | read,
 |  | sttime,
 |  | gstx,
 |  | gsty,
 |  | hstx,
 |  | hsty,
 |  | sta,
 |  | svel,
 |  | supd_x,
 |  | supd_y
 | )

def pylink.newEndBlinkEvent | ( | time,
 |  | type,
 |  | eye,
 |  | read,
 |  | sttime,
 |  | entime
 | )

def pylink.getAngle | ( | xavgres,
 |  | yavgres,
 |  | x1,
 |  | y1,
 |  | x2,
 |  | y2
 | )

def pylink.newEndSaccadeEvent | ( | time,
 |  | type,
 |  | eye,
 |  | read,
 |  | sttime,
 |  | gstx,
 |  | gsty,
 |  | hstx,
 |  | hsty,
 |  | svel,
 |  | supd_x,
 |  | supd_y,
 |  | entime,
 |  | genx,
 |  | geny,
 |  | henx,
 |  | heny,
 |  | evel,
 |  | avel,
 |  | pvel,
 |  | eupd_x,
 |  | eupd_y
 | )

def pylink.newEndFixationEvent | ( | time,
 |  | type,
 |  | eye,
 |  | read,
 |  | sttime,
 |  | gstx,
 |  | gsty,
 |  | hstx,
 |  | hsty,
 |  | sta,
 |  | svel,
 |  | supd_x,
 |  | supd_y,
 |  | entime,
 |  | genx,
 |  | geny,
 |  | gavx,
 |  | gavy,
 |  | henx,
 |  | heny,
 |  | havx,
 |  | havy,
 |  | ena,
 |  | ava,
 |  | evel,
 |  | avel,
 |  | pvel,
 |  | eupd_x,
 |  | eupd_y
 | )

def pylink.newFixUpdateEvent | ( | time,
 |  | type,
 |  | eye,
 |  | read,
 |  | sttime,
 |  | gstx,
 |  | gsty,
 |  | hstx,
 |  | hsty,
 |  | sta,
 |  | svel,
 |  | supd_x,
 |  | supd_y,
 |  | entime,
 |  | genx,
 |  | geny,
 |  | gavx,
 |  | gavy,
 |  | henx,
 |  | heny,
 |  | havx,
 |  | havy,
 |  | ena,
 |  | ava,
 |  | evel,
 |  | avel,
 |  | pvel,
 |  | eupd_x,
 |  | eupd_y
 | )

def pylink.newMessageEvent | ( | time,
 |  | type,
 |  | text
 | )

def pylink.newIOEvent | ( | btype,
 |  | time,
 |  | data
 | )

def pylink.newDisplayInfo | ( | width,
 |  | height,
 |  | bits,
 |  | refresh
 | )

def pylink._updatePerTrialDynamic | ( | dt,
 |  | x
 | )

def pylink._updateBooleanFlags | ( | dt,
 |  | x
 | )

def pylink._updateTimeStamps | ( | dt,
 |  | x
 | )

def pylink._updateStatusFlags | ( | dt,
 |  | x
 | )

def pylink._updateTypeFlags | ( | dt,
 |  | x
 | )

def pylink._updateSampleEventData | ( | dt,
 |  | x,
 |  | pl,
 |  | ldi
 | )

def pylink._updateNetworkData | ( | dt,
 |  | x,
 |  | nodes
 | )

def pylink._updateAddresses | ( | dt,
 |  | nm,
 |  | ad
 | )

def pylink._updateReserved | ( | dt,
 |  | r
 | )

def pylink.drawCalTarget | ( | x,
 |  | y
 | )


PyLink Package List

Here are the packages with brief descriptions (if available):
pylink


pylink.py File Reference

Namespaces

namespace | pylink

Classes

class | EyeLinkCBind
class | EyeLinkListener
EyeLinkListener class implements most of the core EyeLink interface. More...
class | EyeLink
The EyeLink class is an extension of the EyeLinkListener class with additional utility functions. More...
class | EyeLinkAddress
The EyeLinkAddress class is used to hold addresses to EyeLink nodes. More...
class | EyelinkMessage
EyelinkMessage class, derived from EyeLinkAddress class, is used to send and receive messages between EyeLink nodes. More...
class | SampleData
Sample data for left and right eye. More...
class | Sample
The EyeLink toolkit library defines special data classes that allow the same programming calls to be used on different platforms such as MS-DOS, Windows, and Macintosh. More...
class | EyeEvent
The EyeLink tracker simplifies data analysis by detecting important changes in the sample data and placing corresponding events into the data stream. More...
class | StartBlinkEvent
Class to represent Start Blink event. More...
class | StartNonBlinkEvent
This interface is never used as is. More...
class | StartSaccadeEvent
Class to represent Start Saccade event. More...
class | StartFixationEvent
Class to represent Start Fixation event. More...
class | EndBlinkEvent
Class to represent End Blink event. More...
class | EndNonBlinkEvent
This interface is never used as is. More...
class | EndSaccadeEvent
Class to represent End Saccade event. More...
class | EndFixationEvent
Class to represent End Fixation event. More...
class | FixUpdateEvent
Class to represent the Fix Update event. More...
class | MessageEvent
A message event is created by your experiment program and placed in the EDF file. More...
class | IOEvent
IOEvent class is used to handle BUTTONEVENT and INPUTEVENT types, which report changes in button status or in the input port data. More...
class | ButtonEvent
A ButtonEvent class, derived from the IOEvent class, is created to handle specifics of button events. More...
class | DisplayInfo
The DisplayInfo class is used to contain information on display configurations, including width, height, color bits, and refresh rate. More...
class | ILinkData
Class to represent tracker status information such as time stamps, flags, tracker addresses and so on. More...
class | KeyInput
This represents a key input. More...
class | EyeLinkCustomDisplay
EyeLinkCustomDisplay is an abstract class, that one would implement to present calibration/validation/drift correction targets and camera images. More...

Functions

def | pylink.enableExternalCalibrationDevice
def | pylink.setTargetSize
def | pylink.setDriftCorrectSounds
def | pylink.currentDoubleUsec
def | pylink.inRealTimeMode
def | pylink.disableCustomBackgroundOnImageMode
def | pylink.setCameraPosition
def | pylink.endRealTimeMode
def | pylink.flushGetkeyQueue
def | pylink.resetBackground
def | pylink.sendMessageToFile
def | pylink.getLastError
def | pylink.openCustomGraphicsInternal
def | pylink.setCalibrationSounds
def | pylink.setCalibrationAnimationTarget
def | pylink.bitmapSave
def | pylink.enableExtendedRealtime
def | pylink.closeMessageFile
def | pylink.enableUTF8EyeLinkMessages
def | pylink.currentUsec
def | pylink.alert
def | pylink.msecDelay
def | pylink.setCalibrationColors
def | pylink.closeGraphics
def | pylink.request_cross_hair_draw
def | pylink.openGraphics
def | pylink.beginRealTimeMode
def | pylink.currentTime
def | pylink.openMessageFile
def | pylink.getDisplayInformation
def | pylink.pumpDelay
def | pylink.getLevelTextInternal
def | pylink.getEYELINK
def | pylink.openGraphicsEx
def | pylink.newSample
def | pylink.newStartBlinkEvent
def | pylink.newStartSaccadeEvent
def | pylink.newStartFixationEvent
def | pylink.newEndBlinkEvent
def | pylink.getAngle
def | pylink.newEndSaccadeEvent
def | pylink.newEndFixationEvent
def | pylink.newFixUpdateEvent
def | pylink.newMessageEvent
def | pylink.newIOEvent
def | pylink.newDisplayInfo
def | pylink._updatePerTrialDynamic
def | pylink._updateBooleanFlags
def | pylink._updateTimeStamps
def | pylink._updateStatusFlags
def | pylink._updateTypeFlags
def | pylink._updateSampleEventData
def | pylink._updateNetworkData
def | pylink._updateAddresses
def | pylink._updateReserved
def | pylink.drawCalTarget


PylinkDoc.h File Reference

Copyright ©2006, SR Research Ltd.