diff options
author | Théo de la Hogue | 2023-07-06 18:17:07 +0200 |
---|---|---|
committer | Théo de la Hogue | 2023-07-06 18:17:07 +0200 |
commit | 17d247f0652afcc68b9477bce718e91c850d5499 (patch) | |
tree | 714ddbcf05555ca5baae57ee141b5d4d153e24f1 /src | |
parent | 47af08857f07801eae85bb9f9e50803161324bac (diff) | |
download | argaze-17d247f0652afcc68b9477bce718e91c850d5499.zip argaze-17d247f0652afcc68b9477bce718e91c850d5499.tar.gz argaze-17d247f0652afcc68b9477bce718e91c850d5499.tar.bz2 argaze-17d247f0652afcc68b9477bce718e91c850d5499.tar.xz |
Adding new current_gaze_movement attribute.
Diffstat (limited to 'src')
-rw-r--r-- | src/argaze/GazeAnalysis/DispersionThresholdIdentification.py | 18 |
1 files changed, 17 insertions, 1 deletions
diff --git a/src/argaze/GazeAnalysis/DispersionThresholdIdentification.py b/src/argaze/GazeAnalysis/DispersionThresholdIdentification.py index 350a940..f29858a 100644 --- a/src/argaze/GazeAnalysis/DispersionThresholdIdentification.py +++ b/src/argaze/GazeAnalysis/DispersionThresholdIdentification.py @@ -203,6 +203,22 @@ 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: @@ -216,7 +232,7 @@ class GazeMovementIdentifier(GazeFeatures.GazeMovementIdentifier): def current_saccade(self) -> SaccadeType: if len(self.__saccade_positions) > 0: - + return Saccade(self.__saccade_positions) # Always return unvalid gaze movement at least |