Opticka 2.16.1
Opticka is an experiment manager for behavioral research.
Loading...
Searching...
No Matches
eyelinkManager Class Reference

eyelinkManager wraps around the eyelink toolbox functions offering a consistent interface and methods for fixation window control. See eyetrackerCore for the common methods that handle fixation windows etc. More...

Detailed Description

eyelinkManager wraps around the eyelink toolbox functions offering a consistent interface and methods for fixation window control. See eyetrackerCore for the common methods that handle fixation windows etc.

Copyright ©2014-2023 Ian Max Andolina — released: LGPL3, see LICENCE.md

Inheritance diagram for eyelinkManager:

Public Member Functions

function eyelinkManager (in varargin)
 This is the constructor for this class.
 
function initialise (in me, in sM)
 initialise the eyelink with the screenManager object, setting up the calibration options and opening the EDF file if me.recordData is true.
 
function updateDefaults (in me)
 whenever you change me.defaults you should run this to update the eyelink toolbox
 
function checkConnection (in me)
 check the connection with the eyelink is valid
 
function trackerSetup (in me)
 runs the calibration and validation
 
function startRecording (in me, in ignoredArg)
 
function stopRecording (in me, in ignoredArg)
 wrapper for StartRecording
 
function setOffline (in me)
 wrapper for StopRecording
 
function driftCorrection (in me)
 set into offline / idle mode
 
function checkRecording (in me)
 wrapper for EyelinkDoDriftCorrection
 
function getSample (in me)
 
function checkEye (in me)
 
function statusMessage (in me, in message)
 checks which eye is available, force left eye if binocular is enabled
 
function trackerMessage (in me, in message, in varargin)
 displays status message on tracker, only sets it if message is not the previous message, so loop safe.
 
function close (in me)
 send message to store in EDF data
 
function trackerClearScreen (in me)
 close the eyelink and cleanup, send EDF file if recording is enabled
 
function trackerDrawStatus (in me, in comment, in ts, in dontClear)
 draw the background colour
 
function trackerDrawStimuli (in me, in ts, in dontClear, in convertToPixels)
 draw general status
 
function trackerDrawFixation (in me)
 draw the stimuli boxes on the tracker display
 
function trackerDrawExclusion (in me)
 draw the fixation box on the tracker display
 
function trackerDrawText (in me, in textIn)
 draw the fixation box on the tracker display
 
function currentMode (in me)
 draw the fixation box on the tracker display
 
function syncTime (in me)
 check what mode the eyelink is in
 
function getTimeOffset (in me)
 Sync time message for EDF file.
 
function getTrackerTime (in me)
 Get offset between tracker and display computers.
 
function runDemo (in me, in forcescreen)
 Get offset between tracker and display computers.
 
function trackerDrawEyePosition (in ignoredArg, in varargin)
 runs a demo of the eyelink, tests this class
 
function trackerDrawEyePositions (in ignoredArg, in varargin)
 
function trackerFlip (in ignoredArg, in varargin)
 
function getEvent (in me)
 
function saveData (in me, in args)
 TODO.
 
function edfMessage (in me, in message)
 compatibility with tobiiManager
 
- Public Member Functions inherited from eyetrackerCore
virtual initialise (in in)
 ALL Children must implement these methods!
 
virtual startRecording (in in)
 
virtual stopRecording (in in)
 
virtual trackerMessage (in in)
 
virtual statusMessage (in in)
 
virtual runDemo (in in)
 
function eyetrackerCore (in varargin)
 This is the constructor for this class.
 
function getMouseSample (in me)
 get mouse sample as eye data
 
function resetAll (in me)
 reset all fixation/exclusion data
 
function resetFixation (in me, in removeHistory)
 reset the fixation counters ready for a new trial
 
function resetExclusionZones (in me)
 reset the exclusion state ready for a new trial
 
function resetFixationTime (in me)
 reset the fixation time ready for a new trial
 
function resetFixationHistory (in me)
 reset the recent fixation history: xAll yAll pupilAll
 
function resetFixInit (in me)
 reset the fixation initiation to 0
 
function resetOffset (in me)
 reset the fixation offset to 0
 
function driftOffset (in me)
 our own version of eyelink's drift correct
 
function updateFixationValues (in me, in x, in y, in inittime, in fixtime, in radius, in strict)
 
function updateExclusionZones (in me, in x, in y, in radius)
 Sinlge method to update the exclusion zones, can pass multiple x & y values for multiple exclusion zones, sharing the same radius.
 
function isFixated (in me)
 isFixated tests for fixation and updates the fixLength time
 
function testExclusion (in me)
 testExclusion
 
function testSearchHoldFixation (in me, in yesString, in noString)
 Checks for both searching and then maintaining fix. Input is 2 strings, either one is returned depending on success or failure, 'searching' may also be returned meaning the fixation window hasn't been entered yet, and 'fixing' means the fixation time is not yet met... 'blinking' can be returned when ignoreBlinks = true and we think a blink may be occuring.
 
function testHoldFixation (in me, in yesString, in noString)
 Checks if we're still within fix window. Input is 2 strings, either one is returned depending on success or failure, 'fixing' means the fixation time is not yet met...
 
function testWithinFixationWindow (in me, in yesString, in noString)
 testWithinFixationWindow simply tests we are in fixwindow
 
function testFixationTime (in me, in yesString, in noString)
 Checks if we've maintained fixation for correct time, if true return yesString, if not return noString. This allows an external code to quickly select a string based on this. Use.
 
function checkEye (in me)
 checks which eye is available, force left eye if binocular is enabled
 
function drawEyePosition (in me, in ignoredArg)
 draw the current eye position on the main PTB display
 
function drawEyePositions (in me)
 draw the sampled eye positions in xAll yAll on the subject screen
 
function trackerTrialStart (in me, in trialNumber, in task, in stimuli)
 Send trial start information to tracker.
 
function trackerTrialEnd (in me, in result)
 Send trial end information to tracker.
 
function trackerClearScreen (in me)
 draw the background colour
 
function trackerFlip (in me, in dontclear, in force)
 flip the tracker display, always use dontsync
 
function trackerDrawStatus (in me, in comment, in stimPos, in dontClear, in dontFlip)
 draw general status
 
function trackerDrawStimuli (in me, in ts, in dontClear)
 draw the stimuli boxes on the tracker display
 
function trackerDrawFixation (in me)
 draw the fixation box on the tracker display
 
function trackerDrawExclusion (in me)
 draw the fixation box on the tracker display
 
function trackerDrawEyePosition (in me)
 draw the fixation position on the tracker display
 
function trackerDrawEyePositions (in me)
 draw the sampled eye positions in xAll yAll
 
function trackerDrawText (in me, in textIn)
 draw the fixation box on the tracker display
 
function doFlip (in me)
 
function edfMessage (in me, in message)
 send message to store in EDF data
 
function getEvent (in me)
 TODO.
 
function saveData (in me, in args)
 compatibility with tobiiManager
 
- Public Member Functions inherited from optickaCore
function optickaCore (in varargin)
 Class constructor.
 
function get fullName (in me)
 
function getALF (in me, in subject, in sessionPrefix, in lab, in create)
 
function findAttributes (in me, in attrName, in attrValue)
 
function findAttributesandType (in me, in attrName, in attrValue, in type)
 find properties of object with specific attributes, for example all properties whose GetAcccess attribute is public and type is logical.
 
function findPropertyDefault (in me, in propName)
 
function clone (in me)
 Use this syntax to make a deep copy of the object, i.e. OBJ_OUT has the same field values, but will not behave as a handle-copy of me anymore.
 
function checkSuperclasses (in List)
 
function editProperties (in me, in properties)
 method to modify a set of properties
 
