gaitmap.parameters.TemporalParameterCalculation#
- class gaitmap.parameters.TemporalParameterCalculation(expected_stride_type: Literal['min_vel', 'ic'] = 'min_vel')[source]#
Calculat temporal parameters of strides based on detected gait events.
For details on the individual parameters see the Notes section. Calculations are based on [1].
- Parameters:
- expected_stride_type
The expected stride type of the stride list. This changes how the temporal parameters are calculated. This can either be “min_vel” or “ic”. “min_vel” stride lists are the typical output from Gaitmap event detection methods. However, for other systems (e.g. mocap systems) strides might be defined from one ic to the next ic. In this case the expected_stride_type should be “ic”.
- Other Parameters:
- stride_event_list
Gait events for each stride obtained from Rampp event detection as type
min_vel-stride list.- sampling_rate_hz
The sampling rate of the data signal.
- Attributes:
- parameters_
Data frame containing temporal parameters for each stride in case of single sensor or dictionary of data frames in multi sensors.
parameters_pretty_Return parameters with column names indicating units.
See also
gaitmap.parameters.SpatialParameterCalculationCalculate spatial parameters
Notes
- stride_time [s]
The stride time is the duration of the stride calculated based on the ic events of the stride. For a
min_vel-stride the stride time is calculated by subtracting “pre_ic” from “ic”. For aic-stride the stride time is calculated by subtracting “start”/”ic” from “end”.- swing_time [s]
The swing time is the time from the tc to the next ic. For a
min_vel-stride this is the time between “tc” and “ic” For aic-stride this is the time between “tc” and “end”.- stance_time [s]
The stance time is the time the foot is on the ground. Hence, it is the time from a ic to the next tc. For both stride types this is calculated as stride_time - swing_time.
[1]A. Rampp, J. Barth, S. Schuelein, K.-G. Gassmann, J. Klucken, and B. M. Eskofier, “Inertial Sensor-Based Stride Parameter Calculation From Gait Sequences in Geriatric Patients,” IEEE Transactions on Biomedical Engineering, vol. 62, no. 4, pp. 1089-1097, Apr. 2015. [Online]. Available: http://ieeexplore.ieee.org/document/6949634/
Examples
This method requires the output of a event detection method as input.
>>> stride_list = ... # from event detection >>> temporal_paras = TemporalParameterCalculation() >>> temporal_paras = temporal_paras.calculate(stride_event_list=stride_list, sampling_rate_hz=204.8) >>> temporal_paras.parameters_ <Dataframe/dictionary with all the parameters> >>> temporal_paras.parameters_pretty_ <Dataframe/dictionary with all the parameters with units included in column names>
Methods
calculate(stride_event_list, sampling_rate_hz)Find temporal parameters of all strides after segmentation and detecting events for all sensors.
clone()Create a new instance of the class with all parameters copied over.
from_json(json_str)Import an gaitmap object from its json representation.
get_params([deep])Get parameters for this algorithm.
set_params(**params)Set the parameters of this Algorithm.
to_json()Export the current object parameters as json.
- calculate(stride_event_list: DataFrame | dict[Union[collections.abc.Hashable, str], pandas.core.frame.DataFrame], sampling_rate_hz: float) Self[source]#
Find temporal parameters of all strides after segmentation and detecting events for all sensors.
- Parameters:
- stride_event_list
Gait events for each stride obtained from event detection
- sampling_rate_hz
The sampling rate of the data signal.
- Returns:
- self
The class instance with temporal parameters populated in
self.parameters_,self.parameters_pretty_
- clone() Self[source]#
Create a new instance of the class with all parameters copied over.
This will create a new instance of the class itself and all nested objects
- classmethod from_json(json_str: str) Self[source]#
Import an gaitmap object from its json representation.
For details have a look at the this example.
You can use the
to_jsonmethod of a class to export it as a compatible json string.- Parameters:
- json_str
json formatted string
- get_params(deep: bool = True) dict[str, Any][source]#
Get parameters for this algorithm.
- Parameters:
- deep
Only relevant if object contains nested algorithm objects. If this is the case and deep is True, the params of these nested objects are included in the output using a prefix like
nested_object_name__(Note the two “_” at the end)
- Returns:
- params
Parameter names mapped to their values.