aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/argaze/GazeAnalysis/Basic.py23
1 files changed, 22 insertions, 1 deletions
diff --git a/src/argaze/GazeAnalysis/Basic.py b/src/argaze/GazeAnalysis/Basic.py
index 7b41731..dc7b4fd 100644
--- a/src/argaze/GazeAnalysis/Basic.py
+++ b/src/argaze/GazeAnalysis/Basic.py
@@ -79,12 +79,27 @@ class AOIScanPathAnalyzer(GazeFeatures.AOIScanPathAnalyzer):
self.__steps_number = len(aoi_scan_path)
sum_fixation_durations = 0
+ self.__sum_aoi_fixation_durations = {}
for aoi_scan_step in aoi_scan_path:
sum_fixation_durations += aoi_scan_step.fixation_duration
+ try:
+
+ self.__sum_aoi_fixation_durations[aoi_scan_step.aoi] = self.__sum_aoi_fixation_durations[aoi_scan_step.aoi] + aoi_scan_step.fixation_duration
+
+ except KeyError:
+
+ self.__sum_aoi_fixation_durations[aoi_scan_step.aoi] = aoi_scan_step.fixation_duration
+
self.__step_fixation_durations_average = sum_fixation_durations / self.__steps_number
+
+ self.__aoi_fixation_distribution = {}
+
+ for aoi_name, sum_aoi_fixation_duration in self.__sum_aoi_fixation_durations.items():
+
+ self.__aoi_fixation_distribution[aoi_name] = sum_aoi_fixation_duration / sum_fixation_durations
@property
def path_duration(self) -> float:
@@ -102,4 +117,10 @@ class AOIScanPathAnalyzer(GazeFeatures.AOIScanPathAnalyzer):
def step_fixation_durations_average(self) -> float:
"""AOI scan path step fixation durations average."""
- return self.__step_fixation_durations_average \ No newline at end of file
+ return self.__step_fixation_durations_average
+
+ @property
+ def aoi_fixation_distribution(self) -> dict:
+ """percentage of time spent on each AOI."""
+
+ return self.__aoi_fixation_distribution \ No newline at end of file