function setProp (in me, in property, in value)
 method to fast change a particular value. This is useful for use in anonymous functions, like in the state machine.
 
function initialiseGlobals (in me, in doReset, in doOpen)
 
function initialiseSaveFile (in me)
 Initialise Save prefix.
 
function checkPaths (in me)
 checks the paths are valid
 

Public Attributes

Property type
 type of eyetracker
 
Property calibration
 properties to setup and modify calibration
 
Property defaults
 eyetracker defaults structure
 
Property verbosityLevel
 verbosity level
 
Property forceDriftCorrect
 force drift correction?
 
Property driftMaximum
 drift correct max
 
Property customTarget
 custom calibration target
 
Property MISSING_DATA
 
Property tempFile
 
Property error
 
Property previousMessage
 previous message sent to eyelink
 
- Public Attributes inherited from eyetrackerCore
Property type
 type of eyetracker
 
Property fixation
 
Property exclusionZone
 
Property fixInit
 
Property offset
 
Property sampleRate
 tracker update speed (Hz)
 
Property isDummy
 start eyetracker in dummy mode?
 
Property recordData
 do we record and/or retrieve eyetracker data with remote interface?
 
Property useOperatorScreen
 use an operator screen for online display etc.
 
Property ignoreBlinks
 
Property saveFile
 name of eyetracker EDF file
 
Property subjectName
 subject name
 
Property verbose
 do we log debug messages to the command window?
 
Property calibration
 info for setup / calibration
 
Property stimulusPositions
 stimulus positions to draw on screen
 
Property screen
 the PTB screen to work on, passed in during initialise
 
Property operatorScreen
 operator screen used during calibration
 
Property win
 the PTB screen handle, normally set by screenManager but can force it to use another screen
 
Property secondScreen
 is operator screen being used?
 
Property eyeSize
 size to draw eye position on screen
 
Property skipFlips
 for trackerFlip, we can only flip every X frames
 
Property isOff
 make the eyetracker not useable
 
Property debug
 lots of logging if debug = true
 
Property x
 Gaze X position in degrees.
 
Property y
 Gaze Y position in degrees.
 
Property pupil
 pupil size
 
Property isFix
 last isFixated true/false result
 
Property isInitFail
 did the fixInit test fail or not?
 
Property isBlink
 are we in a blink?
 
Property isExclusion
 are we in an exclusion zone?
 
Property fixTotal
 total time searching for and holding fixation
 
Property fixInitLength
 Initiate fixation length.
 
Property fixLength
 how long have we been in the fixation window?
 
Property fixBuffer
 when ~strict, we accumulate the total time in the window
 
Property fixInitStartTime
 Initiate fixation time.
 
Property fixStartTime
 
Property fixWindow
 which fixation window matched the last fixation?
 
Property currentOffset
 last time offset betweeen tracker and display computers
 
Property trackerTime
 tracker time stamp
 
Property currentSample
 
Property currentEvent
 
Property isConnected
 
Property isRecording
 
Property eyeUsed
 
Property version
 
Property xAll
 All gaze X position in degrees reset using resetFixation.
 
Property yAll
 Last gaze Y position in degrees reset using resetFixation.
 
Property pupilAll
 all pupil size reset using resetFixation
 
Property data
 data streamed out from the Tobii
 
Property validationData
 validation data
 
Property xAllRaw
 
Property yAllRaw
 
Property flipTick
 flipTick
 
Property sampleTemplate
 currentSample template
 
Property ppd_
 
Property fixN
 
Property fixSelection
 
Property allowedPropertiesBase
 allowed properties passed to object upon construction
 
- Public Attributes inherited from optickaCore
Property name
 object name
 
Property comment
 comment
 
Property verbose
 verbose logging, subclasses must assign this. This is normally logical true/false
 
Property dateStamp
 clock() dateStamp set on construction
 
Property uuid
 universal ID
 
Property paths
 storage of various paths
 
Property fullName
 The fullName is the object name combined with its uuid and class name.
 

