Package: py-smite
SMITE is a toolbox for using eye trackers from SMI GmbH with Python,
specifically offering integration with PsychoPy. A Matlab version
that integrates with Psychtoolbox is also available fromhttps://github.com/dcnieho/SMITECite as:Niehorster, D.C., & Nyström, M., (2019). SMITE: A
toolbox for creating Psychtoolbox and Psychopy experiments with SMI eye
trackers. doi: 10.3758/s13428-019-01226-0.For questions, bug reports or to check for updates, please visitwww.github.com/marcus-nystrom/SMITE.SMITE is licensed under the Creative Commons Attribution 4.0 (CC BY 4.0) license.demos/read_me.pyshows a minimal example of using the toolbox's
functionality.Tested on Windows using PsychoPy with Python 2.7. Also tested with PsychoPy3 (Python 3.6, but see issues below)To get startedIf you know what you are doing, install SMITE using:pip install py-smiteorpython -m pip install py-smite.If you use a standalone PsychoPy installation, do the following steps:Go toC:\Program Files\PsychoPy(or wherever you installed PsychoPy) and open a command prompt in the same folder as where you findpython.exe(should be the main PsychoPy install folder). So the command prompt you have should start with something likeC:\Program Files\PsychoPy>Here you can then pip-install py-smite, by issuing a command likepython -m pip install py-smite --upgrade.Then runread_me.pyfrom the 'examples' folder. Reading throughread_me.pyshould provide a good starting point for most users of SMITE.UsageAs demonstrated in the demo scripts, the toolbox is configured through
the following interface:retrieve (default) settings for eye tracker of interest:settings = SMITE.get_defaults('trackerName');Supported tracker Names areHiSpeed,RED,REDm,RED250mobile,REDn_Scientific, andREDn_Professional.edit settings if wantedinitialize SMITE using this settings struct: `EThndl = SMITE(settings)APIMethodsThe following method calls are available on a SMITE instanceCallinputsoutputsdescriptionget_options()settings: module with current settingsGet settingsinit()Connect to the SMI eye tracker and initialize it according to the requested settingsis_connected()status: SMI status code (int). For its meaning, see the iView API documentation.Report status of the connection to the eye trackercalibrate()win: window pointer to PsychoPy screen where the calibration stimulus should be shown. See visual.Window()Do participant setup, calibration and validationstart_recording()clear_buffer: optional. Boolean indicating whether the IDF file buffer should be cleared before recording starts or not. This clears all already recorded data from the idf file, so set totruewith cautionStart recording eye-movement data to idf filestart_buffer()sample_buffer_length: optional. Size in number of samples of recording buffer.Start recording eye-movement data into buffer for online usesend_message()msg: Message to be written into idf fileInsert message into idf fileget_latest_sample()sample:struct arrayGet most recent data sampleconsume_buffer_data()list of samplesGet data from the online buffer. The returned samples are removed from the bufferpeek_buffer_data()list of samplesGet data from the online buffer. The returned samples remain in the bufferstop_buffer()clear_buffer: optional. Boolean indicating whether the online buffer should be clearedStop recording data into bufferstop_recording()Stop recording data into idf filesave_data()filename: filename (including path) where idf file will be storeduser: optional. Indentifier that gets placed in idf file headerdescription: optional. Description that gets placed in idf file headerappend_version: optional. Boolean indicating whether version numbers (_1,_2, etc) will automatically get appended to the filename if the destination file already existsSave idf file to specified locationde_init()close: optional. Boolean indicating whether the iView eye tracker server should be shut downClose connection to the eye tracker and clean upset_begaze_trial_image()filename: filename of stimulus that is shown on this trial. Must have one of the following extentions:.png,.jpg,.jpeg,.bmp, or.aviPut specially prepared message in idf file to notify BeGaze what stimulus image/video belongs to a trialset_begaze_key_press()string: string that will show up on BeGaze's event timeline. Can be name of a key, but also other arbitrary stringPut specially prepared message in idf file that shows up as keypress in BeGazeset_begaze_mouse_click()which: string indicating which mouse button,leftorrightx: horizontal pixel coordinate of mouse clicky: vertical coordinate of mouse clickPut specially prepared message in idf file that shows up as mouse click in BeGazestart_eye_image_recording()filename: filename where recorded eye images will be savedformat: format to store eye images in, must be one of:jpg,bmp,xvid,huffyuv,alpary,xmp4duration: optional. If provided, runs eye image recording for this many secondsStart recording eye images to file. Not supported onRED250mobile,REDn Scientific, andREDn Professionalstop_eye_image_recording()Stop recording eye images to fileset_dummy_mode()Enable dummy mode, which allows running the program without an eye tracker connectedToDos (current discrepancies between the paper and the toolbox):File transfer in two computer setups not implementeddo_flip_eye not implemented (fixes a bug in older versions of iViewX, e.g., v. 2.7.13, where left and right eyes are flipped)get_options returns all settings. set_options does nothing. This means that it's currently up to the user not to use functionally that is not available during recording (for instance changing the sampling frequency of the eye tracker).Images returned from the API look strange when using PsychoPy3. Affects validation screen and eye images.