MasterScan  Lab_Matlab_control Master Branch
List of all members | Properties and Events | Private Properties | Methods | Protected Methods
dotsReadableEyeEyelink Class Reference

Overview

Reads Eyelink gaze and pupil size data.

dotsReadableEyeEyelink extends the dotsReadableEye superclass to acquire point of gaze and pupil size data from an Eyelink eye tracker.

It relies on mglEyelink functions which are part of the mgl project.

Inheritance diagram for dotsReadableEyeEyelink:
Inheritance graph
[legend]

Properties and Events

Property eyelinkIP = '100.1.1.1'
 IP address of the Eyelink machine.
 
Property defaultFilename = 'dotseye.edf'
 Default filename on eyelink machine.
 
Property waitForModeReadyTime = 50
 Time for eyelink to switch to new mode (msec)
 
 ELcalibration
 Calibration properties for Eyelink.
 
- Properties and Events inherited from dotsReadableEye
Property x
 the current "x" position of the eye in user-defined coordinates.
 
Property y
 the current "y" position of the eye in user-defined coordinates.
 
Property pupil
 the current pupil size, offset and scaled
 
Property time
 The time of the most-recent sample (in ui time)
 
Property sampleFrequency
 frequency in Hz of eye tracker data samples More...
 
Property readEventsOnly = true
 Flag determining whether only to read event data see readNewData for details. More...
 
Property helpers
 helper objects including screen ensemble
 
 gazeMonitor
 Gaze monitor properties.
 
- Properties and Events inherited from dotsReadable
Property isAvailable = false
 

whether or not the object is ready to read() from


 
Property components
 

struct array with details about each component


 
Property state
 

matrix of ID, latest value, and latest time indexed by ID


 
Property history
 

matrix of component ID, value, and time from previous read()


 
Property isAutoRead = true
 

whether or not to to invoke read() during getValue(), etc.


 
Property eventDefinitions
 

struct array defining events of interest, indexed by ID


 
Property initialEventQueueSize = 100
 

initial size of queue for events of interest


 
Property clockFunction
 

any function that returns the current time as a number


 
Property filename
 

name of the data file for devices that store their own data


 
Property filepath
 

where the file is


 
Property recordDuringCalibration = true
 

controls whether or not to stop recording during calibration


 
Property useGUI = false
 Flag to use GUI for feedback, etc.
 
Property useExistingCalibration = false
 Flag to skip calibration routine.
 
Property calibrationUI
 Possibly use a keyboard or other UI to help with calibration.
 
Property deactivateEventsAtStartTrial =false
 Flag to deactivate all events at the beginning of each trial.
 

Private Properties

Property trackedEye = []
 Public properties. More...
 
Property calibrationPlayables = {}
 Playable objects for calibration feedback tones.
 
Property windowCtr = []
 Center of window rect for converting screen coordinates into deg vis ang.
 
Property pixelsPerDegree = []
 Pixels per degree for converting screen coordinates into deg vis ang.
 
 eyelinkVals
 Return values from Eyelink.
 
Property blankData
 tracker sending playback data More...
 

Methods

self dotsReadableEyeEyelink ()
 Protected properties. More...
 
time getDeviceTime (self)
 Get the current time value from Eyelink. Units are in seconds.
 
dataMatrix tags readRawDataFromFile (self, filenameWithPath)
 readDataFromFile More...
 
- Methods inherited from dotsReadable
self dotsReadable ()
 

Constructor takes no arguments.


 
 initialize (self)
 

Locate, acquire, configure, etc. device and component resources.


 
 calibrate (self, varargin)
 

Calibrate the device

More...
 
 record (self, onFlag, filename)
 

Open/close data file associated with the device Arguments: onFlag ...

More...
 
 reset (self, varargin)
 reset device More...
 
 close (self)
 

Release any resources acquired by initialize().


 
 delete (self)
 

