Module eyekit.fixation
Defines the Fixation
and FixationSequence
objects, which are used to
represent fixation data.
Classes
class Fixation (x: int, y: int, start: int, end: 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 start : int
-
Start time of the fixation in milliseconds.
var end : int
-
End time of the fixation in milliseconds.
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: (X, Y, START, END).
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, 200), (190, 536, 200, 300), ..., (763, 529, 1000, 1100)]
, where each tuple contains the X-coordinate, Y-coordinate, start time, and end time of a fixation.
Instance variables
var start
-
Start time of the fixation sequence (in milliseconds).
var end
-
End time of the fixation sequence (in milliseconds).
var duration
-
Duration of the fixation sequence, incuding any gaps between fixations (in milliseconds).
Methods
def append(self, fixation)
-
Append a fixation to the end of the sequence.
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.