User Tools

Site Tools


visual3d:documentation:pipeline:event_commands:automatic_gait_events

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
visual3d:documentation:pipeline:event_commands:automatic_gait_events [2025/02/13 19:10] – [Overview] wikisysopvisual3d:documentation:pipeline:event_commands:automatic_gait_events [2025/04/28 14:07] (current) wikisysop
Line 1: Line 1:
-===== Automatic Gait Events =====+====== Automatic Gait Events =====
 +===== Overview ===== 
 +Gait events describe key moments in the walking or running cycle - such as heel-strikes and toe-offs. If [[Visual3D:Documentation:Kinematics_and_Kinetics:External_Forces:Force_Assignment|Force Platform assignments]] exist for a motion trial, the **Automatic_Gait_Events** command __automatically__ detects these gait events and places an **event label** at the frames where the subject steps ON and OFF the surface of the platform.
  
-==== Overview ==== +Before running this command, the model must have segments created so that the program can recognize the left from the right. These segments are not limited to feet, they simply describe the part of body which makes contact with the force platformContacts with the floor for which there are //no force platforms// can then be determined using **TPR**, this will be seen in the dialog box for this command. No signals need to be provided for the TPR because Visual3D uses the kinematics of the segment making contact with the force platform.
-Gait events describe key moments in the walking or running cycle - such as heel-strikes and toe-offsIf [[Visual3D:Documentation:Kinematics_and_Kinetics:External_Forces:Force_Assignment|Force Platform assignments]] exist for a motion trial, this command __automatically detects these gait events and places an **event label** at the frames where the subject steps ON and OFF the surface of the platform.__+
  
