Eyetracker
 
Loading...
Searching...
No Matches
pygaze._eyetracker.libsmi Namespace Reference

Classes

class  SMItracker
 

Functions

 errorstring (returncode)
 
 deg2pix (cmdist, angle, pixpercm)
 
 pupil_size (self)
 
 sample (self)
 
 send_command (self, cmd)
 
 send_message (self, msg)
 
 set_backdrop (self)
 
 set_eye_used (self)
 
 start_recording (self)
 
 status_msg (self, msg)
 
 stop_recording (self)
 
 set_detection_type (self, eventdetection)
 
 wait_for_event (self, event)
 
 wait_for_blink_end (self)
 
 wait_for_blink_start (self)
 
 wait_for_fixation_end (self)
 
 wait_for_fixation_start (self)
 
 wait_for_saccade_end (self)
 
 wait_for_saccade_start (self)
 
 is_valid_sample (self, gazepos)
 

Variables

 res = iViewXAPI.iV_SetLogger(c_int(1), c_char_p(logfile + '_SMILOG.txt'))
 
 err = errorstring(res)
 
 samplerate
 
 sampletime
 
 connected
 
 eye_used = self.left_eye:
 
 prevps = ps
 
 prevsample = newsample[:]
 
bool recording = True
 
str eventdetection = eventdetection
 
# weigthed distance(sx/tx) **2+(sy/ty) **2 > 1 means movement larger than RMS noise weightdist = newpos[1]-prevpos[1]
 
 pxacctresh = (v1-v0) / (t1-t0)
 

Function Documentation

◆ deg2pix()

pygaze._eyetracker.libsmi.deg2pix ( cmdist,
angle,
pixpercm )
Convierte un ángulo visual en tamaño en píxeles.

Argumentos:
    cmdist -- Distancia al monitor en centímetros.
    angle -- Tamaño del estímulo en ángulo visual.
    pixpercm -- Cantidad de píxeles por centímetro en la pantalla.

Retorna:
    pixelsize -- Tamaño del estímulo en píxeles.

◆ errorstring()

pygaze._eyetracker.libsmi.errorstring ( returncode)
Devuelve una cadena con la descripción del error asociado al código de retorno dado.

Argumentos:
    returncode -- Código de error de iViewXAPI (un número entero).

Retorna:
    errorstring -- Cadena que describe el error asociado al código especificado.

◆ is_valid_sample()

pygaze._eyetracker.libsmi.is_valid_sample ( self,
gazepos )
Checks if the sample provided is valid, based on SMI specific
        criteria (for internal use)

        arguments
        gazepos     --  a (x,y) gaze position tuple, as returned by
                        self.sample()

        returns
        valid           --  a Boolean: True on a valid sample, False on
                        an invalid sample

◆ pupil_size()

pygaze._eyetracker.libsmi.pupil_size ( self)
Return pupil size

        arguments
        None

        returns
        pupil size  -- returns pupil diameter for the eye that is currently
                   being tracked (as specified by self.eye_used) or -1
                   when no data is obtainable

◆ sample()

pygaze._eyetracker.libsmi.sample ( self)
Returns newest available gaze position

        arguments
        None

        returns
        sample  -- an (x,y) tuple or a (-1,-1) on an error

◆ send_command()

pygaze._eyetracker.libsmi.send_command ( self,
cmd )
Sends a command to the eye tracker

        arguments
        cmd     -- the command (a string value) to be sent to iViewX

        returns
        Nothing

◆ send_message()

pygaze._eyetracker.libsmi.send_message ( self,
msg )

◆ set_backdrop()

pygaze._eyetracker.libsmi.set_backdrop ( self)
Not supported for SMItracker (yet)

◆ set_detection_type()

pygaze._eyetracker.libsmi.set_detection_type ( self,
eventdetection )
Set the event detection type to either PyGaze algorithms, or
        native algorithms as provided by the manufacturer (only if
        available: detection type will default to PyGaze if no native
        functions are available)

        arguments
        eventdetection  --  a string indicating which detection type
                        should be employed: either 'pygaze' for
                        PyGaze event detection algorithms or
                        'native' for manufacturers algorithms (only
                        if available; will default to 'pygaze' if no
                        native event detection is available)
        returns     --  detection type for saccades, fixations and
                        blinks in a tuple, e.g.
                        ('pygaze','native','native') when 'native'
                        was passed, but native detection was not
                        available for saccade detection

◆ set_eye_used()

pygaze._eyetracker.libsmi.set_eye_used ( self)
Logs the eye_used variable, based on which eye was specified
        (if both eyes are being tracked, the left eye is used)

        arguments
        None

        returns
        Nothing -- logs which eye is used by calling self.log_var, e.g.
                   self.log_var("eye_used", "right")

◆ start_recording()

pygaze._eyetracker.libsmi.start_recording ( self)
Starts recording eye position

        arguments
        None

        returns
        Nothing -- sets self.recording to True when recording is
                   successfully started

◆ status_msg()

pygaze._eyetracker.libsmi.status_msg ( self,
msg )
Not supported for SMItracker (yet)

◆ stop_recording()

pygaze._eyetracker.libsmi.stop_recording ( self)
Stop recording eye position

        arguments
        None

        returns
        Nothing -- sets self.recording to False when recording is
                   successfully started

