dispel.providers.generic.tasks.draw.intersections module#
A module dedicated to drawing intersection detections.
- class dispel.providers.generic.tasks.draw.intersections.Point[source]#
Bases:
Point
Wrap Point object in a custom class.
- class dispel.providers.generic.tasks.draw.intersections.Segment[source]#
Bases:
Segment
Wrap Segment object in a custom class.
- dispel.providers.generic.tasks.draw.intersections.compute_intersection_analysis(user, reference)[source]#
Compute the tremor-related measures according to intersections.
First get only the valid user trajectory, then format the data needed, and then extract the measures.
- Parameters:
user (DataFrame) – A pandas data frame obtained via a
dispel.providers.generic.tasks.draw.touch.DrawShape
reference (DataFrame) – The reference trajectory corresponding to the current shape.
- Returns:
The proper pandas data frame to compute tremor measures.
- Return type:
- dispel.providers.generic.tasks.draw.intersections.get_intersection_data(user, ref)[source]#
Transform {level_id}_user_paths data to study intersections.
This transform the {level_id}_user_paths data in order to get the proper data to capture the number of intersections between the user path and the model path.
- Parameters:
- Returns:
The proper user data frame to compute tremor-related measures and the proper reference data to compute tremor-related measures.
- Return type:
Tuple[pandas.DataFrame, pandas.DataFrame]
- dispel.providers.generic.tasks.draw.intersections.get_intersection_measures(user, ref)[source]#
Compute the number of intersections between user and model paths.
- Parameters:
- Returns:
A pandas data frame containing tremor measures related to path intersection.
- Return type:
- dispel.providers.generic.tasks.draw.intersections.get_ratio(data)[source]#
Add the traveled distance ratio of a segment.
This get the traveled distance ratio of all user and model segments. This ratio corresponds to the ‘traveled’ distance from zero to the segment over the total distance of the drawn/ground truth shape.
- Parameters:
data (DataFrame) – A pandas data frame containing at least dist and tot_length pandas Series.
- Returns:
The pandas series corresponding to the ratio defined as the total length of a specific point from the origin of the draw over the total length of the draw.
- Return type: