The Metric_Signal_Value_At_Event command provides the value of the specified signal at the specified frame of data is stored as a metric. It can be found in the Pipeline Workshop under Metric. This command is useful for recording the value of a signal at a specific moment in a sequence, like at the deepest point in a squat or foot on in a stride.
Notes:
The syntax for the function is as follows:
Metric_Signal_Value_At_Event /SIGNAL_TYPES= ! /SIGNAL_FOLDER=ORIGINAL ! /SIGNAL_NAMES= ! /RESULT_METRIC_FOLDER=PROCESSED /RESULT_METRIC_NAME= ! /APPLY_AS_SUFFIX_TO_SIGNAL_NAME=FALSE ! /SIGNAL_COMPONENTS= ! /COMPONENT_SEQUENCE= /EVENT_NAME= ! /EVENT_INSTANCE=0 ! /SCALE_FACTORS=1 ! /GENERATE_GLOBAL_MEAN_AND_STDDEV=TRUE ! /GENERATE_LOCAL_MEAN_AND_STDDEV=TRUE ! /APPEND_TO_EXISTING_VALUES=FALSE ! /GENERATE_VECTOR_LENGTH_METRIC=FALSE ! /RETAIN_NO_DATA_VALUES=FALSE ;
The pipeline command parameters shown above are described in the table below:
/Result_Metric_Name= | The name of the resulting signal. |
/Result_Metric_Folder= | The folder that will contain the resulting signal |
/Signal_Types= | The type of signal to be evaluated |
/Signal_Names= | The names of the signals to be evaluated |
/Signal_Folder= | The name of the signal folder |
/Event_Name= | The name of the event Label. |
/Generate_Mean_And_Stddev= | If there are multiple occurences of the Event, the metric will contain multiple values.If Selecte the mean and standard deviation for the metric values will be computed. |
/Append_To_Existing_Values= | (True or False) If the metric exists, the new values will be appended to the metric, retaining all of the previous values. |
/Generate_Metric_Length_Metric= | (True or False) If the metric is a vector quantity (e.g. has 3 components), compute the magnitude of the vector. |
/Retain_No_Data_Values= | (True or False) If the result is no_data, retain the value. |
The command can be edited in a text editor or in a dialog form. To edit in the dialog pop up form either click on the Edit button in the pipeline workshop or double-click on the pipeline command. The dialog is shown below.
The dialog box allows you to assign values to the command parameters outlined above.
This example calculates the value of the TARGET RFT1 at the Event_Label RON
Metric_Signal_Value_At_Event /Result_Metric_Name=RFT1_ON /Result_Metric_Folder=PROCESSED /Signal_Types=TARGET /Signal_Names=RFT1 /Signal_Folder=ORIGINAL /Event_Name=RON /Generate_Mean_And_Stddev=FALSE /Append_To_Existing_Values=FALSE /Generate_Metric_Length_Metric=FALSE /Retain_No_Data_Values=TRUE ;
Since Metric_Signal_Value_At_Event outputs all three components, here is a workaround of the previous example that will output one component. Evaluate_Expression is used to create a signal with one component, the z component for RFT1. Then the Metric_Signal_Value_At_Event will calculate the value of the TARGET RFT1 at the Event_Label RON.
! RFT1 Z component Evaluate_Expression /Expression=TARGET::ORIGINAL::RFT1::Z /Result_Name=RFT1_Z /Result_Type=DERIVED /Result_Folder=ORIGINAL ; Metric_Signal_Value_At_Event /Result_Metric_Name=RFT1_ON /Result_Metric_Folder=PROCESSED /Signal_Types=DERIVED /Signal_Names=RFT1_Z /Signal_Folder=ORIGINAL /Event_Name=RON /Generate_Mean_And_Stddev=FALSE /Append_To_Existing_Values=FALSE /Generate_Metric_Length_Metric=FALSE /Retain_No_Data_Values=TRUE ;
This example calculates the time of the Event_Label RON
Metric_Signal_Value_At_Event /Result_Metric_Name=RON_TIME /Result_Metric_Folder=PROCESSED /Signal_Types=FRAME_NUMBERS /Signal_Names=TIME /Signal_Folder=ORIGINAL /Event_Name=RON /Generate_Mean_And_Stddev=FALSE /Append_To_Existing_Values=FALSE /Generate_Metric_Length_Metric=FALSE /Retain_No_Data_Values=FALSE ;
Consider a P2D signal created using Global_Normalized_Signal_Mean. The resulting signal has three components, an index, a mean signals, and a standard deviation signal. It is possible to compute the maximum value of the 3 components using Metric_Maximum but it isn't possible to directly identify the standard deviation at that index because it isn't possible to define an Event for a time normalized signal (e.g.it has no frame rate or time.
Without having an event you cannot get the value of a signal at that event using Metric_Signal_Value_At_Event. One solution, albeit a non-intuitive solution is to SORT (descending) the P2D signal by the second component (eg. the MEAN).
Evaluate_Expression /EXPRESSION=SORT(P2D::TEST::LHIP_ANGLE, -1.0, 2) ! /SIGNAL_TYPES= ! /SIGNAL_FOLDER=ORIGINAL ! /SIGNAL_NAMES= /RESULT_TYPES=P2D /RESULT_FOLDERS=TEST_SORTED /RESULT_NAME=LHIP_ANGLE_SORTED !/APPLY_AS_SUFFIX_TO_SIGNAL_NAME=FALSE ;
For the resulting signal, the maximum value and the associated standard deviation will be in the first frame.