visual3d:documentation:pipeline:metric_commands:metric_time_between_events
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
visual3d:documentation:pipeline:metric_commands:metric_time_between_events [2024/06/19 12:51] – sgranger | visual3d: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: | ||
- | {{computes the time between events (or start and end of a sequence of events) as a metric. | + | ====== 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: | + | ====Overview==== |
- | ===== metric_time_between_events | + | The **Time Between Events** |
- | below are the details for this command: | + | **Note:** In cases where the maximum event is located at the start event (time between=0), |
- | |**metric_time_between_events** | + | The command can be found in the **Pipeline Workshop** under **Metric**. |
- | |**/ | + | |
- | |**! / | + | |
- | |**/ | + | |
- | |**/ | + | |
- | |**! / | + | |
- | |**! /append to existing values=false** | + | |
- | \\ | + | ====Pipeline Command==== |
- | in this example, consider the metric **right_terminal_double_limb_support** which is the time between **lhs** and **rto**. | + | The command syntax is as follows: |
+ | < | ||
+ | Metric_Time_Between_Events | ||
+ | / | ||
+ | ! / | ||
+ | / | ||
+ | / | ||
+ | ! / | ||
+ | ! / | ||
+ | ! / | ||
+ | ; | ||
+ | </ | ||
+ | |||
+ | ====Command Parameters==== | ||
+ | |||
+ | The following table shows the command parameters seen above and their descriptions: | ||
+ | |||
+ | |**Metric_Time_Between_Events** | ||
+ | |**/ | ||
+ | |**! / | ||
+ | |**/ | ||
+ | |**/ | ||
+ | |**! / | ||
+ | |**! /Append to Existing Values=FALSE** | ||
+ | |||
+ | ====Dialog==== | ||
+ | |||
+ | The command can be edited | ||
+ | |||
+ | {{: | ||
+ | |||
+ | |||
+ | 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**. | ||
< | < | ||
- | metric_time_between_events | + | Metric_Time_Between_Events |
- | /result_metric_name=right_terminal_double_limb_support | + | /RESULT_METRIC_NAME=Right_Terminal_Double_Limb_Support |
- | ! /result_metric_folder=processed | + | ! /RESULT_METRIC_FOLDER=PROCESSED |
- | /event_sequence=lhs+rto | + | /EVENT_SEQUENCE=LHS+RTO |
- | /exclude_events=lto+rhs | + | /EXCLUDE_EVENTS=LTO+RHS |
- | ! /generate_mean_and_stddev=true | + | ! /GENERATE_MEAN_AND_STDDEV=TRUE |
- | ! /append_to_existing_values=false | + | ! /APPEND_TO_EXISTING_VALUES=FALSE |
; | ; | ||
</ | </ | ||
- | 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. |
- | for example, if the event sequence is | + | For example, if the event sequence is |
- | e1+e2 | + | E1+E2 |
- | e1 must occur before | + | E1 must occur before |
- | if it is not always possible to ensure the chronological order, a series of pipeline commands | + | If it is not always possible to ensure the chronological order, a series of Pipeline Commands |
- | ===== example | + | ==== Example |
- | execute | + | Execute |
< | < | ||
- | metric_time_between_events | + | Metric_Time_Between_Events |
- | /result_metric_name=diff | + | /RESULT_METRIC_NAME=DIFF |
- | ! /result_metric_folder=processed | + | ! /RESULT_METRIC_FOLDER=PROCESSED |
- | /event_sequence=e1+e2 | + | /EVENT_SEQUENCE=E1+E2 |
- | /exclude_events= | + | /EXCLUDE_EVENTS= |
- | /generate_mean_and_stddev=false | + | /GENERATE_MEAN_AND_STDDEV=FALSE |
- | ! /append_to_existing_values=false | + | ! /APPEND_TO_EXISTING_VALUES=FALSE |
; | ; | ||
- | metric_time_between_events | + | Metric_Time_Between_Events |
- | /result_metric_name=diff | + | /RESULT_METRIC_NAME=DIFF |
- | ! /result_metric_folder=processed | + | ! /RESULT_METRIC_FOLDER=PROCESSED |
- | /event_sequence=e2+e1 | + | /EVENT_SEQUENCE=E2+E1 |
- | /exclude_events= | + | /EXCLUDE_EVENTS= |
- | /generate_mean_and_stddev=false | + | /GENERATE_MEAN_AND_STDDEV=FALSE |
- | /append_to_existing_values=true | + | /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. | + | **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. |
- | e1+mid+e2, and | + | E1+MID+E2, and |
- | e2+mid+e1 | + | E2+MID+E1 |
- | ===== example | + | ==== Example |
- | 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 | + | 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 |
< | < | ||
- | evaluate_expression | + | Evaluate_Expression |
- | /expression=event_label::original::e2-event_label::original::e1 | + | /EXPRESSION=EVENT_LABEL::ORIGINAL::E2-EVENT_LABEL::ORIGINAL::E1 |
- | /result_name=diff | + | /RESULT_NAME=DIFF |
- | /result_type=metric | + | /RESULT_TYPE=METRIC |
- | ! /result_folder=processed | + | ! /RESULT_FOLDER=PROCESSED |
; | ; | ||
</ | </ | ||
- | ===== visual3d versions supporting subject prefixes ===== | ||
- | note: when using events in a command, the commands will iterate across subjects contained in the current workspace. | + | ====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. | ||
+ | |||
+ | < | ||
+ | Event_Maximum | ||
+ | / | ||
+ | / | ||
+ | / | ||
+ | / | ||
+ | / | ||
+ | ! / | ||
+ | ! / | ||
+ | ! / | ||
+ | ! / | ||
+ | ! / | ||
+ | ! / | ||
+ | ! / | ||
+ | ! / | ||
+ | ! / | ||
+ | ! / | ||
+ | ! / | ||
+ | ; | ||
+ | |||
+ | Event_Minimum | ||
+ | / | ||
+ | / | ||
+ | / | ||
+ | / | ||
+ | / | ||
+ | ! / | ||
+ | ! / | ||
+ | ! / | ||
+ | ! / | ||
+ | ! / | ||
+ | ! / | ||
+ | ! / | ||
+ | ! / | ||
+ | ! / | ||
+ | ! / | ||
+ | ! / | ||
+ | ; | ||
+ | </ | ||
+ | |||
+ | 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. | ||
+ | |||
+ | < | ||
+ | Metric_Time_Between_Events | ||
+ | / | ||
+ | ! / | ||
+ | / | ||
+ | / | ||
+ | ! / | ||
+ | ! / | ||
+ | ! / | ||
+ | ; | ||
+ | </ | ||
+ | |||
+ | Once the pipeline has been executed two new folders should appear containing the calculated time values and the average value across all instances. | ||
+ | |||
+ | {{: | ||
+ | ==== Visual3D Versions supporting Subject Prefixes ==== | ||
+ | |||
+ | NOTE: When using events in a command, the commands will iterate across subjects contained in the current workspace. | ||
- | }} |
visual3d/documentation/pipeline/metric_commands/metric_time_between_events.1718801489.txt.gz · Last modified: 2024/06/19 12:51 by sgranger