From 480f2ca81a591d7b7b7d6c7044e2f7541218d9dd Mon Sep 17 00:00:00 2001 From: Théo de la Hogue Date: Tue, 8 Aug 2023 15:36:15 +0200 Subject: Adding path_druation property to Basic analysis. --- src/argaze/GazeAnalysis/Basic.py | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/src/argaze/GazeAnalysis/Basic.py b/src/argaze/GazeAnalysis/Basic.py index 03b2878..c57b447 100644 --- a/src/argaze/GazeAnalysis/Basic.py +++ b/src/argaze/GazeAnalysis/Basic.py @@ -22,12 +22,15 @@ class ScanPathAnalyzer(GazeFeatures.ScanPathAnalyzer): super().__init__() + self.__path_duration = 0 self.__steps_number = 0 self.__step_fixation_durations_average = 0 def analyze(self, scan_path: GazeFeatures.ScanPathType): """Analyze scan path.""" + self.__path_duration = scan_path.duration + self.__steps_number = len(scan_path) sum_fixation_durations = 0 @@ -39,6 +42,11 @@ class ScanPathAnalyzer(GazeFeatures.ScanPathAnalyzer): self.__step_fixation_durations_average = sum_fixation_durations / self.__steps_number @property + def path_duration(self) -> float: + + return self.__path_duration + + @property def steps_number(self) -> float: return self.__steps_number @@ -56,12 +64,15 @@ class AOIScanPathAnalyzer(GazeFeatures.AOIScanPathAnalyzer): super().__init__() + self.__path_duration = 0 self.__steps_number = 0 self.__step_fixation_durations_average = 0 def analyze(self, aoi_scan_path: GazeFeatures.ScanPathType): """Analyze aoi scan path.""" + self.__path_duration = aoi_scan_path.duration + self.__steps_number = len(aoi_scan_path) sum_fixation_durations = 0 @@ -71,6 +82,11 @@ class AOIScanPathAnalyzer(GazeFeatures.AOIScanPathAnalyzer): sum_fixation_durations += aoi_scan_step.fixation_duration self.__step_fixation_durations_average = sum_fixation_durations / self.__steps_number + + @property + def path_duration(self) -> float: + + return self.__path_duration @property def steps_number(self) -> float: -- cgit v1.1