diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/argaze/GazeAnalysis/Basic.py | 51 | ||||
-rw-r--r-- | src/argaze/GazeAnalysis/__init__.py | 2 |
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 |