◆ wait_for_blink_end()

pygaze._eyetracker.libsmi.wait_for_blink_end ( self)
Waits for a blink end and returns the blink ending time

        arguments
        None

        returns
        timestamp       --  blink ending time in milliseconds, as
                        measured from experiment begin time

◆ wait_for_blink_start()

pygaze._eyetracker.libsmi.wait_for_blink_start ( self)
Waits for a blink start and returns the blink starting time

        arguments
        None

        returns
        timestamp       --  blink starting time in milliseconds, as
                        measured from experiment begin time

◆ wait_for_event()

pygaze._eyetracker.libsmi.wait_for_event ( self,
event )
Waits for event

        arguments
        event       -- an integer event code, one of the following:
                    3 = STARTBLINK
                    4 = ENDBLINK
                    5 = STARTSACC
                    6 = ENDSACC
                    7 = STARTFIX
                    8 = ENDFIX

        returns
        outcome -- a self.wait_for_* method is called, depending on the
                   specified event; the return values of corresponding
                   method are returned

◆ wait_for_fixation_end()

pygaze._eyetracker.libsmi.wait_for_fixation_end ( self)
Returns time and gaze position when a fixation has ended;
        function assumes that a 'fixation' has ended when a deviation of
        more than self.pxfixtresh from the initial fixation position has
        been detected (self.pxfixtresh is created in self.calibration,
        based on self.fixtresh, a property defined in self.__init__)

        arguments
        None

        returns
        time, gazepos   -- time is the starting time in milliseconds (from
                       expstart), gazepos is a (x,y) gaze position
                       tuple of the position from which the fixation
                       was initiated

◆ wait_for_fixation_start()

pygaze._eyetracker.libsmi.wait_for_fixation_start ( self)
Returns starting time and position when a fixation is started;
        function assumes a 'fixation' has started when gaze position
        remains reasonably stable (i.e. when most deviant samples are
        within self.pxfixtresh) for five samples in a row (self.pxfixtresh
        is created in self.calibration, based on self.fixtresh, a property
        defined in self.__init__)

        arguments
        None

        returns
        time, gazepos   -- time is the starting time in milliseconds (from
                       expstart), gazepos is a (x,y) gaze position
                       tuple of the position from which the fixation
                       was initiated

◆ wait_for_saccade_end()

pygaze._eyetracker.libsmi.wait_for_saccade_end ( self)
Returns ending time, starting and end position when a saccade is
        ended; based on Dalmaijer et al. (2013) online saccade detection
        algorithm

        arguments
        None

        returns
        endtime, startpos, endpos   -- endtime in milliseconds (from
                               expbegintime); startpos and endpos
                               are (x,y) gaze position tuples

◆ wait_for_saccade_start()

pygaze._eyetracker.libsmi.wait_for_saccade_start ( self)
Returns starting time and starting position when a saccade is
        started; based on Dalmaijer et al. (2013) online saccade detection
        algorithm

        arguments
        None

        returns
        endtime, startpos   -- endtime in milliseconds (from expbegintime);
                       startpos is an (x,y) gaze position tuple

Variable Documentation

◆ connected

pygaze._eyetracker.libsmi.connected

◆ err

pygaze._eyetracker.libsmi.err = errorstring(res)

◆ eventdetection

str pygaze._eyetracker.libsmi.eventdetection = eventdetection
Set the event detection type to either PyGaze algorithms, or
        native algorithms as provided by the manufacturer (only if
        available: detection type will default to PyGaze if no native
        functions are available)

        arguments
        eventdetection  --  a string indicating which detection type
                        should be employed: either 'pygaze' for
                        PyGaze event detection algorithms or
                        'native' for manufacturers algorithms (only
                        if available; will default to 'pygaze' if no
                        native event detection is available)
        returns     --  detection type for saccades, fixations and
                        blinks in a tuple, e.g.
                        ('pygaze','native','native') when 'native'
                        was passed, but native detection was not
                        available for saccade detection

◆ eye_used

pygaze._eyetracker.libsmi.eye_used = self.left_eye:
Logs the eye_used variable, based on which eye was specified
        (if both eyes are being tracked, the left eye is used)

        arguments
        None

        returns
        Nothing -- logs which eye is used by calling self.log_var, e.g.
                   self.log_var("eye_used", "right")

◆ prevps

pygaze._eyetracker.libsmi.prevps = ps

◆ prevsample

pygaze._eyetracker.libsmi.prevsample = newsample[:]

◆ pxacctresh

pygaze._eyetracker.libsmi.pxacctresh = (v1-v0) / (t1-t0)

◆ recording

bool pygaze._eyetracker.libsmi.recording = True

◆ res

pygaze._eyetracker.libsmi.res = iViewXAPI.iV_SetLogger(c_int(1), c_char_p(logfile + '_SMILOG.txt'))

◆ samplerate

pygaze._eyetracker.libsmi.samplerate

◆ sampletime

pygaze._eyetracker.libsmi.sampletime

◆ weightdist

# weigthed distance (sx/tx)**2 + (sy/ty)**2 > 1 means movement larger than RMS noise pygaze._eyetracker.libsmi.weightdist = newpos[1]-prevpos[1]