User Tools

Site Tools


visual3d:documentation:pipeline:metric_commands:metric_time_between_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:metric_commands:metric_time_between_events [2024/07/12 14:04] – created sgrangervisual3d:documentation:pipeline:metric_commands:metric_time_between_events [2025/09/24 19:14] (current) – [Example 2 : There is always the same number of occurrences of E1 and E2] wikisysop
Line 1: Line 1:
-====== Metric_Time_Between_Events ======+====== Metric Time Between Events ======
  
-Computes the time between events (or start and end of a sequence of events) as a metric.+====Overview==== 
 + 
 +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 [[Visual3D:Tutorials:Pipeline:Advanced_Pipeline_Commands#Metric_Time_Between_Events|Tutorial:_Advanced_Command_Pipeline#Metric_Time_Between_Events]] **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 [[Visual3D:Tutorials:Pipeline:Advanced_Pipeline_Commands#Metric_Time_Between_Events|Tutorial:_Advanced_Command_Pipeline#Metric_Time_Between_Events]]
  
-==== Metric_Time_Between_Events Command Details ====+The command can be found in the **Pipeline Workshop** under **Metric**. 
 + 
 +====Pipeline Command==== 
 +The command syntax is as follows: 
 +<code> 
 +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 
 +
 +</code> 
 + 
 +====Command Parameters====
  
-Below are the details for this command:+The following table shows the command parameters seen above and their descriptions:
  
 |**Metric_Time_Between_Events**                                                                                                                                                              | |**Metric_Time_Between_Events**                                                                                                                                                              |
Line 17: Line 35:
 |**! /Append to Existing Values=FALSE**                                                               |(True or False)Append this list of metrics to an existing metric of the same result name| |**! /Append to Existing Values=FALSE**                                                               |(True or False)Append this list of metrics to an existing metric of the same result name|
  
-\\+====Dialog==== 
 + 
 +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. 
 + 
 +{{:TimeBetweenEventsDlg.png}} 
 + 
 + 
 +The dialog box allows you to assign values to the command parameters outlined above. 
 + 
 +====Examples==== 
 In this example, consider the metric **Right_Terminal_Double_Limb_Support** which is the time between **LHS** and **RTO**. In this example, consider the metric **Right_Terminal_Double_Limb_Support** which is the time between **LHS** and **RTO**.
  
Line 31: Line 59:
 </code> </code>
  
-Below is the dialog that pops up when pipeline selection is edited by double clicking with the left mouse button. 
  
-{{TimeBetweenEventsDlg.png}} 
  
 **Note: Event_Sequence** - It is important to note that this command assumes that the events are specified in the correct order chronologically. **Note: Event_Sequence** - It is important to note that this command assumes that the events are specified in the correct order chronologically.
Line 85: Line 111:
 </code> </code>
  
 +
 +====Example 3: Defining Events and Finding Time Between====
 +Here we will create two events within a running trial, one for maximum hip flexion and another for maximum hip extension. We can then use **Metric Time Between Events** to determine how long it takes the subject to go from one event to the next for each stride.  
 +
 +First we will create two new events in our pipeline, one for max left hip flexion and one for minimum left hip flexion.
 +
 +<code>
 +Event_Maximum
 +/RESULT_EVENT_NAME=Max_L_Hip_Flexion
 +/SIGNAL_TYPES=LINK_MODEL_BASED
 +/SIGNAL_FOLDER=ORIGINAL
 +/SIGNAL_NAMES=LHipAngle
 +/SIGNAL_COMPONENTS=X
 +! /FRAME_OFFSET=0
 +! /TIME_OFFSET=
 +! /EVENT_SEQUENCE=
 +! /EXCLUDE_EVENTS=
 +! /EVENT_SEQUENCE_INSTANCE=0
 +! /EVENT_SUBSEQUENCE=
 +! /SUBSEQUENCE_EXCLUDE_EVENTS=
 +! /EVENT_SUBSEQUENCE_INSTANCE=0
 +! /EVENT_INSTANCE=0
 +! /FRAME_WINDOW=8
 +! /THRESHOLD=
 +;
 +
 +Event_Minimum
 +/RESULT_EVENT_NAME=Min_L_Hip_Flexion
 +/SIGNAL_TYPES=LINK_MODEL_BASED
 +/SIGNAL_FOLDER=ORIGINAL
 +/SIGNAL_NAMES=LHipAngle
 +/SIGNAL_COMPONENTS=X
 +! /FRAME_OFFSET=0
 +! /TIME_OFFSET=
 +! /EVENT_SEQUENCE=
 +! /EXCLUDE_EVENTS=
 +! /EVENT_SEQUENCE_INSTANCE=0
 +! /EVENT_SUBSEQUENCE=
 +! /SUBSEQUENCE_EXCLUDE_EVENTS=
 +! /EVENT_SUBSEQUENCE_INSTANCE=0
 +! /EVENT_INSTANCE=0
 +! /FRAME_WINDOW=8
 +! /THRESHOLD=
 +;
 +</code>
 +
 +Now that these events have been defined we can calculate the time it takes to go from one event to the next for each instance, as well as the average time across all instances. 
 +
 +<code>
 +Metric_Time_Between_Events
 +/RESULT_METRIC_NAME=L_Hip_Flexion_Time
 +! /RESULT_METRIC_FOLDER=PROCESSED
 +/EVENT_SEQUENCE=Min_L_Hip_Flexion+Max_L_Hip_Flexion
 +/EXCLUDE_EVENTS=
 +! /SCALE_FACTOR=1
 +! /GENERATE_MEAN_AND_STDDEV=TRUE
 +! /APPEND_TO_EXISTING_VALUES=FALSE
 +;
 +</code>
 +
 +Once the pipeline has been executed two new folders should appear containing the calculated time values and the average value across all instances.
 +
 +{{:visual3d:documentation:pipeline:metric_commands:flexion_time.png?400|}}{{:visual3d:documentation:pipeline:metric_commands:flexion_time_mean.png?400|}}
 ==== Visual3D Versions supporting Subject Prefixes ==== ==== Visual3D Versions supporting Subject Prefixes ====
  
visual3d/documentation/pipeline/metric_commands/metric_time_between_events.1720793096.txt.gz · Last modified: 2024/07/12 14:04 by sgranger