From 0c5fb0f3ec5f773797fc08ec769f33e332c7dd46 Mon Sep 17 00:00:00 2001 From: Théo de la Hogue Date: Wed, 10 Apr 2024 20:04:45 +0200 Subject: Updating documentation. --- .../advanced_topics/scripting.md | 29 ++++++++++++++-------- 1 file changed, 18 insertions(+), 11 deletions(-) (limited to 'docs/user_guide/gaze_analysis_pipeline/advanced_topics/scripting.md') diff --git a/docs/user_guide/gaze_analysis_pipeline/advanced_topics/scripting.md b/docs/user_guide/gaze_analysis_pipeline/advanced_topics/scripting.md index 9c4fb60..a230d4c 100644 --- a/docs/user_guide/gaze_analysis_pipeline/advanced_topics/scripting.md +++ b/docs/user_guide/gaze_analysis_pipeline/advanced_topics/scripting.md @@ -6,10 +6,13 @@ This could be particularly useful for realtime gaze interaction applications. ## Load ArFrame configuration from dictionary -First of all, [ArFrame](../../../argaze.md/#argaze.ArFeatures.ArFrame) configuration can be loaded from a Python dictionary. +An [ArFrame](../../../argaze.md/#argaze.ArFeatures.ArFrame) configuration can be loaded from a Python dictionary. ```python -from argaze import ArFeatures +from argaze import ArFeatures, DataFeatures + +# Set working directory to enable relative file path loading +DataFeatures.set_working_directory('path/to/folder') # Edit a dict with ArFrame configuration configuration = { @@ -40,7 +43,7 @@ configuration = { } # Load ArFrame -with ArFeatures.ArFrame.from_dict(configuration) as ar_frame: +with ArFeatures.ArFrame(**configuration) as ar_frame: # Do something with ArFrame ... @@ -95,9 +98,11 @@ Calling [ArFrame.look](../../../argaze.md/#argaze.ArFeatures.ArFrame.look) metho # Do something with scan path analysis if ar_frame.is_analysis_available(): - for scan_path_analyzer_name, scan_path_analysis in ar_frame.analysis: + for scan_path_analyzer_name, analyses in ar_frame.analysis().items(): - ... + for analysis_name, analysis in analyses.items(): + + ... # Do something with layers aoi scan path analysis for layer_name, ar_layer in ar_frame.layers.items(): @@ -107,9 +112,11 @@ Calling [ArFrame.look](../../../argaze.md/#argaze.ArFeatures.ArFrame.look) metho if ar_layer.is_analysis_available(): - for aoi_scan_path_analyzer_name, aoi_scan_path_analysis in ar_layer.analysis: + for aoi_scan_path_analyzer_name, analyses in ar_frame.analysis().items(): - ... + for analysis_name, analysis in analyses.items(): + + ... # Do something with pipeline exception except Exception as e: @@ -136,9 +143,9 @@ Then, the last gaze movement type can be tested thanks to [GazeFeatures.is_fixat To know when new scan path analysis is available. -### *ar_frame.analysis()* +### *ar_frame.analysis().items()* -This an iterator to access to all scan path analysis. +This an iterator to access to all scan path analysis. Notice that each scan path analyzer returns a dictionary containing possibly several analyses. ### *ar_layer.last_looked_aoi_name()* @@ -148,9 +155,9 @@ The name of the last aoi matching done by [AoiMatcher](../../../argaze.md/#argaz To know when new aoi scan path analysis is available. -### *ar_layer.analysis()* +### *ar_layer.analysis().items()* -This an iterator to access to all aoi scan path analysis. +This an iterator to access to all aoi scan path analysis. Notice that each aoi scan path analyzer returns a dictionary containing possibly several analyses. ## Setup ArFrame image parameters -- cgit v1.1