-Before running this command, the model must have segments created so that the program can recognize which is left and right. These segments are not limited to feetthey simply describe the part of body which makes contact with the force platform. +The following is an overall outline of how to use this command. As a reminder, the **Automatic_Gait_Events** pipeline command can be used to create gait events __if__ force platforms exist in a dynamic trial and ON/OFF events indicate kinetic cycles and HS/TO indicate kinematic cycles. 
 +  - A static trial must be loaded into the workspace and a minimum of two segments must be created (for standard gait trials, this means a left/right foot segment must be created). 
 +  - If a force platform assignment exists in a dynamic trialON/OFF events will be created when [[Visual3D:Documentation:Kinematics_and_Kinetics:External_Forces:Force_Assignment|Force Assignments]] exist. A Force Assignment exists IF: 
 +    - A segment’s center of mass (ANY segment) falls within the specified [[Visual3D:Documentation:Modeling:Segments:Segment_to_COFP_Distance|distance between center of force pressure to segment]]. 
 +    - The force signal goes above the specified [[Visual3D:Documentation:Kinematics_and_Kinetics:External_Forces:Force_Platforms#Minimum_Force|minimum force platform value]]. 
 +  - If “Use Pattern Recognition to Create (L/R)HS and (L/R)TO labels” is checked, and if an ON/OFF event was created in a trial, a HS/TO event will be created in the trial based on the position of the foot segment: (See [[#Event_TPR_Signal|Event_TPR_Signal]] section for more information on this) 
 +    - HS events will be created based on the Axial and AP position of the proximal end of the foot 
 +    - TO events will be created based on the Axial and AP position of the distal end of the foot
  
-Contact with the floor for which there are //no force platforms// can be determined using **Temporal Proximity Rule (TPR)**, this will be seen in the dialog box for this command. No signals need to be provided for the TPR because Visual3D uses the kinematics of the segment making contact with the force platform. +===== Pipeline Command =====
- +
-==== Pipeline Command ====+
 This pipeline command was updated in version 5 so that users no longer need so specify the direction of gravity, as Visual3D can determine this internally. Both versions of the command are listed below. This pipeline command was updated in version 5 so that users no longer need so specify the direction of gravity, as Visual3D can determine this internally. Both versions of the command are listed below.
  
Line 31: Line 37:
 The following table shows the command parameters for **Version 5+**. The following table shows the command parameters for **Version 5+**.
  
-|**Automatic_Gait_Events**|**Parameter Description**|+|**Parameter**|**Parameter Description**|
 |**! /FRAME_WINDOW = 8**|The frame window used for pattern recognition (default = 8)| |**! /FRAME_WINDOW = 8**|The frame window used for pattern recognition (default = 8)|
-|**! /USE_TPR=TRUE**|Enables TPR Algorithm is used to find the heelstrike (HS) and toeoff (TO).| +|**! /USE_TPR=TRUE**|Enables TPR Algorithm to be used to find the heelstrike (HS) and toeoff (TO).| 
-| **! /TPR_EVENT_INSTANCE=1**  |Instance used of detected event.|+| **! /TPR_EVENT_INSTANCE=1** Which instance to use to detect events using TPR.|
  
-==== Dialog ====+===== Dialog =====
 The dialog for the command can be accessed by double-clicking it the left mouse button while placed in the pipeline. The dialog for the command can be accessed by double-clicking it the left mouse button while placed in the pipeline.
  
Line 43: Line 49:
   * **Use Pattern Recognition to Create (L/R)HS and (L/R)TO Labels**: applies pattern recognition to identify gait cycle events.   * **Use Pattern Recognition to Create (L/R)HS and (L/R)TO Labels**: applies pattern recognition to identify gait cycle events.
   * **Frame Window for Pattern Recognition**: Number of frames used for pattern recognition   * **Frame Window for Pattern Recognition**: Number of frames used for pattern recognition
-  * **Instance of ON/OFF to use for TPR**: Determines which instance of an ON/OFF transition is used for event detection with TPR. +  * **Instance of ON/OFF to use for TPR**: Determines how many instances of an ON/OFF transition is used for event detection with TPR.
-==== Notes ====+
  
-=== Gait Event Acronyms === 
-Definitions of the gait event acronyms used in Visual3D are shown below. 
  
-The automatic gait events command and many of the events created in the tutorials, and used in the example files have 3 (or 4character labels that have been used consistently throughout history. The labels are divided into two categories:+===== Examples ===== 
 + 
 +The following examples will show different methods in which Automatic_Gait_Events can be used alongside other. 
 + 
 +==== Example 1: Simple Scenario ==== 
 +The first example shows the functionality of the **Automatic_Gait_Events** command. After loading in your workspace containing a static and dynamic trial (with force assignments), you can simply add the command into the pipeline, which will look as follows:
  
-1. The kinematically based category includes: 
 <code> <code>
-**RHS**= Right Heel Strike +Automatic_Gait_Events 
-**RTO**Right Toe Off +! /FRAME_WINDOW=8 
-**LHS**Left Heel Strike +! /USE_TPR=TRUE 
-**LTO**Left Toe Off+! /TPR_EVENT_INSTANCE=
 +;
 </code> </code>
  
-2The kinetically based category refers to those events that describe contact with a force platforms:+After executing the pipeline, you will notice a new folder in your Signals and Events tab called **EVENT_LABEL**, with all the gait events the program automatically detected. 
 + 
 +{{:visual3d:documentation:pipeline:event_commands:event_label_data_tree_new_folder.png?300|}} 
 + 
 +==== Example 2: Start-to-Finish ==== 
 + 
 +In the next example, the **Automatic_Gait_Events** command will be used with other commands to allow user to go from starting with empty workspace to finding and highlighting events.  
 + 
 +  * Open the user-selected workspace file. ([[visual3d:documentation:pipeline:file_commands:file_open|File_Open]]) 
 +  * **Automatically detect gait events.**  
 +  * Iterate through and highlight all gait events. ([[visual3d:documentation:pipeline:pipeline_commands:for_each_and_end_for_each|For_Each]]) -> ([[visual3d:documentation:pipeline:other_commands:highlight_event_label|Highlight_Event_Label]]) 
 +  * Switch to Signals and Events tab, and graph X-component of Force Platform signal (events will be shown on this graph). ([[visual3d:documentation:pipeline:other_commands:switch_between_tabs|Switch_Between_Tabs]]) -> ([[visual3d:documentation:pipeline:report_commands:interactive_graph_signals|Interactive_Graph_Signals]]) 
 + 
 +The pipeline will look as follows: 
 <code> <code>
-**RON**Right On +File_Open 
-**ROFF**Right Off +/FILE_NAME
-**LON**Left On +! /FILE_PATH
-**LOFF**Left Off +! /SEARCH_SUBFOLDERS=FALSE 
-</code>+! /SUFFIX
 +/SET_PROMPT=File_Open 
 +! /ON_FILE_NOT_FOUND=PROMPT 
 +! /FILE_TYPES_ON_PROMPT= 
 +;
  
-All RON events are also RHS events, but RON events are only created when contact is made with a force platform. +Automatic_Gait_Events 
 +! /FRAME_WINDOW=8 
 +! /USE_TPR=TRUE 
 +! /TPR_EVENT_INSTANCE=1 
 +;
  
-This provides a means to declare a range of data for reporting only when in contact with the force platform. This is because Joint Moments and Joint Powers, for example, do not have meaningful data when the foot is in contact with ground but no ground reaction forces are measured. 
  
-=== Outline === +For_Each 
-The following is an overall outline of the use of this command. As a reminder: +/ITERATION_PARAMETER_NAME=EVENT 
-  * The **Automatic_Gait_Events** pipeline command can be used to create gait events __if__ force platforms exist in a dynamic trial. +! /ITERATION_PARAMETER_COUNT_NAME= 
-  * ON/OFF events indicate kinetic cycles and HS/TO indicate kinematic cycles.+/ITEMSLHS+LTO+LOFF+LON+RHS+RTO+ROFF+RON 
 +;
  
-  - A static trial must be loaded into the workspace and a minimum of two segments must be created (for standard gait trials, this means a left/right foot segment must be created).\\ +Highlight_Event_Label 
-  - If a force platform assignment exists in a dynamic trial, ON/OFF events will be created when [[Visual3D:Documentation:Kinematics_and_Kinetics:External_Forces:Force_Assignment|Force Assignments]] exist. A Force Assignment exists IF:\\ +/EVENT_LABEL= ::EVENT 
-    - A segment’s center of mass (ANY segment) falls within the specified [[Visual3D:Documentation:Modeling:Segments:Segment_to_COFP_Distance|distance between center of force pressure to segment]].\\ +! /REMOVE_EXISTING_HIGHLIGHTS=FALSE 
-    - The force signal goes above the specified [[Visual3D:Documentation:Kinematics_and_Kinetics:External_Forces:Force_Platforms#Minimum_Force|minimum force platform value]].\\ +; 
-  - If “Use Pattern Recognition to Create (L/R)HS and (L/R)TO labels” is checked, and if an ON/OFF event was created in a trial, a HS/TO event will be created in the trial based on the position of the foot segment(See [[#Event_TPR_Signal|Event_TPR_Signal]] section for more information on this)\\ + 
-    - HS events will be created based on the Axial and AP position of the proximal end of the foot\\ +End_For_Each 
-    - TO events will be created based on the Axial and AP position of the distal end of the foot\\+/ITERATION_PARAMETER_NAME=EVENT 
 +
 + 
 +Switch_Between_Tabs 
 +/SHOW_SIGNALS_AND_EVENTS_TAB=TRUE 
 +! /SHOW_WORKSPACE_TAB=FALSE 
 +! /SHOW_MODELS_TAB=FALSE 
 +
 + 
 +Interactive_Graph_Signals 
 +/SIGNAL_TYPES=FORCE 
 +/SIGNAL_FOLDER=ORIGINAL 
 +/SIGNAL_NAMES=FP1 
 +/SIGNAL_COMPONENTS=X 
 +/GRAPH_INDEX=1 
 +/GRAPH_SUBINDEX=1 
 +! /ZOOM_START_TIME= 
 +! /ZOOM_END_TIME= 
 +/REPLACE_CURRENT=TRUE 
 +</code> 
 + 
 +After having run this pipeline, the program is able to display the following graph:  
 +\\ 
 +{{:visual3d:documentation:pipeline:event_commands:samplegraph.png?500|}} 
 + 
 +==== Example 3: Mimicking Automatic_Gait_Events ====
  
-=== Equivalent Pipeline Commands === 
 To show the simplicity of this command, an example pipeline will be shown below to mimic the same functionality using other existing commands, however, it will not necessarily produce the precise TPR created events. To show the simplicity of this command, an example pipeline will be shown below to mimic the same functionality using other existing commands, however, it will not necessarily produce the precise TPR created events.
-  * Creating events from kinematic data is accurate to approximately plus/minus 2 frames. + 
-  * In this example, the subject is walking in the +Y direction of the laboratory. The Automatic_Gait_Events command allows Visual3D to determine the direction of walking from the data.+Creating events from kinematic data is accurate to approximately plus/minus 2 frames. In this example, the subject is walking in the +Y direction of the laboratory. The Automatic_Gait_Events command allows Visual3D to determine the direction of walking from the data.
  
 <code> <code>
Line 95: Line 149:
 ; ;
  
-If_Condition +Conditional_Statement 
-/EXPRESSION=::FOOT == "LFT"+/ITERATION_PARAMETER_NAME=LEFT 
 +/EXPRESSION=::FOOT == "LFT" 
 +! /AS_INTEGER=TRUE
 ; ;
     Set_Pipeline_Parameter     Set_Pipeline_Parameter
Line 114: Line 170:
     /VALUE=LTO     /VALUE=LTO
     ;     ;
-Else+     
 +Conditional_Statement_End 
 +/ITERATION_PARAMETER_NAME=LEFT 
 +
 + 
 +Conditional_Statement 
 +/ITERATION_PARAMETER_NAME=RIGHT 
 +! /EXPRESSION=::FOOT != "LFT" 
 +! /AS_INTEGER=TRUE
 ; ;
     ! Right foot events     ! Right foot events
Line 133: Line 197:
     /VALUE=RTO     /VALUE=RTO
     ;     ;
-End_If+Conditional_Statement_End 
 +/ITERATION_PARAMETER_NAME=RIGHT
 ; ;
  
Line 196: Line 261:
 </code> </code>
  
-=== Event_TPR_Signal === +===== Notes =====
-A description of the use of [[Visual3D:Documentation:Pipeline:Event_Commands:Event_TPR_Signal|Event_TPR_Signal]] for determining gait events when a force platform signal is present is presented in the following article: +
-  * **Stanhope SJ, Kepple TM, McGuire DA, Roman NL.**(1990) "A Kinematic-Based Technique for Event Time Determination During Gait." Medical and Biological Engineering and Computing 28:355-360.+
  
-[[Visual3D:Documentation:Pipeline:Event_Commands:Event_TPR_Signal|Event_TPR_Signal]] for the Automatic Gait algorithm uses the Axial and AP trajectory of the proximal end of the foot segment for detecting **Heel Strike**, while using the distal end of the foot segment for detecting **Toe Off**. +==== Gait Event Acronyms ==== 
-  * **Heel Strike**: uses the signal KINETIC_KINEMATIC::RFT::ProxEndPos and KINETIC_KINEMATIC::LFT::ProxEndPos +Definitions of gait event acronyms used in Visual3D are shown below.
-  * **Toe Off**: uses the signal KINETIC_KINEMATIC::RFT::DistEndPos and KINETIC_KINEMATIC::LFT::DistEndPos +
- +
-The HS and TO pattern recognition algorithms are not a generic one size fits all gait recognition algorithm, but rather it looks at the first ON and OFF events and matches the subject's specific pattern at the heel and toe to find other instances of the subject/trial specific pattern within a trial. The algorithm works very well, but if the pattern changes within a trial then the different HS or TO may not be identified. +
- +
-=== Visual3D Versions supporting Subject Prefixes === +
- +
-When defining events for subjects that use a prefix to define the data belonging to that subject, event labels will also have the prefix of the subject the events belong to. +
- +
-**NOTE**: When using events in a command, the commands will iterate across subjects contained in the current workspace. As such, events and sequences listed as command parameters should NOT contain a prefix. As each subject is processed, the event range/sequence specified will automatically use the specific events prefixed for each subject as they are processed. +
- +
- +
-==== Examples ==== +
- +
-The following examples will show different methods in which Automatic_Gait_Events can be used alongside other commands for user applications. +
- +
-=== Example 1 === +
-The first example shows the functionality of the **Automatic_Gait_Events** command. After loading in your workspace containing a static and dynamic trial (with force assignments), you can simply add the command into the pipeline, which will look as follows:+
  
 +The automatic gait events command, many of the events created in the tutorials, and events used in the example files have a 3 (or 4) character label that have been used consistently throughout history. The labels are divided into two categories:
  
 +1. Kinematic Events:
 <code> <code>
-Automatic_Gait_Events +**RHS**Right Heel Strike 
-! /FRAME_WINDOW=8 +**RTO**Right Toe Off 
-! /USE_TPR=TRUE +**LHS**Left Heel Strike 
-! /TPR_EVENT_INSTANCE=1 +**LTO**= Left Toe Off
-;+
 </code> </code>
  
-After executing the pipeline, you will notice a new folder in your Signals and Events tab called **EVENT_LABEL**, within it is all of the gait events which the program automatically detected and set. +2. Kinetic Events:
- +
-{{:visual3d:documentation:pipeline:event_commands:event_label_data_tree_new_folder.png?300|}} +
- +
-=== Example === +
- +
-In the next example, the **Automatic_Gait_Events** command will be used alongside others in a pipeline which allows the user to do the following starting from an empty project workspace: +
-  * Open the user-selected workspace file([[visual3d:documentation:pipeline:file_commands:file_open|File_Open]]) +
-  * **Automatically detect gait events.**  +
-  * Iterate through and highlight LHS, LTO, and BTWN event labels. ([[visual3d:documentation:pipeline:pipeline_commands:for_each_and_end_for_each|For_Each]]) -> ([[visual3d:documentation:pipeline:other_commands:highlight_event_label|Highlight_Event_Label]]) +
-  * Switch to Signals and Events tab, and graph X-component of Force Platform signal (events will be shown on this graph). ([[visual3d:documentation:pipeline:other_commands:switch_between_tabs|Switch_Between_Tabs]]) -> ([[visual3d:documentation:pipeline:report_commands:interactive_graph_signals|Interactive_Graph_Signals]]) +
- +
-The pipeline will look as follows: +
 <code> <code>
-File_Open +**RON**Right On 
-/FILE_NAME+**ROFF**Right Off 
-! /FILE_PATH+**LON**Left On 
-! /SEARCH_SUBFOLDERS=FALSE +**LOFF**Left Off 
-! /SUFFIX+</code>
-/SET_PROMPT=File_Open +
-! /ON_FILE_NOT_FOUND=PROMPT +
-! /FILE_TYPES_ON_PROMPT= +
-;+
  
-Automatic_Gait_Events +All RON events are also RHS events, but RON events are only created when contact is made with a force platform. This provides a means to declare a range of data for reporting only when in contact with the force platform. This is because Joint Moments and Joint Powers, for example, do not have meaningful data when the foot is in contact with ground but no ground reaction forces are measured.
-! /FRAME_WINDOW=8 +
-! /USE_TPR=TRUE +
-! /TPR_EVENT_INSTANCE=1 +
-;+
  
 +==== Event_TPR_Signal ====
 +A description of the use of [[Visual3D:Documentation:Pipeline:Event_Commands:Event_TPR_Signal|Event_TPR_Signal]] for determining gait events when a force platform signal is present is presented in Stanhope et al.'s paper "A Kinematic-Based Technique for Event Time Determination During Gait."((Stanhope SJ, Kepple TM, McGuire DA, Roman NL. (1990) "A Kinematic-Based Technique for Event Time Determination During Gait." Medical and Biological Engineering and Computing 28:355-360.))
  
-For_Each +[[Visual3D:Documentation:Pipeline:Event_Commands:Event_TPR_Signal|Event_TPR_Signal]] for the Automatic Gait algorithm uses the Axial and AP trajectory of the proximal end of the foot segment for detecting **Heel Strike**while using the distal end of the foot segment for detecting **Toe Off**. 
-/ITERATION_PARAMETER_NAME=EVENT +  * **Heel Strike**uses the signal KINETIC_KINEMATIC::RFT::ProxEndPos and KINETIC_KINEMATIC::LFT::ProxEndPos 
-! /ITERATION_PARAMETER_COUNT_NAME= +  * **Toe Off**uses the signal KINETIC_KINEMATIC::RFT::DistEndPos and KINETIC_KINEMATIC::LFT::DistEndPos
-/ITEMS= LHS+LTO+LOFF+LON+RHS+RTO+ROFF+RON +
-+
- +
-Highlight_Event_Label +
-/EVENT_LABEL= ::EVENT +
-! /REMOVE_EXISTING_HIGHLIGHTS=FALSE +
-+
- +
-End_For_Each +
-/ITERATION_PARAMETER_NAME=EVENT +
-+
- +
-Switch_Between_Tabs +
-/SHOW_SIGNALS_AND_EVENTS_TAB=TRUE +
-! /SHOW_WORKSPACE_TAB=FALSE +
-! /SHOW_MODELS_TAB=FALSE +
-+
- +
-Interactive_Graph_Signals +
-/SIGNAL_TYPES=FORCE +
-/SIGNAL_FOLDER=ORIGINAL +
-/SIGNAL_NAMES=FP1 +
-/SIGNAL_COMPONENTS=X +
-/GRAPH_INDEX=1 +
-/GRAPH_SUBINDEX=1 +
-! /ZOOM_START_TIME= +
-! /ZOOM_END_TIME= +
-/REPLACE_CURRENT=TRUE +
-</code> +
- +
-After having simply run this pipeline, the program is able to display the following graph:  +
-\\ +
-{{:visual3d:documentation:pipeline:event_commands:samplegraph.png?500|}} +
  
 +The HS and TO pattern recognition algorithms are not a generic one size fits all gait recognition algorithm, but rather it looks at the first ON and OFF events and matches the subject's specific pattern at the heel and toe to find other instances of the subject/trial specific pattern within a trial. The algorithm works very well, but if the pattern changes within a trial then the different HS or TO may not be identified.
  
 +==== Working with Multisubject Data ====
  
 +Visual3D handles [[visual3d:documentation:definitions:multisubject|multisubject]] data by using the [[visual3d:documentation:definitions:subject_prefixes|subject prefixes]] in the C3D file to distinguish which data belongs to which subject. In this case the automatic gait event labels will also have the prefix of the subject to which the events belong.
  
 +**NOTE**: When using events in a command, the commands will iterate across subjects contained in the current workspace. As such, events and sequences listed as command parameters should NOT contain a prefix. As each subject is processed, the event range/sequence specified will automatically use the specific events prefixed for each subject as they are processed.
  
visual3d/documentation/pipeline/event_commands/automatic_gait_events.1739473810.txt.gz · Last modified: 2025/02/13 19:10 by wikisysop