Module eyekit.fixation
Defines the Fixation
and FixationSequence
objects, which are used to
represent fixation data.
Classes
class Fixation (x: int, y: int, duration: int, discarded: bool = False)
-
Representation of a single fixation event. It is not usually necessary to create
Fixation
objects manually; they are created automatically during the instantiation of aFixationSequence
.Instance variables
var x : int
-
X-coordinate of the fixation.
var y : int
-
Y-coordinate of the fixation.
var xy : tuple
-
XY-coordinates of the fixation.
var duration : int
-
Duration of the fixation in milliseconds.
var discarded : bool
-
True
if the fixation has been discarded,False
otherwise. var tuple : tuple
-
Tuple representation of the fixation.
class FixationSequence (sequence: list = [])
-
Representation of a sequence of consecutive fixations, typically from a single trial.
Initialized with:
sequence
List of tuples of ints, or something similar, that conforms to the following structure:[(106, 540, 100), (190, 536, 100), ..., (763, 529, 100)]
, where each tuple contains the X-coordinate, Y-coordinate, and duration of a fixation
Methods
def append(self, fixation)
def copy(self, include_discards=True)
-
Returns a copy of the fixation sequence.
def purge(self)
-
Permanently removes all discarded fixations from the fixation sequence.
def iter_with_discards(self)
-
Iterates over the fixation sequence including any discarded fixations. This is also the default behavior when iterating over a
FixationSequence
directly. def iter_without_discards(self)
-
Iterates over the fixation sequence without any discarded fixations.
def XYarray(self, include_discards=False)
-
Returns a Numpy array containing the XY-coordinates of the fixations.
def Xarray(self, include_discards=False)
-
Returns a Numpy array containing the X-coordinates of the fixations.
def Yarray(self, include_discards=False)
-
Returns a Numpy array containing the Y-coordinates of the fixations.