aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThéo de la Hogue2023-08-08 15:36:15 +0200
committerThéo de la Hogue2023-08-08 15:36:15 +0200
commit480f2ca81a591d7b7b7d6c7044e2f7541218d9dd (patch)
tree9c2756e8a411407839782098c955bbd701d21b2b
parentd10941f544626eed20afaca8d8e91c65b1addaf8 (diff)
downloadargaze-480f2ca81a591d7b7b7d6c7044e2f7541218d9dd.zip
argaze-480f2ca81a591d7b7b7d6c7044e2f7541218d9dd.tar.gz
argaze-480f2ca81a591d7b7b7d6c7044e2f7541218d9dd.tar.bz2
argaze-480f2ca81a591d7b7b7d6c7044e2f7541218d9dd.tar.xz
Adding path_druation property to Basic analysis.
-rw-r--r--src/argaze/GazeAnalysis/Basic.py16
1 files changed, 16 insertions, 0 deletions
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: