visual3d:tutorials:events:kinematic_event_detection
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revision | |||
visual3d:tutorials:events:kinematic_event_detection [2025/05/30 17:06] – wikisysop | visual3d:tutorials:events:kinematic_event_detection [2025/05/30 20:00] (current) – wikisysop | ||
---|---|---|---|
Line 49: | Line 49: | ||
* {{ : | * {{ : | ||
+ | ===== Workflow Outline ====== | ||
+ | 1. **Preprocessing in Visual3D** | ||
+ | The first stage involves preprocessing all participant data using the **Preprocessing_Pipeline.v3s** script. This step takes treadmill-only trials for each participant and puts them into a single CMZ file and computes joint kinematic data. | ||
- | ====== 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 and weight) are manually input from the provided spreadsheet. |
- | This tutorial is based on a research project presented at the Ontario Biomechanics Conference (OBC) 2025 titled "**Assessing Different | + | 2. **Understanding and Applying |
- | The goal of this tutorial is to help users replicate the research process | + | The next phase involves applying several published |
- | This tutorial | + | Each method |
- | ==== Objectives ==== | + | On top of the 9 methods (where HS and TO events are evaluated in their own methods, respectively), |
- | * Introduce | + | * One based on hip surpassing heel |
- | * Provide a step-by-step approach to structuring gait cycles in Visual3D. | + | * the other on peak knee flexion angle, offering alternative kinematic cues not commonly discussed |
- | * Compare | + | |
- | * Use downloadable data, Visual3D pipelines, and batch scripting workflows | + | |
- | ==== Background and Rationale ==== | ||
- | Traditionally, | ||
- | 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, | + | 3. **Apply |
- | In our project, we evaluated the following kinematic event detection methods: | + | Once individual method pipelines were validated, they were consolidated into a master script |
- | * {{ : | + | |
- | | + | |
- | | + | |
- | | + | |
- | * **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: | + | These durations are stored under the METRIC:: |
- | * Local minima/ | + | |
- | * Peak knee flexion or extension. | + | |
- | * Spatial relationship between foot and hip joint centers. | + | |
- | ==== Dataset Description ==== | + | 4. **Exporting to Python for Statistical Evaluation** |
- | This tutorial uses the [[https:// | + | Finally, |
- | * Journal Article: [[https:// | + | |
- | * **Participants**: | + | |
- | * **Trials**: 5-8 treadmill walking trials per participant, | + | |
- | * Data collected includes marker trajectories and kinetic data fr * om an instrumented treadmill. | + | |
- | **Important Notes:** | + | The structured data is then analyzed |
- | * Only left-side gait events were analyzed. | + | |
- | * Data was pre-processed to extract joint angles, segment positions and other features required for each algorithm. This will be included in the sample data. | + | |
- | ==== Downloads ==== | + | This statistical framework allows us to access the consistency and reliability of each method in reproducing gait cycle structure comparable to kinetic-based baselines. |
- | The ZIP File for this tutorial can be downloaded here. This provides files for the different steps of the workflow process of the research. | ||
- | === Compute Kinematic Parameters === | + | ---- |
- | Before applying the kinematic event methods, compute the joint angles and positions required. This typically includes the **Compute_Joint_Angle** and **Compute_Segment_Position**. | + | |
- | The base pipeline with all preprocessing steps. This will be used before applying any method-specific event logic. | ||
- | === Step 1: Set up your environment | + | ===== Preprocessing Using Visual3D ===== |
- | Organize the workspace by participant. Make sure each trial has: | + | |
- | * A working biomechanical model. | + | |
- | * Joint angle outputs. | + | |
- | === Step 2: Apply Kinetic Baseline Events === | + | 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, |
- | Use **Automatic_Gait_Event** command in Visual3D to generate Left Onset (LON) Kinetic events. These will serve as the gold-standard baseline. | + | |
+ | 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.txt · Last modified: 2025/05/30 20:00 by wikisysop