From 8c412d2d6d50f5e46d008eb75e33338b96f4fe82 Mon Sep 17 00:00:00 2001 From: Théo de la Hogue Date: Wed, 24 May 2023 14:07:59 +0200 Subject: Ignoring consecutives fixations keeping only the last one. --- src/argaze/GazeFeatures.py | 25 +++++-------------------- 1 file changed, 5 insertions(+), 20 deletions(-) diff --git a/src/argaze/GazeFeatures.py b/src/argaze/GazeFeatures.py index d17d5b5..33b9ef8 100644 --- a/src/argaze/GazeFeatures.py +++ b/src/argaze/GazeFeatures.py @@ -367,7 +367,7 @@ class ScanStepError(Exception): @dataclass(frozen=True) class ScanStep(): - """Define a scan step as a pair of successive fixation and saccade. + """Define a scan step as a fixation and a consecutive saccade. .. warning:: Scan step have to start by a fixation and then end by a saccade.""" @@ -413,7 +413,7 @@ class ScanPath(list): self.__last_fixation = None - def append_saccade(self, ts, saccade): + def append_saccade(self, ts, saccade) -> ScanStepType: """Append new saccade to scan path and return last new scan step if one have been created.""" # Ignore saccade if no fixation came before @@ -435,27 +435,12 @@ class ScanPath(list): # Clear last fixation self.__last_fixation = None - def append_fixation(self, ts, fixation) -> bool: + def append_fixation(self, ts, fixation): """Append new fixation to scan path. - .. warning:: - It could raise ScanStepError""" - - # No fixation came before - if self.__last_fixation == None: - - self.__last_fixation = fixation - - # Merge successive fixations - else: - - try: - self.__last_fixation.merge(fixation) - - # Merge method not implemented for this kind of fixation - except NotImplementedError as e: + Consecutives fixations are ignored keeping the last fixation""" - print(e) + self.__last_fixation = fixation def draw(self, frame, fixation_color=(255, 255, 255), saccade_color=(255, 255, 255), deepness=0): """Draw scan path into frame.""" -- cgit v1.1