diff options
author | Théo de la Hogue | 2023-07-06 18:15:26 +0200 |
---|---|---|
committer | Théo de la Hogue | 2023-07-06 18:15:26 +0200 |
commit | 47af08857f07801eae85bb9f9e50803161324bac (patch) | |
tree | 9a159270bd2e781a326a0957162de0868e44788b /src | |
parent | 200d78f51697b30f4eb7ec37a7a158a37f3de47c (diff) | |
download | argaze-47af08857f07801eae85bb9f9e50803161324bac.zip argaze-47af08857f07801eae85bb9f9e50803161324bac.tar.gz argaze-47af08857f07801eae85bb9f9e50803161324bac.tar.bz2 argaze-47af08857f07801eae85bb9f9e50803161324bac.tar.xz |
Adding new current_gaze_movement attribute.
Diffstat (limited to 'src')
-rw-r--r-- | src/argaze/GazeAnalysis/VelocityThresholdIdentification.py | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/src/argaze/GazeAnalysis/VelocityThresholdIdentification.py b/src/argaze/GazeAnalysis/VelocityThresholdIdentification.py index 7405ec6..2b29492 100644 --- a/src/argaze/GazeAnalysis/VelocityThresholdIdentification.py +++ b/src/argaze/GazeAnalysis/VelocityThresholdIdentification.py @@ -217,6 +217,23 @@ class GazeMovementIdentifier(GazeFeatures.GazeMovementIdentifier): return GazeFeatures.UnvalidGazeMovement() @property + def current_gaze_movement(self) -> GazeMovementType: + + # It shouldn't have a current fixation and a current saccade at the same time + assert(not (len(self.__fixation_positions) > 0 and len(self.__saccade_positions) > 0)) + + if len(self.__fixation_positions) > 0: + + return Fixation(self.__fixation_positions) + + if len(self.__saccade_positions) > 0: + + return Saccade(self.__saccade_positions) + + # Always return unvalid gaze movement at least + return GazeFeatures.UnvalidGazeMovement() + + @property def current_fixation(self) -> FixationType: if len(self.__fixation_positions) > 0: |