dispel.providers.generic.tasks.ps module#
Pronation Supination assessment related functionality.
This module contains functionality to extract measures for the Pronation Supination assessment (PS).
- dispel.providers.generic.tasks.ps.ACTIVE_PHASE_DUR = Timedelta('0 days 00:00:07')#
Define the duration of the active test phase of the pronation supination test.
- class dispel.providers.generic.tasks.ps.AggregateAmplitude[source]#
Bases:
AggregateRawDataSetColumn
An aggregation processing step for the amplitude peak to peak.
- aggregations: AggregationsDefinitionType = [('mean', 'mean'), ('median', 'median'), (<function npcv>, 'non parametric coefficient of variation')]#
- data_set_ids: str | Iterable[str] = 'ps_event_peak_peak'#
An iterable of data sets to be being processed
- definition: ValueDefinition | ValueDefinitionPrototype | None = <dispel.data.measures.MeasureValueDefinitionPrototype object>#
The specification of the measure definition
- class dispel.providers.generic.tasks.ps.AggregateAmplitudeAndDurationGroup[source]#
Bases:
ProcessingStepGroup
Aggregate amplitude and duration group.
- steps: List[ProcessingStep] = [<dispel.processing.level.ProcessingStepGroup object>, <dispel.processing.level.ProcessingStepGroup object>]#
- class dispel.providers.generic.tasks.ps.AggregateDuration[source]#
Bases:
AggregateRawDataSetColumn
An aggregation processing step for the duration peak to peak.
- aggregations: AggregationsDefinitionType = [('mean', 'mean')]#
- data_set_ids: str | Iterable[str] = 'ps_event_peak_peak'#
An iterable of data sets to be being processed
- definition: ValueDefinition | ValueDefinitionPrototype | None = <dispel.data.measures.MeasureValueDefinitionPrototype object>#
The specification of the measure definition
- class dispel.providers.generic.tasks.ps.AggregateMotion[source]#
Bases:
AggregateRawDataSetColumn
An Aggregation of motion measures.
- get_data_frames(level)[source]#
Get the raw data from all data sets in question.
- Parameters:
level (Level) – The level from which to get the data sets.
- Returns:
A list of all raw data frames with the specified ids masked with event being equal to the movement specified.
- Return type:
List[pandas.DataFrame]
- class dispel.providers.generic.tasks.ps.AggregatePerHandAndMotionGroup[source]#
Bases:
ProcessingStepGroup
Aggregate per hand and motion group.
- steps: List[ProcessingStep] = [<dispel.processing.level.ProcessingStepGroup object>, <dispel.processing.level.ProcessingStepGroup object>, <dispel.processing.level.ProcessingStepGroup object>, <dispel.processing.level.ProcessingStepGroup object>, <dispel.processing.level.ProcessingStepGroup object>, <dispel.processing.level.ProcessingStepGroup object>]#
- class dispel.providers.generic.tasks.ps.BDHPronationSupinationSteps[source]#
Bases:
ProcessingStepGroup
Generic Pronation Supination processing steps.
- steps: List[ProcessingStep] = [<dispel.providers.generic.tasks.ps.PreprocessingPSGroup object>, <dispel.providers.generic.tasks.ps.MovementPowerGroup object>, <dispel.providers.generic.tasks.ps.EventDetectionAndFiltering object>, <dispel.providers.generic.tasks.ps.EventMeasureExtractionGroup object>]#
- dispel.providers.generic.tasks.ps.COL_TO_AGG: List[str] = ['abs_rotation', 'abs_rotation_speed']#
Columns of the event data set that we want to aggregate as measures over the different events.
- class dispel.providers.generic.tasks.ps.EventDetectionAndFiltering[source]#
Bases:
ProcessingStepGroup
Pronation Supination event detection and filtering processing steps group.
- steps: List[ProcessingStep] = [<dispel.providers.generic.sensor.Upsample object>, <dispel.providers.generic.sensor.TransformFindZeroCrossings object>, <dispel.providers.generic.tasks.ps.TransformIntegrateBetweenZeros object>, <dispel.providers.generic.tasks.ps.TransformIdentifyEvent object>, <dispel.providers.generic.tasks.ps.TransformFilterEvent object>, <dispel.providers.generic.tasks.ps.TransformRemovePriorEvent object>]#
- class dispel.providers.generic.tasks.ps.EventMeasureExtractionGroup[source]#
Bases:
ProcessingStepGroup
Pronation Supination event-based measure extraction group.
- steps: List[ProcessingStep] = [<dispel.providers.generic.tasks.ps.TransformRotationSpeed object>, <dispel.providers.generic.tasks.ps.TransformAmplitudePeakToPeak object>, <dispel.providers.generic.tasks.ps.AggregateAmplitudeAndDurationGroup object>, <dispel.providers.generic.tasks.ps.AggregatePerHandAndMotionGroup object>, <dispel.providers.generic.tasks.ps.PerHandEventExtractionGroup object>]#
- class dispel.providers.generic.tasks.ps.ExtractAmplitudeDecrementSimple[source]#
Bases:
ExtractStep
Extract the simple version of decrement in amplitude.
- data_set_ids: str | Iterable[str] = 'ps_event_peak_peak'#
An iterable of data sets to be being processed
- definition: ValueDefinition | ValueDefinitionPrototype | None = <dispel.data.measures.MeasureValueDefinitionPrototype object>#
The specification of the measure definition
- description = 'The simple decrement of amplitude defined as the difference in median amplitude between the first and last 25% of the task.'#
- class dispel.providers.generic.tasks.ps.ExtractAvgMovementPowerFromTimeSeries[source]#
Bases:
ExtractStep
Extract average movement power from a time series.
- definition: ValueDefinition | ValueDefinitionPrototype | None = <dispel.data.measures.MeasureValueDefinitionPrototype object>#
The specification of the measure definition
- description = 'The average power of the signal in the defined 0 - 4 Hz frequency band.'#
- class dispel.providers.generic.tasks.ps.ExtractNEvent[source]#
Bases:
ExtractStep
Extract number of events that are either pronation or supination.
- definition: ValueDefinition | ValueDefinitionPrototype | None = <dispel.data.measures.MeasureValueDefinitionPrototype object>#
The specification of the measure definition
- description = 'The number of events that are a pronation or a supination.'#
- class dispel.providers.generic.tasks.ps.ExtractSpeedDecrementSimple[source]#
Bases:
ExtractStep
Extract the simple version of decrement in speed.
- definition: ValueDefinition | ValueDefinitionPrototype | None = <dispel.data.measures.MeasureValueDefinitionPrototype object>#
The specification of the measure definition
- description = 'The simple decrement of speed defined as the difference in median speed between the first and last 25% of the task.'#
- dispel.providers.generic.tasks.ps.MIN_EVENT_ROTATION = 30#
Define the minimal rotation of a valid event such as pronation and supination.
- class dispel.providers.generic.tasks.ps.Movement[source]#
Bases:
AVEnum
Enumerated constant representing the event modalities.
- PRONATION = 1#
- PROSUP = 3#
- SUPINATION = 2#
- class dispel.providers.generic.tasks.ps.MovementPowerGroup[source]#
Bases:
ProcessingStepGroup
Pronation Supination movement power processing steps group.
- steps: List[ProcessingStep] = [<dispel.processing.transform.Apply object>, <dispel.providers.generic.tasks.ps.ExtractAvgMovementPowerFromTimeSeries object>]#
- class dispel.providers.generic.tasks.ps.PerHandEventExtractionGroup[source]#
Bases:
ProcessingStepGroup
Pronation Supination per hand measure extraction group.
- steps: List[ProcessingStep] = [<dispel.processing.level.ProcessingStepGroup object>, <dispel.processing.level.ProcessingStepGroup object>]#
- class dispel.providers.generic.tasks.ps.PreprocessingPSGroup[source]#
Bases:
ProcessingStepGroup
Pronation Supination preprocessing steps.
- steps: List[ProcessingStep] = [<dispel.providers.generic.sensor.SetTimestampIndex object>, <dispel.providers.generic.sensor.Resample object>, <dispel.processing.transform.Apply object>]#
- class dispel.providers.generic.tasks.ps.TransformAmplitudePeakToPeak[source]#
Bases:
TransformStep
Compute amplitude of rotation peak to peak.
- static compute_abs_rot_peak_peak(data)[source]#
Compute absolute rotation peak to peak of pronation - supination.
- definitions: List[RawDataValueDefinition] = [<RawDataValueDefinition: start (Start timestamp indicating the beginning of the event.)>, <RawDataValueDefinition: end (end timestamp indicating the end of the event.)>, <RawDataValueDefinition: delta_t (Duration of the motion., s)>, <RawDataValueDefinition: abs_rotation (Absolute rotation for a pronation supination in degrees., deg)>]#
- class dispel.providers.generic.tasks.ps.TransformFilterEvent[source]#
Bases:
TransformStep
Enrich event with time boundaries and only keep defined event.
- definitions: List[RawDataValueDefinition] = [<RawDataValueDefinition: zero_crossings (zero crossings)>, <RawDataValueDefinition: rotation (rotation, deg)>, <RawDataValueDefinition: abs_rotation (absolute rotation, deg)>, <RawDataValueDefinition: event (Event indicating if the motion was a pronation or supination.)>, <RawDataValueDefinition: start (Start timestamp indicating the beginning of the event.)>, <RawDataValueDefinition: end (end timestamp indicating the end of the event.)>]#
- class dispel.providers.generic.tasks.ps.TransformIdentifyEvent[source]#
Bases:
TransformStep
Identify pronation supination given the rotation and the hand used.
Only pronation event and supination event for which the associated rotation is greater than MIN_EVENT_ROTATION in absolute value are considered.
- definitions: List[RawDataValueDefinition] = [<RawDataValueDefinition: zero_crossings (zero crossings)>, <RawDataValueDefinition: rotation (rotation, deg)>, <RawDataValueDefinition: abs_rotation (absolute rotation, deg)>, <RawDataValueDefinition: event (Event indicating if the motion was a pronation or supination.)>]#
- class dispel.providers.generic.tasks.ps.TransformIntegrateBetweenZeros[source]#
Bases:
TransformStep
Integrate gyroscope signal between zero crossings.
- definitions: List[RawDataValueDefinition] = [<RawDataValueDefinition: zero_crossings (zero crossings)>, <RawDataValueDefinition: rotation (rotation, deg)>, <RawDataValueDefinition: abs_rotation (absolute rotation, deg)>]#
- class dispel.providers.generic.tasks.ps.TransformRemovePriorEvent[source]#
Bases:
TransformStep
Remove event ending before active test phase.
- definitions: List[RawDataValueDefinition] = [<RawDataValueDefinition: zero_crossings (zero crossings)>, <RawDataValueDefinition: rotation (rotation, deg)>, <RawDataValueDefinition: abs_rotation (absolute rotation, deg)>, <RawDataValueDefinition: event (Event indicating if the motion was a pronation or supination.)>, <RawDataValueDefinition: start (Start timestamp indicating the beginning of the event.)>, <RawDataValueDefinition: end (end timestamp indicating the end of the event.)>]#
- class dispel.providers.generic.tasks.ps.TransformRotationSpeed[source]#
Bases:
TransformStep
Compute rotation speed per motion.
- static compute_rot_speed(data)[source]#
Compute average rotation speed during a pronation or supination.
- definitions: List[RawDataValueDefinition] = [<RawDataValueDefinition: zero_crossings (zero crossings)>, <RawDataValueDefinition: rotation (rotation, deg)>, <RawDataValueDefinition: abs_rotation (absolute rotation, deg)>, <RawDataValueDefinition: event (Event indicating if the motion was a pronation or supination.)>, <RawDataValueDefinition: start (Start timestamp indicating the beginning of the event.)>, <RawDataValueDefinition: end (end timestamp indicating the end of the event.)>, <RawDataValueDefinition: delta_t (Duration of the motion., s)>, <RawDataValueDefinition: rotation_speed (Average rotation speed in degrees during the motion., deg)>, <RawDataValueDefinition: abs_rotation_speed (Absolute value of the average rotation speed in degrees., deg)>]#