visual3d:tutorials:events:kinematic_event_detection
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
visual3d:tutorials:events:kinematic_event_detection [2025/05/30 15:48] – [Kinematic Event Detection] wikisysop | visual3d:tutorials:events:kinematic_event_detection [2025/05/30 20:00] (current) – wikisysop | ||
---|---|---|---|
Line 1: | Line 1: | ||
====== Assessing Kinematic Methods of Structuring Gait====== | ====== Assessing Kinematic Methods of Structuring Gait====== | ||
- | ===== Assessing Different Kinematic Methods of Structuring Gait ===== | + | ===== Overview - Abstract |
- | This tutorial is based on a research | + | This tutorial is a comprehensive walkthrough of a research |
- | The goal of this tutorial is to help users replicate the research process and understand ho to structure | + | The study, titled " |
- | This tutorial is intended for users who either do not have access to lab-grade kinetic instrumentation, | ||
- | ==== Objectives ==== | + | **Research Question: Are kinematic event detection methods |
- | | + | |
- | * Provide a step-by-step approach | + | |
- | * Compare | + | |
- | | + | |
- | ==== Background and Rationale ==== | + | The tutorial has been designed for biomechanics researchers, students, and clinicians interested in alternative |
- | Traditionally, gait cycle events such as Heel Strike (HS) and Toe Off (TO) are defined using force thresholds derived from ground reaction force (GRF) data. This method is reliable but dependent on lab based equipment. | + | |
- | Kinematic methods detect HS and TO using joint angles, segment velocities, or spatial relationships between anatomical markers. Although these methods are not perfect, they are crucial for field-based studies, clinical gait analysis, and wearable-only workflows. | + | ===== Introduction ====== |
- | In our project, we evaluated | + | In gait analysis, the ability to structure biomechanical waveforms into gait cycles is crucial for analyzing joint angles, segment kinematics, and for computing various gait measures like step length and phase durations. |
+ | |||
+ | Traditionally, | ||
+ | |||
+ | Given these limitations, | ||
+ | |||
+ | The aim of this tutorial is to present a step-by-step guide for using HAS-Motion software tools, specifically Visual3D, to process gait data and compare several kinematic-based methods against the kinetic-based gold standard. | ||
+ | |||
+ | ===== Dataset Description ===== | ||
+ | |||
+ | {{: | ||
+ | [[https:// | ||
+ | |||
+ | This investigation uses the publicly available dataset from [[https:// | ||
+ | |||
+ | The dataset consists of 24 younger participants (mean age ~27.6 years) and 18 older particpants (mean age ~62.7 years). Each subject completed both treadmill and overground walking trials across a range of speeds. For each trial, 3D kinematic data was captured using a 26-marker lower-body configuration at a sampling rate of 150 Hz, and ground reaction forces were recorded from an instrumented treadmill at 300 Hz. Metadata for each participant includes height, weight, segment length, sex, leg dominance, and treadmill speed. | ||
+ | |||
+ | This tutorial focuses exclusively on **treadmill trials** and analyzes only **left-side events** (LHS and LTO). This simplifies gait cycle definitions to the interval between two identical events on the same foot, which is essential for consistent waveform normalization. | ||
+ | |||
+ | ===== Sample Data Download and Contents ====== | ||
+ | |||
+ | To facilitate learning and application, | ||
+ | * Includes a Visual3D preprocessing pipeline (**Preprocessing_Pipeline**) that performs kinetic event detection and computes the necessary joint kinematics. | ||
+ | * **PREPROCESSED_PARTICIPANTS**: | ||
+ | * **FULL_PROCESSED_PARTICIPANTS**: | ||
+ | * **METHOD PIPELINES + MASTER**: Folder containing individual Visual3D pipeline scripts for each kinematic method (e.g., Zeni Method 1+2, DeAsha, Hreljac, etc.) and a master pipeline script that applies all methods and computes the metric of cycle duration. | ||
+ | * **WBDSmodel.mdh**: | ||
+ | * **AutoFormatted_Gait_Data_Final**: | ||
+ | |||
+ | Copies of the literature for the various kinematic methods used are also included in the ZIP archive: | ||
* {{ : | * {{ : | ||
* {{ : | * {{ : | ||
* {{ : | * {{ : | ||
- | * {{ : | + | * {{ : |
- | * **Max Knee Angle Method** - Local maximum events for knee reaching peak flexion. | + | |
- | * **Hip Surpasses Heel** - event placed when leading hip joint center overtakes opposite foot. | + | |
- | Each method identifies gait events based on unique kinematic patterns, such as: | + | ===== Workflow Outline ====== |
- | * Local minima/ | + | |
- | * Peak knee flexion or extension. | + | |
- | * Spatial relationship between foot and hip joint centers. | + | |
- | ==== Dataset Description ==== | + | 1. **Preprocessing in Visual3D** |
- | This tutorial uses the [[https:// | + | The first stage involves preprocessing all participant data using the **Preprocessing_Pipeline.v3s** script. This step takes treadmill-only trials |
- | | + | |
- | * **Participants**: | + | |
- | * **Trials**: 5-8 treadmill walking | + | |
- | * Data collected includes marker trajectories | + | |
- | **Important Notes:** | + | During this stage, ground reaction force (GRF) data is used to automatically detect kinetic gait events, establishing a **baseline** for later comparison. Subject-specific anthropometric data (height |
- | * Only left-side gait events were analyzed. | + | |
- | * Data was pre-processed to extract joint angles, segment positions | + | |
- | ==== Downloads ==== | + | 2. **Understanding and Applying Kinematic Method Pipelines** |
- | The ZIP File for this tutorial can be downloaded here. This provides files for the different steps of the workflow process of the research. | + | The next phase involves applying several published and custom kinematic methods to detect gait events without relying on kinetic data. |
- | === Compute Kinematic Parameters === | + | Each method is built using the Visual3D pipeline script to extract features such as foot position, velocity, hip extension, and marker accelerations. |
- | Before applying | + | |
- | The base pipeline with all preprocessing steps. This will be used before applying any method-specific event logic. | + | On top of the 9 methods (where HS and TO events are evaluated in their own methods, respectively), |
+ | * One based on hip surpassing heel | ||
+ | * the other on peak knee flexion angle, offering alternative kinematic cues not commonly discussed in literature. | ||
- | === Step 1: Set up your environment === | ||
- | Organize the workspace by participant. Make sure each trial has: | ||
- | * A working biomechanical model. | ||
- | * Joint angle outputs. | ||
- | === Step 2: Apply Kinetic Baseline Events | + | 3. **Apply and Generate Measures to Compare all Methods** |
- | Use **Automatic_Gait_Event** command in Visual3D to generate Left Onset (LON) Kinetic events. These will serve as the gold-standard baseline. | + | |
+ | Once individual method pipelines were validated, they were consolidated into a master script (**FinalPipeline_ALL_METHODS_SEQUENCES.v3s**). This pipeline computes all gait event across all methods simultaneously and then defines gait cycles based on those events. | ||
+ | |||
+ | These durations are stored under the METRIC:: | ||
+ | |||
+ | 4. **Exporting to Python for Statistical Evaluation** | ||
+ | |||
+ | Finally, the computed cycle durations are exported to an Excel file where each row represents one gait cycle instance. | ||
+ | |||
+ | The structured data is then analyzed in Python using a Linear Mixed Model (LMM). In this model, the event detection method is treated as the fixed effect, while participant ID and trial number are modeled as nested random effects. | ||
+ | |||
+ | This statistical framework allows us to access the consistency and reliability of each method in reproducing gait cycle structure comparable to kinetic-based baselines. | ||
+ | |||
+ | |||
+ | ---- | ||
+ | |||
+ | |||
+ | ===== Preprocessing Using Visual3D ===== | ||
+ | |||
+ | The first part of the analysis involves applying the preprocessing pipeline (Preprocessing_Pipeline.v3s). This script automates the loading of treadmill trials from each participant, | ||
+ | |||
+ | The following shows the steps to complete the preprocessing. If you prefer to start with the already preprocessed folder, you may skip to the **NEXT SECTION**. | ||
+ | |||
+ | 1. Open an empty workspace on the Visual3D | ||
+ | |||
+ | 2. Click **Open Pipeline** and browse to select the Preprocessing_Pipeline.v3s file included in the ZIP. | ||
+ | |||
+ | 3. This pipeline | ||
+ | * **Set_Pipeline_Parameter** command: / | ||
+ | * **Set_Subject_Height** and **Set_Subject_Weight** to specific values found on Subject_Info excel sheet from sample data. | ||
+ | |||
+ | For example, for PARTICIPANT #1: | ||
< | < | ||
- | Automatic_Gait_Events | + | Set_Pipeline_Parameter |
- | ! /FRAME_WINDOW=8 | + | / |
- | ! /USE_TPR=TRUE | + | **/ |
- | ! /TPR_EVENT_INSTANCE=1 | + | ! / |
+ | ! / | ||
+ | ! /PARAMETER_VALUE_PREFIX= | ||
+ | ! /PARAMETER_VALUE_APPEND= | ||
+ | ! /MULTI_PASS=FALSE | ||
; | ; | ||
</ | </ | ||
- | These events | + | {{: |
+ | |||
+ | 4. Now click **Execute Pipeline**, this will prompt the user to select the folder in which the raw c3d files are saved, browse for the **WBDSc3dWithGaitEvents** folder included within the original dataset. | ||
+ | |||
+ | 5. Next, you will be prompted to select a model file - **WBDSmodel.mdh**. | ||
+ | |||
+ | 6. Once the pipeline is executed, you will be prompted to save the participant CMZ to a location on your computer. Make sure they are placed within the same folder. | ||
+ | |||
+ | |||
+ | ===== Understanding and Applying Kinematic Methods ===== | ||
+ | |||
+ | Each kinematic method was implemented based on the procedures outlined in their original literature references. | ||
+ | |||
+ | **LHS/LTO Foot Position (Zeni Method 1) :** Heelstrike and toe off events | ||
+ | |||
+ | **LHS/LTO Foot Velocity (Zeni Method 2):** Method looks for zero-crossings in the foot velocity signal relative to the pelvis. HS is the point when the foot velocity changes from forward to backward; | ||
+ | |||
+ | **LHS Hip Extension (DeAsha Method):** Initial Contact (heelstrike) is inferred from the contralateral hip reaching its maximum extension. The hip flexion-extension angle is computed using the pelvis and thigh segments, and the event is marked using **Event_Minimum** commands on the sagittal plane angle. | ||
+ | |||
+ | **LHS/LTO Toe Acceleration (Hreljac Method):** This method uses peaks in heel and toe marker acceleration, | ||
+ | |||
+ | **LHS/LTO Heel Velocity (OConnor Method):** Foot velocity is derived from filtered heel and toe marker trajectories. Events are identified by checking for local minima combined with constraints such as the vertical position of the heel being below 35% of its range. | ||
+ | |||
+ | **Hip Surpassing Heel Method:** An event is detected when the leading hip joint center passes the position of the opposite foot, signaling a change in support limb. | ||
+ | |||
+ | **Knee Angle Max Method**: A simpler method that structures cycles based on successive local maxima of the knee flexion signal, using **Event_Maximum** | ||
+ | |||
+ | Each of these pipeline scripts define events AND compute the cycle duration using this events by placing them in sequences. | ||
+ | |||
+ | |||
+ | ===== Generating and Comparing Gait Cycles Across Methods ===== | ||
+ | |||
+ | Once each individual pipeline was validated, a master script called **FinalPipeline_ALL_METHODS_SEQUENCES.v3s** was constructed. This script applies all methods in sequence to each participant' | ||
+ | |||
+ | In order to apply this pipeline to all participant CMZs at once, **Sift** was used for it's batch processing capabilities while still allowing me to run a Visual3D pipeline script through the engine. The following steps were taken: | ||
+ | |||
+ | 1. Open the Sift application to an empty workspace, select the {{: | ||
+ | |||
+ | 2. Select the **Run V3D Engine (Gear Icon)** button on the taskbar and select **Add Script**. Use the previously mentioned master pipeline here -> click **Run Script**. | ||
+ | |||
+ | {{: | ||
+ | |||
+ | Once the pipeline has completed running on all the participant CMZ, you may open one on Visual3D to identify what was created. | ||
+ | |||
+ | |{{: | ||
+ | |||
+ | |||
+ | ===== Exporting Data for Statistical Analysis ===== | ||
+ | |||
+ | After processing, gait cycle duration data is exported using **Export_Data_To_ASCIII**. The command extracts mean cycle duration values for each trial and method combination, | ||
+ | |||
+ | |**SUBJECT NO.**|**TRIAL**|**METHOD**|**CYCLE_INSTANCE**|**CYCLE_DURATION**| | ||
+ | |Sub01 | ||
+ | |||
+ | |||
+ | ===== Statistical Evaluation Using Linear Mixed Models ====== | ||
+ | To evaluate the agreement between kinematic methods and the kinetic baseline, a Linear Mixed Model (LMM) was applied in Python using **statsmodels**. The dependent variable was cycle duration. The fixed effect was the detection method, while nested random effects were defined for participant and trial. | ||
- | ==== Results Summary ==== | + | LMM was chosen because it can model variability within and between participants and handle repeated measures across conditions. |
- | The project found that: | + | |
- | * Zeni's method 1 (HS foot vertical position), method 2 (TO foot vertical position), and peak knee angle method produced the most reliable cycles compared to the kinetic baseline. | + | |
- | * Some methods introduced variability as speed increased. | + | |
- | * Kinematic methods are viable alternatives in environments without force plates, provided method-specific biases are considered. | + | |
+ | ===== Conclusions ===== | ||
+ | This tutorial demonstrates that while kinetic event detection remains the gold standard, kinematic methods—especially those based on relative foot position or knee angles—can offer reliable alternatives for structuring gait waveforms. These findings are especially relevant for field-based settings and markerless applications. | ||
+ | By providing sample data, executable pipelines, and analysis scripts, this tutorial equips users with a practical workflow for comparing gait cycle structuring methods and generating reproducible results. | ||
visual3d/tutorials/events/kinematic_event_detection.1748620111.txt.gz · Last modified: 2025/05/30 15:48 by wikisysop