aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorThéo de la Hogue2023-05-23 15:09:03 +0200
committerThéo de la Hogue2023-05-23 15:09:03 +0200
commit916419703b704607f59289d09d09f842a2098201 (patch)
treed169ae43c5f4d0bdb8414866dc48885540302290 /src
parent49151a22996de1dc249552b157fcc6bb768416ee (diff)
downloadargaze-916419703b704607f59289d09d09f842a2098201.zip
argaze-916419703b704607f59289d09d09f842a2098201.tar.gz
argaze-916419703b704607f59289d09d09f842a2098201.tar.bz2
argaze-916419703b704607f59289d09d09f842a2098201.tar.xz
Adding fixation_count method.
Diffstat (limited to 'src')
-rw-r--r--src/argaze/GazeFeatures.py15
1 files changed, 15 insertions, 0 deletions
diff --git a/src/argaze/GazeFeatures.py b/src/argaze/GazeFeatures.py
index 31290b5..a098dc4 100644
--- a/src/argaze/GazeFeatures.py
+++ b/src/argaze/GazeFeatures.py
@@ -652,6 +652,21 @@ class AOIScanPath(list):
return None
+ def fixation_count(self):
+ """Get how many fixations are there in the scan path and how many fixation are there in each aoi."""
+
+ scan_fixation_count = 0
+ aoi_fixation_count = {aoi: 0 for aoi in self.__aoi_letter}
+
+ for aoi_scan_step in self:
+
+ step_fixation_count = len(aoi_scan_step.movements) - 1 # -1: to ignore last saccade
+
+ scan_fixation_count += step_fixation_count
+ aoi_fixation_count[aoi_scan_step.aoi] += step_fixation_count
+
+ return scan_fixation_count, aoi_fixation_count
+
class AOIScanPathAnalyzer():
"""Abstract class to define what should provide a aoi scan path analyzer."""