User Tools

Site Tools


visual3d:documentation:pipeline:metric_commands:metric_cross_product

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:metric_commands:metric_cross_product [2025/10/02 18:58] – [Examples] wikisysopvisual3d:documentation:pipeline:metric_commands:metric_cross_product [2025/10/03 17:35] (current) – [Example: Computing Step Length from Stride Vectors Using Dot Product] wikisysop
Line 63: Line 63:
 The results are concatenated to an existing signal. The results are concatenated to an existing signal.
  
-====Examples====+====Example: Computing Step Length from Stride Vectors Using Dot Product==== 
 +In this example the **Metric Cross Product** command is used along with **Metric Vector Between Events** and **Automatic Gait Events** to find the width of each step in a gait trial.
  
-===Simple exampleStride Vectors=== +First all files are selected as active and key gait events are defined for each trial:
-Here we use the **Metric Cross Product** command to compute step width from previously calculated stride vectors found using **Metric Vector Between Events**.+
  
-The command is as follows:+<code> 
 +Select_Active_File  
 +/FILE_NAME=ALL_FILES  
 +
 + 
 +Automatic_Gait_Events 
 +! /FRAME_WINDOW=8 
 +! /USE_TPR=TRUE 
 +! /TPR_EVENT_INSTANCE=1 
 +
 +</code> 
 + 
 +Next **Metric Vector Between Events** is used twice for each side to define vectors for the proximal end of each foot between gait events: 
 + 
 +<code> 
 +Metric_Vector_Between_Events  
 +/START_SIGNAL_TYPE=KINETIC_KINEMATIC  
 +/START_SIGNAL_NAME=ProxEndPos  
 +/START_SIGNAL_FOLDER=LFT  
 +/END_SIGNAL_TYPE=KINETIC_KINEMATIC  
 +/END_SIGNAL_NAME=ProxEndPos  
 +/END_SIGNAL_FOLDER=LFT  
 +/EVENT_SEQUENCE=LHS+LHS  
 +/EXCLUDE_EVENTS=  
 +/METRIC_NAME=StrideVectors  
 +! /GENERATE_MEAN_AND_STDDEV=TRUE  
 +! /APPEND_TO_EXISTING_VALUES=FALSE  
 +! /GENERATE_VECTOR_LENGTH_METRIC=FALSE  
 +
 + 
 +Metric_Vector_Between_Events  
 +/START_SIGNAL_TYPE=KINETIC_KINEMATIC  
 +/START_SIGNAL_NAME=ProxEndPos  
 +/START_SIGNAL_FOLDER=RFT  
 +/END_SIGNAL_TYPE=KINETIC_KINEMATIC  
 +/END_SIGNAL_NAME=ProxEndPos  
 +/END_SIGNAL_FOLDER=RFT  
 +/EVENT_SEQUENCE=RHS+RHS  
 +/EXCLUDE_EVENTS=  
 +/METRIC_NAME=StrideVectors  
 +! /GENERATE_MEAN_AND_STDDEV=TRUE  
 +/APPEND_TO_EXISTING_VALUES=TRUE  
 +! /GENERATE_VECTOR_LENGTH_METRIC=FALSE  
 +
 + 
 +Metric_Vector_Between_Events  
 +/START_SIGNAL_TYPE=KINETIC_KINEMATIC  
 +/START_SIGNAL_NAME=ProxEndPos  
 +/START_SIGNAL_FOLDER=RFT  
 +/END_SIGNAL_TYPE=KINETIC_KINEMATIC  
 +/END_SIGNAL_NAME=ProxEndPos  
 +/END_SIGNAL_FOLDER=LFT  
 +/EVENT_SEQUENCE=RHS+LHS  
 +/EXCLUDE_EVENTS=  
 +/METRIC_NAME=LeftStep  
 +/GENERATE_MEAN_AND_STDDEV=FALSE  
 +! /APPEND_TO_EXISTING_VALUES=FALSE  
 +! /GENERATE_VECTOR_LENGTH_METRIC=FALSE  
 +
 + 
 +Metric_Vector_Between_Events  
 +/START_SIGNAL_TYPE=KINETIC_KINEMATIC  
 +/START_SIGNAL_NAME=ProxEndPos  
 +/START_SIGNAL_FOLDER=LFT  
 +/END_SIGNAL_TYPE=KINETIC_KINEMATIC  
 +/END_SIGNAL_NAME=ProxEndPos  
 +/END_SIGNAL_FOLDER=RFT  
 +/EVENT_SEQUENCE=LHS+RHS  
 +/EXCLUDE_EVENTS=  
 +/METRIC_NAME=RightStep  
 +/GENERATE_MEAN_AND_STDDEV=FALSE  
 +! /APPEND_TO_EXISTING_VALUES=FALSE  
 +! /GENERATE_VECTOR_LENGTH_METRIC=FALSE  
 +
 +</code> 
 + 
 +Now that the vectors for the feet have been defined, **Metric Cross Product** can be used to compute the dot product of those vectors and determine the step width for each stride:
  
 <code> <code>
 +! Calculate LeftStepWidth by taking cross product of LeftStep vector and StrideVectors_MEAN
 +! Generate Mean and STD DEV
 +Metric_Cross_Product 
 +! /METRIC1_FILE= 
 +/METRIC1_NAME=LeftStep 
 +! /METRIC1_FOLDER=PROCESSED 
 +/METRIC2_FILE=GLOBAL 
 +/METRIC2_NAME=StrideVectors_MEAN 
 +! /METRIC2_FOLDER=PROCESSED 
 +! /DIVIDE_BY_METRIC2_LENGTH=TRUE 
 +/RESULT_METRIC_NAME=LeftStepWidth 
 +! /RESULT_METRIC_FOLDER=PROCESSED 
 +! /GENERATE_MEAN_AND_STDDEV=TRUE 
 +! /APPEND_TO_EXISTING_VALUES=FALSE 
 +/GENERATE_VECTOR_LENGTH_METRIC=TRUE 
 +;
 +
 +! Calculate RightStepWidth by taking cross product of RightStep vector and StrideVectors_MEAN
 +! Generate Mean and STD DEV
 Metric_Cross_Product  Metric_Cross_Product 
 ! /METRIC1_FILE=  ! /METRIC1_FILE= 
Line 87: Line 182:
 </code> </code>
  
-In the case that you already know or have calculated step length and know the associated stride vectors, the cross product can be used to compute step width. +The **METRIC:PROCESSED** folder should now contain several new metrics including 3 values (vector, mean, and std dev) for right and left step width. The results should look similar to below:
-===Complex example=== +
- +
-For a more in depth example similar to the one above go to [[visual3d:documentation:pipeline:signal_commands:mimicking_temporal_distance_command|this tutorial]].+
  
 +{{:visual3d:documentation:pipeline:metric_commands:left_step_width.png?600|}}{{:visual3d:documentation:pipeline:metric_commands:left_step_width_mean.png?600|}}
  
 +A more complete example including dot products is available [[visual3d:documentation:pipeline:signal_commands:mimicking_temporal_distance_command|here]]. 
visual3d/documentation/pipeline/metric_commands/metric_cross_product.1759431529.txt.gz · Last modified: 2025/10/02 18:58 by wikisysop