Automatically close when Matlab is done with this object.


 
 read (self)
 

Add incoming data to history and detect events of interest.

More...
 
 flushData (self, waitForNoEvents)
 

Delete historical data and reset the current state.

More...
 
 logData (self)
 

Record current and historical data in topsDataLog.

More...
 
stateAtTime getState (self, time)
 

Get the state of device components as of the given time.

More...
 
value data getValue (self, ID)
 

Get the latest value for the given component.

More...
 
event defineEvent (self, name, varargin)
 

Define the event of interest for one of the input components.

More...
 
 defineEventsFromComponents (self, names, varargin)
 defineEventsFromComponents More...
 
 defineEventsFromStruct (self, eventStruct, setName, keepExisting, inactivate)
 defineEventsFromStruct More...
 
 showActiveEvents (self)
 Mostly for debugging.
 
 activateEventSet (self, name)
 Swap in a set of events.
 
 activateEvents (self)
 Activate all events. More...
 
 deactivateEvents (self)
 Deactivate all events. More...
 
activeFlags getActiveFlags (self)
 Get all active flags.
 
 setActiveFlags (self, activeFlags)
 Set all active flags from array.
 
 setEventsActiveFlag (self, activateList, deactivateList)
 Set/unset activeFlag. More...
 
name data getNextEvent (self, isPeek, acceptedEvents)
 

Get the next event that was detected in read().

More...
 
lastName lastID names IDs getHappeningEvent (self, time)
 

Get events that are happening at the current time.

More...
 
name waitTime data waitForEvents (self, eventNames, maxWait)
 Wait for event(s)
 
nEvents getNumberOfEvents (self)
 

Get the number of events in eventQueue.

More...
 
IDs getComponentIDs (self)
 

Get an array of unique integer component IDs.

More...
 
ID getComponentID (self, nameOrID)
 

Get ID of component by name or ID


 
name getComponentName (self, nameOrID)
 

Get name of component by name or ID


 
indices getComponentIndicesByID (self, IDs)
 

Get array of indices for the given component IDs


 
indices getComponentIndicesByName (self, names)
 

Get array of indices for the given component names


 
time getDeviceTime (self)
 

Get the current time from clockFunction.


 
 setDeviceTime (self, val)
 

Set the device time


 
 startTrial (self, varargin)
 

startTrial()

More...
 
 finishTrial (self, varargin)
 

finishTrial()

More...
 
 plotData (self)
 

Open a figure with continuously read device data.

More...
 
 startTrialDevice (self, varargin)
 Overloaded methods.
 

Protected Methods

isOpen openDevice (self)
 Public methods. More...
 
 closeDevice (self)
 openDevice More...
 
status calibrateNow (self)
 closeDevice More...
 
status calibrateValidate (self, mode, autoTrigger)
 calibrateValidate More...
 
 driftCorrect (self, xy, drawTarget)
 Drift correction. More...
 
isRecording startRecording (self)
 drift correct More...
 
isRecording stopRecording (self)
 startRecording More...
 
newData readRawEyeData (self)
 stopRecording More...
 
xyt transformRawData (self, xyt)
 readRawEyeData More...
 
- Protected Methods inherited from dotsReadable
isOpen openDevice (self)
 

Locate and acquire input device resources (for subclasses).

More...
 
 closeDevice (self)
 

Release input device resources (for subclasses).

More...
 
 resetDevice (self, varargin)
 Reset the device.
 
status calibrateDevice (self, varargin)
 

Calibrate the device (for subclasses).

More...
 
isRecording startRecording (self)
 

Turn on data recording from the device (for subclasses).


 
isRecording stopRecording (self)
 

Turn off data recording from the device (for subclasses).


 
components openComponents (self)
 

Locate and acquire device components (for subclasses).

More...
 
 closeComponents (self)
 

Release device components (for subclasses).

More...
 
newData readNewData (self)
 

Read and format incoming data (for subclasses).

