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

Manages the Tobii eyetrackers. More...

Detailed Description

Manages the Tobii eyetrackers.

tobiiManager wraps around the Titta toolbox functions offering a interface consistent with eyelinkManager, offering methods to check and change fixation windows gaze contingent tasks easily.

The core methods enable the user to test for common behavioural eye tracking tasks with single commands. For example, to initiate a task we normally place a fixation cross on the screen and ask the subject to saccade to the cross and maintain fixation for a particular duration. This is achieved using testSearchHoldFixation('yes','no'), using the properties: fixation.initTime to time how long the subject has to saccade into the window, fixation.time for how long they must maintain fixation, fixation.radius for the radius around fixation.X and fixation.Y position. The method returns the 'yes' string if the rules are matched, and 'no' if they are not, thus enabling experiment code to simply define what happened. Other methods include isFixated(), testFixationTime(), testHoldFixation().

Multiple fixation windows can be assigned, and in addition exclusion windows can ensure a subject doesn't saccade to particular parts of the screen. fixInit allows you to define a minimum time with which the subject must initiate a saccade away from a position (which stops a subject cheating).

Todo:
handle new eye-openness signals in new SDK https://developer.tobiipro.com/commonconcepts/eyeopenness.html

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

Inheritance diagram for tobiiManager:

Public Member Functions

function tobiiManager (in varargin)
 
function initialise (in me, in sM, in sM2)
 initialise the tobii.
 
function trackerSetup (in me, in incal)
 sets up the calibration and validation
 
function startRecording (in me, in override)
 wrapper for StartRecording
 
function stopRecording (in me, in override)
 wrapper for StopRecording
 
function getSample (in me)
 get a sample from the tracker, if dummymode=true then use the mouse as an eye signal
 
function drawEyePositions (in me, in dataDur)
 draw N last eye position on the PTB display
 
function saveData (in me, in tofile)
 Save the data.
 
function trackerMessage (in me, in message, in vbl)
 send message to store in tracker data
 
function close (in me)
 close the tobii and cleanup is enabled
 
function updateDefaults (in me)
 
function checkConnection (in me)
 check the connection with the tobii
 
function syncTrackerTime (in me)
 Sync time with tracker.
 
function runTimingTest (in me, in sRate, in interval)
 Train to use tracker.
 
function runDemo (in me, in forcescreen)
 runs a demo of the tobii workflow, testing this class
 
function checkRecording (in me)
 
function checkEye (in me)
 checks which eye is available, force left eye if binocular is enabled
 
function statusMessage (in me, in message)
 displays status message on tracker, only sets it if message is not the previous message, so loop safe.
 
function edfMessage (in me, in message)
 send message to store in tracker data (compatibility)
 
function setup (in me)
 
function setOffline (in me)
 set into offline / idle mode
 
function driftCorrection (in me)
 wrapper for EyelinkDoDriftCorrection
 
function currentMode (in me)
 check what mode the tobii is in
 
function syncTime (in me)
 Sync time with tracker.
 
function getTimeOffset (in me)
 Get offset between tracker and display computers.
 
function getTrackerTime (in me)
 Get tracker time.
 
function getEvent (in me)
 TODO.
 
- Public Member Functions inherited from eyetrackerCore
virtual initialise (in in)
 ALL Children must implement these methods!
 
virtual trackerSetup (in in)
 
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 Member Functions inherited from eyetrackerSmooth
function eyetrackerSmooth ()
 This is the constructor for this class.
 
function get smoothingTime (in me)
 calculate smoothing Time in ms
 
function doSmoothing (in me, in in)
 smooth data in M x N where M = 2 (x&y trace) or M = 4 is x&y for both eyes. Output is 2 x 1 x + y average position
 

Public Attributes

Property type
 type of eyetracker
 
Property calibration
 setup and calibration values
 
Property address
 optional eyetracker address
 
Property settings
 Settings structure from Titta.
 
Property tobii
 Titta class object.
 
Property sampletime
 
Property calib
 last calibration data
 
- 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.
 
- Public Attributes inherited from eyetrackerSmooth
Property smoothing
 options for online smoothing of peeked data
 
Property smoothingTime
 calculates the smoothing in ms
 

Protected Attributes

Property systemTime
 tracker time stamp
 
Property calibData
 
Property calStim
 
Property isCollectedData
 
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.
 