Protected Attributes

Property allowedProperties
 allowed properties passed to object upon construction
 
- Protected Attributes inherited from optickaCore
Property cloning
 are we cloning this from another object
 
Property mversion
 Matlab version number, this is transient so it is not saved.
 
Property sansFont
 sans font
 
Property monoFont
 monoFont
 
Property className
 class name
 
Property savePrefix
 save prefix generated from clock time
 
Property fullName_
 cached full name
 

Additional Inherited Members

- Static Public Member Functions inherited from optickaCore
static function makeArgs (in args)
 Converts cell args to structure array.
 
static function addDefaults (in args, in defs)
 add default options to arg input
 
static function hasKey (in in, in key)
 check if a struct / object has a propery / field
 
static function getKeys (in device)
 PTB Get key presses, stops key bouncing.
 
- Protected Member Functions inherited from eyetrackerCore
function drawValidationResults (in me, in n)
 
function toDegrees (in me, in in, in axis, in inputtype)
 to visual degrees from pixels
 
function toPixels (in me, in in, in axis, in inputtype)
 to pixels from visual degrees / relative input can be [x] [y] [-x -y +x +y]('rect') [xy] or [-x +x -y +y]
 
- Protected Member Functions inherited from optickaCore
function parseArgs (in me, in args, in allowedProperties)
 Sets properties from a structure or normal arguments pairs, ignores invalid or non-allowed properties.
 
function addArgs (in me, in args)
 
function setPaths (in me)
 Sets properties from a structure or normal arguments pairs, ignores invalid or non-allowed properties.
 
function getFonts (in me)
 set paths for object
 
function toStructure (in me)
 Converts properties to a structure.
 
function getType (in me, in in)
 
function logOutput (in me, in in, in message, in override)
 Give a metaproperty return the likely property class.
 
function salutation (in me, in varargin)
 Prints messages dependent on verbosity.
 

Constructor & Destructor Documentation

◆ eyelinkManager()

eyelinkManager::eyelinkManager ( in  varargin)

This is the constructor for this class.

Member Function Documentation

◆ checkConnection()

eyelinkManager::checkConnection ( in  me)
virtual

check the connection with the eyelink is valid

Reimplemented from eyetrackerCore.

◆ checkEye()

function eyelinkManager::checkEye ( in  me)

◆ checkRecording()

eyelinkManager::checkRecording ( in  me)

wrapper for EyelinkDoDriftCorrection

Wrapper for CheckRecording

◆ close()

function eyelinkManager::close ( in  me)
virtual

send message to store in EDF data

Reimplemented from eyetrackerCore.

◆ currentMode()

function eyelinkManager::currentMode ( in  me)

draw the fixation box on the tracker display

◆ driftCorrection()

function eyelinkManager::driftCorrection ( in  me)

set into offline / idle mode

◆ edfMessage()

function eyelinkManager::edfMessage ( in  me,
in  message 
)

compatibility with tobiiManager

◆ getEvent()

function eyelinkManager::getEvent ( in  me)

◆ getSample()

eyelinkManager::getSample ( in  me)
virtual

Get a sample from the tracker, if dummymode=true then use the mouse as an eye signal

Reimplemented from eyetrackerCore.

◆ getTimeOffset()

function eyelinkManager::getTimeOffset ( in  me)

Sync time message for EDF file.

◆ getTrackerTime()

function eyelinkManager::getTrackerTime ( in  me)

Get offset between tracker and display computers.

◆ initialise()

eyelinkManager::initialise ( in  me,
in  sM 
)

initialise the eyelink with the screenManager object, setting up the calibration options and opening the EDF file if me.recordData is true.

Parameters
sMscreenManager to link to

◆ runDemo()

function eyelinkManager::runDemo ( in  me,
in  forcescreen 
)

Get offset between tracker and display computers.

◆ saveData()

function eyelinkManager::saveData ( in  me,
in  args 
)

TODO.

◆ setOffline()

