From d904b99cc969c977f911d36cfeb2279544c528e5 Mon Sep 17 00:00:00 2001 From: Théo de la Hogue Date: Tue, 23 Jan 2024 14:54:30 +0100 Subject: Defing PipelineStepObject and PipelineStepMethod to assess time execution. Removing exception managment to let the user catch them into the script. --- .../advanced_topics/scripting.md | 67 +++++++++++----------- 1 file changed, 33 insertions(+), 34 deletions(-) (limited to 'docs/user_guide/gaze_analysis_pipeline/advanced_topics') 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 837c8ff..9e65c08 100644 --- a/docs/user_guide/gaze_analysis_pipeline/advanced_topics/scripting.md +++ b/docs/user_guide/gaze_analysis_pipeline/advanced_topics/scripting.md @@ -71,54 +71,53 @@ Calling [ArFrame.look](../../../argaze.md/#argaze.ArFeatures.ArFrame.look) metho # Assuming that timestamped gaze positions are available ... - # Look ArFrame at a timestamped gaze position - execution_time, exception = ar_frame.look(timestamp, gaze_position).values() + try: - # Do something with calibrated gaze position - ... ar_frame.gaze_position + # Look ArFrame at a timestamped gaze position + ar_frame.look(timestamp, gaze_position).values() - # Check if a gaze movement has been identified - if ar_frame.gaze_movement.valid and ar_frame.gaze_movement.finished: + # Do something with calibrated gaze position + ... ar_frame.gaze_position - # Do something with identified fixation - if GazeFeatures.is_fixation(ar_frame.gaze_movement): - ... - - # Do something with identified saccade - elif GazeFeatures.is_saccade(ar_frame.gaze_movement): - ... + # Check if a gaze movement has been identified + if ar_frame.gaze_movement.valid and ar_frame.gaze_movement.finished: - # Check if new scan path analysis are available - if ar_frame.new_analysis_available: + # Do something with identified fixation + if GazeFeatures.is_fixation(ar_frame.gaze_movement): + ... - # Access to each scan path analyzer - for analyzer_name, analyzer in ar_frame.scan_path_analyzers.items(): + # Do something with identified saccade + elif GazeFeatures.is_saccade(ar_frame.gaze_movement): + ... - # Do something with analysis results - ... analyzer.analysis + # Check if new scan path analysis are available + if ar_frame.new_analysis_available: - # Iterate over each ArFrame layers - for name, ar_layer in ar_frame.layers.items(): - - # Check if new aoi scan path analysis are available - if ar_layer.new_analysis_available: - - # Access to each aoi scan path analyzer - for analyzer_name, analyzer in ar_layer.aoi_scan_path_analyzers.items(): + # Access to each scan path analyzer + for analyzer_name, analyzer in ar_frame.scan_path_analyzers.items(): # Do something with analysis results ... analyzer.analysis -``` -Let's understand the meaning of each data. + # Iterate over each ArFrame layers + for name, ar_layer in ar_frame.layers.items(): + + # Check if new aoi scan path analysis are available + if ar_layer.new_analysis_available: -### *execution_times* + # Access to each aoi scan path analyzer + for analyzer_name, analyzer in ar_layer.aoi_scan_path_analyzers.items(): -A dictionary with each pipeline step execution time. + # Do something with analysis results + ... analyzer.analysis -### *exception* + # Do something with pipeline exception + except Exception as e: + + ... +``` -A [python Exception](https://docs.python.org/3/tutorial/errors.html#exceptions) object raised during pipeline execution. +Let's understand the meaning of each data. ### *ar_frame.gaze_position* @@ -139,7 +138,7 @@ This flag allows to now when new scan path and aoi scan path analysis are availa ### *analyzer.analysis* -A dict containing all data produced by an analyzer. +A dictionary containing all data produced by an analyzer. ## Setup ArFrame image parameters -- cgit v1.1