aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThéo de la Hogue2023-07-05 16:43:30 +0200
committerThéo de la Hogue2023-07-05 16:43:30 +0200
commit2d2dc282face6dfdcc12bbf7fb31e8511ed074f4 (patch)
tree0ca33478783486a6a687e0d298baee865c2989c0
parent5116122176ada6f4a98428c75b8f8ce04faaab9f (diff)
downloadargaze-2d2dc282face6dfdcc12bbf7fb31e8511ed074f4.zip
argaze-2d2dc282face6dfdcc12bbf7fb31e8511ed074f4.tar.gz
argaze-2d2dc282face6dfdcc12bbf7fb31e8511ed074f4.tar.bz2
argaze-2d2dc282face6dfdcc12bbf7fb31e8511ed074f4.tar.xz
Allowing to setup expected aoi after AOIScanPath creation.
-rw-r--r--src/argaze/GazeFeatures.py33
1 files changed, 22 insertions, 11 deletions
diff --git a/src/argaze/GazeFeatures.py b/src/argaze/GazeFeatures.py
index ba3f54e..85b167f 100644
--- a/src/argaze/GazeFeatures.py
+++ b/src/argaze/GazeFeatures.py
@@ -668,16 +668,8 @@ class AOIScanPath(list):
super().__init__()
- self.__expected_aois = expected_aois
- self.__movements = TimeStampedGazeMovements()
- self.__current_aoi = ''
- self.__index = ord('A')
- self.__aoi_letter = {}
- self.__letter_aoi = {}
-
- size = len(self.__expected_aois)
- self.__transition_matrix = pandas.DataFrame(numpy.zeros((size, size)), index=self.__expected_aois, columns=self.__expected_aois)
-
+ self.expected_aois = expected_aois
+
def __repr__(self):
"""String representation."""
@@ -715,7 +707,26 @@ class AOIScanPath(list):
"""List of all expected aoi."""
return self.__expected_aois
-
+
+ @expected_aois.setter
+ def expected_aois(self, expected_aois: list[str] = []):
+ """Edit list of all expected aoi.
+
+ !!! warning
+ This will clear the AOIScanPath
+ """
+ self.clear()
+
+ self.__expected_aois = expected_aois
+ self.__movements = TimeStampedGazeMovements()
+ self.__current_aoi = ''
+ self.__index = ord('A')
+ self.__aoi_letter = {}
+ self.__letter_aoi = {}
+
+ size = len(self.__expected_aois)
+ self.__transition_matrix = pandas.DataFrame(numpy.zeros((size, size)), index=self.__expected_aois, columns=self.__expected_aois)
+
@property
def current_aoi(self):
"""AOI name of aoi scan step under construction"""