MeasurementEvaluationMetric
The measurement_evaluation_metric.py
module provides the MeasurementEvaluationMetric
enum. This enum contains helper functions to quickly evaluate various metrics from a Measurement
object, which is useful for analysis and visualization.
Enum Members
LUMBAR_ANGLE
: The bend angle of the lumbar spine.TWIST
: The twist angle of the spine.LATERAL
: The lateral flexion of the spine.SAGITTAL
: The sagittal flexion of the spine.LATERAL_APPROX
: An approximation of the lateral flexion.SAGITTAL_APPROX
: An approximation of the sagittal flexion.THORACIC_ANGLE
: The angle of the thoracic spine.ACCELERATION
: The acceleration in the forward direction.GYRO
: The overall movement based on gyroscope data.
Methods
exec(self, measurements)
Takes a list of Measurement
objects or an AnnotatedRecording
and returns a list of metric values for each measurement.
func(self, m)
Takes a single Measurement
object and returns the calculated metric value.
is_angle
Property
A boolean property that is True
if the metric is an angle, and False
otherwise (e.g., for acceleration or gyro).
Usage Example
from flexlib.models.measurement_evaluation_metric import MeasurementEvaluationMetric
from flexlib.models.flex_reader import FlexReader
# Assuming 'your_recording.csv' contains measurement data
recording = FlexReader.parse('your_recording.csv')
# Get the lumbar angle for all measurements
lumbar_angles = MeasurementEvaluationMetric.LUMBAR_ANGLE.exec(recording)
# Get the twist for the first measurement
first_measurement = recording.measurements[0]
twist = MeasurementEvaluationMetric.TWIST.func(first_measurement)
print(f"Lumbar angles: {lumbar_angles[:5]}...")
print(f"Twist of first measurement: {twist}")