SMITE is a toolbox for using eye trackers from SMI GmbH with MATLAB, specifically offering integration with PsychToolbox. A Python version that integrates with PsychoPy is also available from www.github.com/marcus-nystrom/SMITE. For a similar toolbox for Tobii eye trackers, please see www.github.com/dcnieho/Titta.
For questions, bug reports or to check for updates, please visit www.github.com/dcnieho/SMITE.
SMITE is licensed under the Creative Commons Attribution 4.0 (CC BY 4.0) license.
demos/readme.m
shows a minimal example of using the toolbox's
functionality.
To run the toolbox, it is required to install the SMI iViewX SDK version 4.4.26. An up-to-date version of PsychToolbox is recommended. Make sure PsychToolbox's GStreamer dependency is installed.
Tested on MATLAB R2015b & R2018a. Octave is currently not supported.
As demonstrated in the demo scripts, the toolbox is configured through the following interface:
- Retrieve (default) settings for eye tracker of interest:
settings = SMITE.getDefaults('trackerName');
Supported tracker model names areHiSpeed
,RED
,RED-m
,RED250mobile
,REDn Scientific
, andREDn Professional
. - Change settings from their defaults if wanted (see supported options section below)
- Create a SMITE instance using this settings struct:
EThndl = SMITE(settings);
The below method can be called on a SMITE instance or on the SMITE class directly.
Call | inputs | outputs | description |
---|---|---|---|
getDefaults |
|
|
Gets all supported settings with defaulted values for the indicated eyeTracker, can be modified and used for constructing an instance of SMITE. See the supported options section below. |
An instance of SMITE is constructed by calling SMITE()
with either the name of a specific supported eye tracker model (in which case default settings for this model will be used) or with a settings struct retrieved from SMITE.getDefaults()
, possibly with changed settings (passing the settings struct unchanged is equivalent to using the eye tracker model name as input argument).
The following method calls are available on a SMITE instance
Call | inputs | outputs | description |
---|---|---|---|
getOptions() |
|
Get active settings, returns only those that can be changed in the current state (which is a subset of all settings once init() has been called) |
|
setOptions() |
|
Change active settings. First use getOptions() to get an up-to-date settings struct, then edit the wanted settings and use this function to set them |
|
init() |
Connect to the SMI eye tracker and initialize it according to the requested settings | ||
isConnected() |
|
Report status of the connection to the eye tracker | |
calibrate() |
|
|
Do participant setup, calibration and validation |
startRecording() |
|
Start recording eye-movement data to idf file | |
startBuffer() |
|
Start recording eye-movement data into buffer for online use | |
sendMessage() |
|
Insert message into idf file | |
getLatestSample() |
Get most recent data sample | ||
consumeBufferData() |
|
|
Get data from the online buffer. The returned samples are removed from the buffer |
peekBufferData() |
|
|
Get data from the online buffer. The returned samples remain in the buffer |
stopBuffer() |
|
Stop recording data into buffer | |
stopRecording() |
Stop recording data into idf file | ||
saveData() |
|
Save idf file to specified location | |
deInit() |
|
Close connection to the eye tracker and clean up | |
setBegazeTrialImage() |
|
Put specially prepared message in idf file to notify BeGaze what stimulus image/video belongs to a trial | |
setBegazeKeyPress() |
|
Put specially prepared message in idf file that shows up as keypress in BeGaze | |
setBegazeMouseClick() |
|
Put specially prepared message in idf file that shows up as mouse click in BeGaze | |
startEyeImageRecording() |
|
Start recording eye images to file. Not supported on RED250mobile , REDn Scientific , and REDn Professional |
|
stopEyeImageRecording() |
Stop recording eye images to file | ||
setDummyMode() |
|
Enable dummy mode, which allows running the program without an eye tracker connected |
Which of the below options are available depends on the eye tracker model. The getDefaults()
and getOptions()
method calls return the appropriate set of options for the indicated eye tracker.
Option name | Explanation |
---|---|
settings.trackEye | 'EYE_LEFT' , 'EYE_RIGHT' , or 'EYE_BOTH' |
settings.trackMode | 'MONOCULAR' , 'BINOCULAR' , 'SMARTBINOCULAR' , or 'SMARTTRACKING' |
settings.freq | sampling frequency |
settings.cal.nPoint | number of calibration points |
settings.doAverageEyes | average the gaze position of the two eyes? |
settings.setup.viewingDist | for all remotes: set reference view distance used during setup |
settings.setup.geomMode | for REDs, monitorIntegrated or standalone |
settings.setup.monitorSize | inch, for REDs in monitorIntegrated mode |
settings.setup.geomProfile | 'profileName' , for REDs in standalone mode, and for RED-m, RED250mobile and REDn |
settings.setup.scrWidth | for REDs in standalone mode |
settings.setup.scrHeight | for REDs in standalone mode |
settings.setup.scrDistToFloor | for REDs in standalone mode |
settings.setup.REDDistToFloor | for REDs in standalone mode |
settings.setup.REDDistToScreen | for REDs in standalone mode |
settings.setup.REDInclAngle | for REDs in standalone mode |
settings.start.removeTempDataFile | when calling iV_Start , iView always complains with a popup if there is some unsaved recorded data in iView's temp location. The popup can really mess with visual timing of PTB, so its best to remove it. Not relevant for a two computer setup |
settings.setup.startScreen | 0: skip head positioning, go straight to calibration; 1: start with simple head positioning interface; 2: start with advanced head positioning interface |
settings.setup.basicRefColor | basic head position visualization: color of reference circle |
settings.setup.basicHeadEdgeColor | basic head position visualization: color of egde of disk representing head |
settings.setup.basicHeadFillColor | basic head position visualization: color of fill of disk representing head |
settings.setup.basicHeadFillOpacity | basic head position visualization: opacity of disk representing head |
settings.setup.basicShowEyes | basic head position visualization: show eyes? |
settings.setup.basicEyeColor | basic head position visualization: color of eyes in head |
settings.setup.valAccuracyTextColor | color of text displaying accuracy number on validation feedback screen |
settings.cal.autoPace | 0: manually confirm each calibration point. 1: only manually confirm the first point, the rest will be autoaccepted. 2: all calibration points will be auto-accepted |
settings.cal.bgColor | RGB (0-255) background color for setup/calibration |
settings.cal.fixBackSize | size (pixels) of large circle in fixation cross |
settings.cal.fixFrontSize | size (pixels) of small circle in fixation cross |
settings.cal.fixBackColor | color (RGB, 0-255) of large circle in fixation cross |
settings.cal.fixFrontColor | color (RGB, 0-255) of large circle in fixation cross |
settings.cal.drawFunction | function to be called to draw calibration screen. See the AnimatedCalibrationDisplay class packaged with SMITE for an example |
settings.cal.rangeX | horizontal extent of calibration area, defaults to whole screen |
settings.cal.rangeY | vertical extent of calibration area, defaults to whole screen |
settings.cal.offsetX | location of left of calibration area in pixels, defaults to calibration area that is centered on the screen. negative is leftward, positive rightward offset |
settings.cal.offsetY | location of top of calibration area in pixels, defaults to calibration area that is centered on the screen. negative is upward, positive downward offset |
settings.text.font | font name for text in interface, e.g. 'Consolas' |
settings.text.style | style for text in interface. The following can ORed together: 0=normal, 1=bold, 2=italic, 4=underline, 8=outline, 32=condense, 64=extend |
settings.text.wrapAt | long texts in interface will be wrapped at this many characters |
settings.text.vSpacing | vertical space between lines. 1 is normal |
settings.text.size | text size (pt) |
settings.string.simplePositionInstruction | text shown on simple head positioning interface |
settings.logFileName | filename where SMI log is stored |
settings.debugMode | only for SMITE developer use |