More...
 
isEvent detectEvents (self, data)
 

Use new data to look up events of interest (used internally).

More...
 
newSize resizeEventQueue (self, minSize, doClear)
 

Resize and optionally clear the event queue (used internally).

More...
 
nEvents enqueueEvents (self, eventValues)
 

Add events of interest to the event queue (used internally).

More...
 
eventValue nEvents dequeueEvent (self, isPeek)
 

Remove the next queued event of interest (used internally).

More...
 

Additional Inherited Members

- Protected Properties inherited from dotsReadable
Property eventQueue
 

array of queued events (row indices into history)


 
Property queueNext
 

queue index of the next event to be dequeued


 
Property queueLast =0
 

queue index of the last event enqueued


 
Property isRecording =false
 

keep track of whether device is currenly writing to a data file


 
Property didCalibrate = true
 Keep track of whether calibration occurs.
 
Property defaultEventPrefix = 'event'
 Default prefix for event names: <prefix>_<componentName>
 
Property eventSets
 Strutures with different named event definitions, in case we want to quickly swap between them.
 
- Static Methods inherited from dotsReadable
static isHappening data readable isEventHappening (readables, eventName)
 

Is the named event happening now?

More...
 
static didHappen waitTime data readable name waitForEvent (readables, eventName, maxWait)
 

Wait for the named event to happen.

More...
 
static data loadDataFile (filename, varargin)
 Load data from file. More...
 

Constructor

◆ dotsReadableEyeEyelink()

Protected properties.

Constructor takes no arguments.

Methods

◆ readRawDataFromFile()

dataMatrix tags readRawDataFromFile ( self  ,
filenameWithPath   
)

readDataFromFile

Utility for reading data from an eyelink file dataPath is string pathname to where the pupil-labs folder is Returns data matrix, rows are times, columns are:

  1. timestamp
  2. gaze x
  3. gaze y
  4. confidence

◆ openDevice()

isOpen openDevice ( self  )
protected

Public methods.

Acquire Eyelink resources.

◆ closeDevice()

closeDevice ( self  )
protected

openDevice

Release Eyelink resources.

◆ calibrateNow()

status calibrateNow ( self  )
protected

closeDevice

Calibrate the eye tracker Returns status: 0 for error, 1 for good calibration

◆ calibrateValidate()

status calibrateValidate ( self  ,
mode  ,
autoTrigger   
)
protected

calibrateValidate

Perform calibration or validation procedure

◆ driftCorrect()

driftCorrect ( self  ,
xy  ,
drawTarget   
)
protected

Drift correction.

Optional arguments are: xy ... [x,y] referent location drawTarget ... flag to draw target at xy

◆ startRecording()

isRecording startRecording ( self  )
protected

drift correct

Overloaded startRecording method

◆ stopRecording()

isRecording stopRecording ( self  )
protected

startRecording

Overloaded stopRecording method

◆ readRawEyeData()

newData readRawEyeData ( self  )
protected

stopRecording

% Read raw Eyelink data. Reads out the current data sample from Eyelink, for on-line checking. NOTE: possibly update to read buffered data, if we end up missing samples. Otherwise, it might not be worth it to get all the buffered data – here we are just typically checking for task flow control, note that the full data set is stored on the eyelink computer. New samples are converted to the dotsReadable three-column style as:

  • [xID, x, timestamp]
  • [yID, y, timestamp]
  • [pupilID, pupilSize, timestamp] where timestamp is pulled from the new sample and is from the eyelink clock.

◆ transformRawData()

xyt transformRawData ( self  ,
xyt   
)
protected

readRawEyeData

% Transform data into screen coordinates

Properties and Events

◆ trackedEye

Property trackedEye = []
private

Public properties.

Which eye are we tracking?

◆ blankData

Property blankData
private

tracker sending playback data

dummy for returning vals


The documentation for this class was generated from the following file: