gaitmap.stride_segmentation: Algorithms to find stride candidates#

The gaitmap.stride_segmentation contains popular algorithms to detect strides in a sensor signal.

The stride segmentation module includes all algorithms that are able to find stride candidates in a continuous sensor signal. Some are able to directly detect individual biomechanical events. Other algorithm are only able to detect stride candidates and need to be paired by an explicit event detection algorithm, as implemented in gaitmap.event_detection, to be able to provide information about biomechanical events.

Dtw Stride Segmentation#

Classes#

BaseDtw([template, resample_template, ...])

A basic implementation of subsequent dynamic time warping.

BarthDtw([template, resample_template, ...])

Segment strides using a single stride template and Dynamic Time Warping.

ConstrainedBarthDtw([template, ...])

A version of BarthDtw that uses local warping constraints by default.

RoiStrideSegmentation([...])

Apply any stride segmentation algorithms to specific regions of interest in a longer dataset.

BaseDtwTemplate(*[, scaling, use_cols])

Base class for dtw templates.

DtwTemplate(*[, data, sampling_rate_hz, ...])

Wrap all required information about a dtw template.

BarthOriginalTemplate(*[, scaling, use_cols])

Template used for stride segmentation by Barth et al.

InterpolatedDtwTemplate(*[, data, ...])

A template that is created by interpolating and then averaging the data of multiple sequences.

Functions#

find_matches_find_peaks(acc_cost_mat, ...)

Find matches in the accumulated cost matrix using find_peaks.

find_matches_min_under_threshold(...)

Find matches in the accumulated cost matrix by searching for minima in sections enclosed by the max_cost.

HMM Stride Segmentation#

HmmStrideSegmentation(model[, ...])

Segment strides using a pre-trained Hidden Markov Model.

RothSegmentationHmm([stride_model, ...])

A hierarchical HMM model for stride segmentation proposed by Roth et al. [R1f7b76ab672d-1].

BaseSegmentationHmm()

Base class for HMM segmentation models.

SimpleHmm(n_states, n_gmm_components, *[, ...])

Wrap all required information to train a new HMM.

RothHmmFeatureTransformer([...])

Transform all data and stride labels into the feature space required for training an HMM.

PreTrainedRothSegmentationModel()

Load a pre-trained stride segmentation HMM.

BaseHmmFeatureTransformer()

Baseclass for HMM feature transformers used in combination with SimpleSegmentationModel.