The Time Between Events command computes the time between events (or start and end of a sequence of events) as a metric. For example, the command could be used to find the time a foot is in contact with the ground between Lon and Loff.
Note: In cases where the maximum event is located at the start event (time between=0), the command metric_time_between_events will not allow zero time. This is because there could be multiple instances for that event and Visual 3D would not know which instance of that event to use for the calculation. A workaround can be found here Tutorial:_Advanced_Command_Pipeline#Metric_Time_Between_Events
The command can be found in the Pipeline Workshop under Metric.
The command syntax is as follows:
Metric_Time_Between_Events /RESULT_METRIC_NAME= ! /RESULT_METRIC_FOLDER=PROCESSED /EVENT_SEQUENCE= /EXCLUDE_EVENTS= ! /SCALE_FACTOR=1 ! /GENERATE_MEAN_AND_STDDEV=TRUE ! /APPEND_TO_EXISTING_VALUES=FALSE ;
The following table shows the command parameters seen above and their descriptions:
Metric_Time_Between_Events | |
/RESULT_METRIC_NAME== | The name of the metric signal |
! /RESULT_METRIC_FOLDER=PROCESSED | The metric signal folder for the result. |
/Event_Sequence= | A list of events (separated by “+” signs). |
/Exclude_Events= | This Event_Sequence must not be during the sequence requested. |
! /Generate_Mean_And_StdDev=TRUE | (True or False)Generate the mean and standard deviation for all of the metrics created |
! /Append to Existing Values=FALSE | (True or False)Append this list of metrics to an existing metric of the same result name |
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.
In this example, consider the metric Right_Terminal_Double_Limb_Support which is the time between LHS and RTO.
Metric_Time_Between_Events /RESULT_METRIC_NAME=Right_Terminal_Double_Limb_Support ! /RESULT_METRIC_FOLDER=PROCESSED /EVENT_SEQUENCE=LHS+RTO /EXCLUDE_EVENTS=LTO+RHS ! /GENERATE_MEAN_AND_STDDEV=TRUE ! /APPEND_TO_EXISTING_VALUES=FALSE ;
Note: Event_Sequence - It is important to note that this command assumes that the events are specified in the correct order chronologically.
For example, if the event sequence is
E1+E2 E1 must occur before E2 or no metric signal will be created.
If it is not always possible to ensure the chronological order, a series of Pipeline Commands may be necessary.
Execute the Metric_Time_Between_Events twice in succession, once with the range E1+E2, then the second one with the range E2+E1 and set the option /APPEND_TO_EXISTING_VALUE=TRUE on the second call.
Metric_Time_Between_Events /RESULT_METRIC_NAME=DIFF ! /RESULT_METRIC_FOLDER=PROCESSED /EVENT_SEQUENCE=E1+E2 /EXCLUDE_EVENTS= /GENERATE_MEAN_AND_STDDEV=FALSE ! /APPEND_TO_EXISTING_VALUES=FALSE ; Metric_Time_Between_Events /RESULT_METRIC_NAME=DIFF ! /RESULT_METRIC_FOLDER=PROCESSED /EVENT_SEQUENCE=E2+E1 /EXCLUDE_EVENTS= /GENERATE_MEAN_AND_STDDEV=FALSE /APPEND_TO_EXISTING_VALUES=TRUE ;
Note: If there are multiple events, and they can occur in any sequence, then there would be no way of telling which sequence you really wanted. If this is the case, you would need to add an event in the middle of the sequence to be explicit about which sequences that you really want, such as
E1+MID+E2, and E2+MID+E1
An alternative to the Metric Time Between Events would be to use the command Evaluate_Expression. In this case you can use Evaluate_Expression to compute the time differences between E2 and E1.
Evaluate_Expression /EXPRESSION=EVENT_LABEL::ORIGINAL::E2-EVENT_LABEL::ORIGINAL::E1 /RESULT_NAME=DIFF /RESULT_TYPE=METRIC ! /RESULT_FOLDER=PROCESSED ;
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.