- Static Public Member Functions inherited from eyetrackerSmooth
static function heuristicFilter (in indata, in level, in steps)
 Stampe 1993 heuristic filter as used by Eyelink.
 
- 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

◆ tobiiManager()

tobiiManager::tobiiManager ( in  varargin)

tobiiManager CONSTRUCTOR

Parameters
varargincan be passed as a structure or name,arg pairs
Returns
instance of the class.

Member Function Documentation

◆ checkConnection()

function tobiiManager::checkConnection ( in  me)
virtual

check the connection with the tobii

Reimplemented from eyetrackerCore.

◆ checkEye()

function tobiiManager::checkEye ( in  me)

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

◆ checkRecording()

function tobiiManager::checkRecording ( in  me)

◆ close()

function tobiiManager::close ( in  me)
virtual

close the tobii and cleanup is enabled

Reimplemented from eyetrackerCore.

◆ currentMode()

function tobiiManager::currentMode ( in  me)

check what mode the tobii is in

◆ drawEyePositions()

function tobiiManager::drawEyePositions ( in  me,
in  dataDur 
)

draw N last eye position on the PTB display

◆ driftCorrection()

function tobiiManager::driftCorrection ( in  me)

wrapper for EyelinkDoDriftCorrection

◆ edfMessage()

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

send message to store in tracker data (compatibility)

◆ getEvent()

function tobiiManager::getEvent ( in  me)

TODO.

◆ getSample()

tobiiManager::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 tobiiManager::getTimeOffset ( in  me)

Get offset between tracker and display computers.

◆ getTrackerTime()

function tobiiManager::getTrackerTime ( in  me)

Get tracker time.

◆ initialise()

function tobiiManager::initialise ( in  me,
in  sM,
in  sM2 
)

initialise the tobii.

Parameters
sM- screenManager object we will use
sM2- a second screenManager used during calibration

◆ runDemo()

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

runs a demo of the tobii workflow, testing this class

◆ runTimingTest()

function tobiiManager::runTimingTest ( in  me,
in  sRate,
in  interval 
)

Train to use tracker.

◆ saveData()

function tobiiManager::saveData ( in  me,
in  tofile 
)

Save the data.

◆ setOffline()

function tobiiManager::setOffline ( in  me)

set into offline / idle mode

◆ setup()

function tobiiManager::setup ( in  me)

◆ startRecording()

function tobiiManager::startRecording ( in  me,
in  override 
)

wrapper for StartRecording

Parameters
override- to keep compatibility with the eyelinkManager API we need to only start and stop recording using a passed parameter, as the eyelink requires start and stop on every trial but the tobii does not. So by default without override==true this will just return.

◆ statusMessage()

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

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

◆ stopRecording()

function tobiiManager::stopRecording ( in  me,
in  override 
)

wrapper for StopRecording

Parameters
override- to keep compatibility with the eyelinkManager API we need to only start and stop recording using a passed parameter, as the eyelink requires start and stop on every trial but the tobii does not. So by default without override==true this will just return.

◆ syncTime()

function tobiiManager::syncTime ( in  me)

Sync time with tracker.

◆ syncTrackerTime()

function tobiiManager::syncTrackerTime ( in  me)

Sync time with tracker.

◆ trackerMessage()

function tobiiManager::trackerMessage ( in  me,
in  message,
in  vbl 
)

send message to store in tracker data

◆ trackerSetup()

function tobiiManager::trackerSetup ( in  me,
in  incal 
)

sets up the calibration and validation

◆ updateDefaults()

function tobiiManager::updateDefaults ( in  me)
virtual

Reimplemented from eyetrackerCore.

Member Data Documentation

◆ address

Property tobiiManager::address

optional eyetracker address

◆ allowedProperties

Property tobiiManager::allowedProperties
protected

allowed properties passed to object upon construction

◆ calib

Property tobiiManager::calib

last calibration data

◆ calibData

Property tobiiManager::calibData
protected

◆ calibration

Property tobiiManager::calibration

setup and calibration values

◆ calStim

Property tobiiManager::calStim
protected

◆ isCollectedData

Property tobiiManager::isCollectedData
protected

◆ sampletime

Property tobiiManager::sampletime

◆ settings

Property tobiiManager::settings

Settings structure from Titta.

◆ systemTime

Property tobiiManager::systemTime
protected

tracker time stamp

◆ tobii

Property tobiiManager::tobii

Titta class object.

◆ type

Property tobiiManager::type

type of eyetracker


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