aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThéo de la Hogue2023-07-03 09:50:18 +0200
committerThéo de la Hogue2023-07-03 09:50:18 +0200
commit4f32cdaad425acd1feb76ec1a04a2265e0319a03 (patch)
treec9588de79d658a2add8fd29071a1232c0b390d0a
parentdcb7739179acbe7844984b0a65dc46032355e0c8 (diff)
downloadargaze-4f32cdaad425acd1feb76ec1a04a2265e0319a03.zip
argaze-4f32cdaad425acd1feb76ec1a04a2265e0319a03.tar.gz
argaze-4f32cdaad425acd1feb76ec1a04a2265e0319a03.tar.bz2
argaze-4f32cdaad425acd1feb76ec1a04a2265e0319a03.tar.xz
Adding a basic gaze analysis plugin to use as a placeholder to enable scan path in environment declaration.
-rw-r--r--src/argaze/GazeAnalysis/Basic.py51
-rw-r--r--src/argaze/GazeAnalysis/__init__.py2
2 files changed, 52 insertions, 1 deletions
diff --git a/src/argaze/GazeAnalysis/Basic.py b/src/argaze/GazeAnalysis/Basic.py
new file mode 100644
index 0000000..69e5793
--- /dev/null
+++ b/src/argaze/GazeAnalysis/Basic.py
@@ -0,0 +1,51 @@
+#!/usr/bin/env python
+
+"""Implementation of basic analysis.
+"""
+
+__author__ = "Théo de la Hogue"
+__credits__ = []
+__copyright__ = "Copyright 2023, Ecole Nationale de l'Aviation Civile (ENAC)"
+__license__ = "BSD"
+
+from dataclasses import dataclass
+
+from argaze import GazeFeatures
+
+import numpy
+
+@dataclass
+class ScanPathAnalyzer(GazeFeatures.ScanPathAnalyzer):
+ """"""
+
+ def __post_init__(self):
+
+ self.__lenght = 0
+
+ def analyze(self, scan_path: GazeFeatures.ScanPathType):
+ """Analyze scan path."""
+
+ self.__lenght = len(scan_path)
+
+ @property
+ def length(self) -> float:
+
+ return self.__lenght
+
+@dataclass
+class AOIScanPathAnalyzer(GazeFeatures.AOIScanPathAnalyzer):
+ """"""
+
+ def __post_init__(self):
+
+ self.__lenght = 0
+
+ def analyze(self, scan_path: GazeFeatures.ScanPathType):
+ """Analyze scan path."""
+
+ self.__lenght = len(scan_path)
+
+ @property
+ def length(self) -> float:
+
+ return self.__lenght \ No newline at end of file
diff --git a/src/argaze/GazeAnalysis/__init__.py b/src/argaze/GazeAnalysis/__init__.py
index 2bdb820..37c35ca 100644
--- a/src/argaze/GazeAnalysis/__init__.py
+++ b/src/argaze/GazeAnalysis/__init__.py
@@ -1,4 +1,4 @@
"""
Various gaze movement identification and scan path analysis algorithms.
"""
-__all__ = ['DispersionThresholdIdentification', 'VelocityThresholdIdentification', 'TransitionMatrix', 'KCoefficient', 'LempelZivComplexity', 'NGram', 'Entropy', 'NearestNeighborIndex', 'ExploitExploreRatio'] \ No newline at end of file
+__all__ = ['Basic', 'DispersionThresholdIdentification', 'VelocityThresholdIdentification', 'TransitionMatrix', 'KCoefficient', 'LempelZivComplexity', 'NGram', 'Entropy', 'NearestNeighborIndex', 'ExploitExploreRatio'] \ No newline at end of file