function eyelinkManager::setOffline ( in  me)

wrapper for StopRecording

◆ startRecording()

function eyelinkManager::startRecording ( in  me,
in  ignoredArg 
)

◆ statusMessage()

function eyelinkManager::statusMessage ( in  me,
in  message 
)

checks which eye is available, force left eye if binocular is enabled

◆ stopRecording()

function eyelinkManager::stopRecording ( in  me,
in  ignoredArg 
)

wrapper for StartRecording

◆ syncTime()

function eyelinkManager::syncTime ( in  me)

check what mode the eyelink is in

define IN_UNKNOWN_MODE 0

#define IN_IDLE_MODE 1 #define IN_SETUP_MODE 2 #define IN_RECORD_MODE 4 #define IN_TARGET_MODE 8 #define IN_DRIFTCORR_MODE 16 #define IN_IMAGE_MODE 32 #define IN_USER_MENU 64 #define IN_PLAYBACK_MODE 256 #define LINK_TERMINATED_RESULT -100

◆ trackerClearScreen()

function eyelinkManager::trackerClearScreen ( in  me)

close the eyelink and cleanup, send EDF file if recording is enabled

◆ trackerDrawExclusion()

function eyelinkManager::trackerDrawExclusion ( in  me)

draw the fixation box on the tracker display

◆ trackerDrawEyePosition()

function eyelinkManager::trackerDrawEyePosition ( in  ignoredArg,
in  varargin 
)

runs a demo of the eyelink, tests this class

◆ trackerDrawEyePositions()

function eyelinkManager::trackerDrawEyePositions ( in  ignoredArg,
in  varargin 
)

◆ trackerDrawFixation()

function eyelinkManager::trackerDrawFixation ( in  me)

draw the stimuli boxes on the tracker display

◆ trackerDrawStatus()

function eyelinkManager::trackerDrawStatus ( in  me,
in  comment,
in  ts,
in  dontClear 
)

draw the background colour

◆ trackerDrawStimuli()

function eyelinkManager::trackerDrawStimuli ( in  me,
in  ts,
in  dontClear,
in  convertToPixels 
)

draw general status

◆ trackerDrawText()

function eyelinkManager::trackerDrawText ( in  me,
in  textIn 
)

draw the fixation box on the tracker display

◆ trackerFlip()

function eyelinkManager::trackerFlip ( in  ignoredArg,
in  varargin 
)

◆ trackerMessage()

function eyelinkManager::trackerMessage ( in  me,
in  message,
in  varargin 
)

displays status message on tracker, only sets it if message is not the previous message, so loop safe.

◆ trackerSetup()

eyelinkManager::trackerSetup ( in  me)
virtual

runs the calibration and validation

Reimplemented from eyetrackerCore.

◆ updateDefaults()

eyelinkManager::updateDefaults ( in  me)
virtual

whenever you change me.defaults you should run this to update the eyelink toolbox

Reimplemented from eyetrackerCore.

Member Data Documentation

◆ allowedProperties

Property eyelinkManager::allowedProperties
protected

allowed properties passed to object upon construction

◆ calibration

Property eyelinkManager::calibration

properties to setup and modify calibration

◆ customTarget

Property eyelinkManager::customTarget

custom calibration target

◆ defaults

Property eyelinkManager::defaults

eyetracker defaults structure

◆ driftMaximum

Property eyelinkManager::driftMaximum

drift correct max

◆ error

Property eyelinkManager::error

◆ forceDriftCorrect

Property eyelinkManager::forceDriftCorrect

force drift correction?

◆ MISSING_DATA

Property eyelinkManager::MISSING_DATA

◆ previousMessage

Property eyelinkManager::previousMessage

previous message sent to eyelink

◆ tempFile

Property eyelinkManager::tempFile

◆ type

Property eyelinkManager::type

type of eyetracker

◆ verbosityLevel

Property eyelinkManager::verbosityLevel

verbosity level


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