From 053726042d48f68bce7f0bfb4d53c5be097e234d Mon Sep 17 00:00:00 2001 From: Théo de la Hogue Date: Thu, 15 Jun 2023 17:21:47 +0200 Subject: Documenting GazeMovementIdentifier generator method. --- docs/user_guide/gaze_analysis/gaze_movement.md | 24 +++++++++++++++++++++++- 1 file changed, 23 insertions(+), 1 deletion(-) (limited to 'docs/user_guide') diff --git a/docs/user_guide/gaze_analysis/gaze_movement.md b/docs/user_guide/gaze_analysis/gaze_movement.md index 377e787..932afac 100644 --- a/docs/user_guide/gaze_analysis/gaze_movement.md +++ b/docs/user_guide/gaze_analysis/gaze_movement.md @@ -138,4 +138,26 @@ ts_fixations, ts_saccades, ts_status = gaze_movement_identifier.browse(ts_gaze_p !!! note [TimeStampedGazeMovements](/argaze/#argaze.GazeFeatures.TimeStampedGazeMovements), [TimeStampedGazeMovements](/argaze/#argaze.GazeFeatures.TimeStampedGazeMovements) and [TimeStampedGazeStatus](/argaze/#argaze.GazeFeatures.TimeStampedGazeStatus) classes inherit from [TimeStampedBuffer](/argaze/#argaze.DataStructures.TimeStampedBuffer) class. - Read [Timestamped data](../timestamped_data/introduction.md) section to understand all features it provides. \ No newline at end of file + Read [Timestamped data](../timestamped_data/introduction.md) section to understand all features it provides. + +### Generator method + +[GazeMovementIdentifier](/argaze/#argaze.GazeFeatures.GazeMovementIdentifier) can be called with a [TimeStampedGazePositions](/argaze/#argaze.GazeFeatures.TimeStampedGazePositions) buffer in argument to generate gaze movement each time one is identified. + +``` python +# Assuming that timestamped gaze positions are provided through data reading + +for ts, gaze_movement in gaze_movement_identifier(ts_gaze_positions): + + # Fixation identified + if GazeFeatures.is_fixation(gaze_movement): + + # Do something with each fixation + ... + + # Saccade identified + elif GazeFeatures.is_saccade(gaze_movement): + + # Do something with each saccade + ... +``` \ No newline at end of file -- cgit v1.1