User Tools

Site Tools


visual3d:documentation:pipeline:metric_commands:metric_mean

This is an old revision of the document!


Metric Mean

Overview

The Metric Mean command computes the Mean Value of a Signal and stores the value as a metric. It can be found within the Pipeline Workshop under Metric.

Pipeline Command

The syntax for the function is as follows:

Metric_Mean
! /RESULT_METRIC_FOLDER=PROCESSED
/RESULT_METRIC_NAME=
! /APPLY_AS_SUFFIX_TO_SIGNAL_NAME=FALSE
/SIGNAL_TYPES=
! /SIGNAL_FOLDER=ORIGINAL
! /SIGNAL_NAMES=
! /COMPONENT_SEQUENCE=
/EVENT_SEQUENCE=
/EXCLUDE_EVENTS=
! /GENERATE_MEAN_AND_STDDEV=TRUE
! /GENERATE_MEAN_AND_STDDEV_ACROSS_SUBJECTS=FALSE
! /APPEND_TO_EXISTING_VALUES=FALSE
;

Command Parameters

The Parameters for the function is as follows:

Metric_Mean
/RESULT_METRIC_NAME= The name of the metric signal created
!/APPLY_AS_SUFFIX_TO_SIGNAL_NAME=FALSE Add a suffix to the signal name
!/RESULT_METRIC_FOLDER=PROCESSED Name of results folder
/SIGNAL_TYPES=TARGET
/SIGNAL_NAMES= Signal
/SIGNAL_FOLDER=ORIGINAL
/SIGNAL_COMPONENTS=ALL_COMPONENTS Signal Components
/EVENT_SEQUENCE= Specify the sequence of Events. Any number of Events can be entered (separated by +).
This specific sequence of events must be true for a metric to be computed.
The metric is computed from the first event in the sequence to the last event in the sequence
/EXCLUDE_EVENTS= If this event occurs between the first and last event, do not computed a metric
/SEQUENCE_PERCENT_START= Within the event sequence specify the beginning of the range as a percent
/SEQUENCE_PERCENT_END= Within the event sequence specify the end of the range as a percent
! /Generate_Mean_and_Stddev=TRUEGenerate the mean and standard deviation of this metric across ranges and files
! /APPEND_TO_EXISTING_VALUES=FALSE Metrics can replace an existing signal or be appended to it.

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.

metric_mean1.jpg

The dialog box allows you to assign values to the command parameters outlined above.

Example: Include and Exclude Ranges

In the following example, compute the Mean Value of the signal RKNEE_ANGLE from RHS to RHS. The dialog of the command is:

metric_mean1.jpg

The associated pipeline command text is:

Metric_Mean
/RESULT_METRIC_NAME=_MEAN
/APPLY_AS_SUFFIX_TO_SIGNAL_NAME=TRUE
! /RESULT_METRIC_FOLDER=PROCESSED
/SIGNAL_TYPES=LINK_MODEL_BASED
/SIGNAL_NAMES=RKNEE_ANGLE
! /SIGNAL_FOLDER=ORIGINAL
! /SIGNAL_COMPONENTS=ALL_COMPONENTS
/EVENT_SEQUENCE=RHS+RHS
/EXCLUDE_EVENTS=
! /GENERATE_MEAN_AND_STDDEV=TRUE
! /APPEND_TO_EXISTING_VALUES=FALSE
;

Executing the command will result in:

  • Two metric signals in the METRIC::PROCESSED FOLDER in each file,
    • RKNEE_ANGLE_MEAN - the mean value for each RANGE in the file
    • RKNEE_ANGLE_MEAN_MEAN - the mean value for all ranges
  • Two metric signals in the GLOBAL_WORKSPACE
    • RKNEE_ANGLE_MEAN_MEAN - the mean value for all ranges for all files that were active
    • RKNEE_ANGLE_MEAN_STDDEV - the standard deviation of the mean values for all ranges.

An example of results is shown below:

metric_mean2.jpg

If, for example, we did not want to include the first gait cycle in the file file 'OG_RA_run01.c3d' in this list we can add an Event_Label called BAD to the file between RHS and RHS.

metric_mean3.jpg

In the image above, the two blue lines indicate the RHS event. Add an Event Label named BAD manually by double clicking on the signal line.

The metric_mean command can be modified as follows:

metric_mean4.jpg

which indicates that a range of data containing the label BAD should not be included. The result of executing the pipeline command is now:

metric_mean5.jpg

NOTE: When you run a metric command, and tell it to create a global mean, it uses all the individual ranges to compute the overall mean (ie. one trial has 4 ranges, second trial has 1 range, the global mean is generated from the 5 values).

Each trial will have a mean and then a mean of those means. If you select ALL_FILES as the active file and view the metric, you will see the means of the individual trial ranges and the mean of the means within that trial. The GLOBAL will show the overall mean (mean of all the means).

Example: Metric Mean of Metric signals at Initial Contact

This script will take the mean of Left at Right Knee angles at Initial contact (LON and RON)

! Get the initial contact value of LKNEE_ANGLE at LON
Metric_Signal_Value_At_Event
/RESULT_METRIC_NAME=Knee_Angle_IC
! /RESULT_METRIC_FOLDER=PROCESSED
/SIGNAL_TYPES=LINK_MODEL_BASED
/SIGNAL_NAMES=LKNEE_ANGLE
! /SIGNAL_FOLDER=ORIGINAL
/EVENT_NAME=LON
/GENERATE_MEAN_AND_STDDEV=FALSE
! /APPEND_TO_EXISTING_VALUES=FALSE
! /GENERATE_VECTOR_LENGTH_METRIC=FALSE
! /RETAIN_NO_DATA_VALUES=FALSE
;

! Get the initial contact value of RKNEE_ANGLE at RON and concatenate this with the previous metric
Metric_Signal_Value_At_Event
/RESULT_METRIC_NAME=Knee_Angle_IC
! /RESULT_METRIC_FOLDER=PROCESSED
/SIGNAL_TYPES=LINK_MODEL_BASED
/SIGNAL_NAMES=RKNEE_ANGLE
! /SIGNAL_FOLDER=ORIGINAL
/EVENT_NAME=RON
/GENERATE_MEAN_AND_STDDEV=FALSE
/APPEND_TO_EXISTING_VALUES=TRUE
! /GENERATE_VECTOR_LENGTH_METRIC=FALSE
! /RETAIN_NO_DATA_VALUES=FALSE
;

! Compute the mean and standard deviation of these values.
Metric_Mean
/RESULT_METRIC_NAME=_MEAN
/APPLY_AS_SUFFIX_TO_SIGNAL_NAME=TRUE
! /RESULT_METRIC_FOLDER=PROCESSED
/SIGNAL_TYPES=METRIC
/SIGNAL_NAMES=Knee_Angle_IC
/SIGNAL_FOLDER=PROCESSED
! /SIGNAL_COMPONENTS=ALL_COMPONENTS
/EVENT_SEQUENCE=
/EXCLUDE_EVENTS=
! /GENERATE_MEAN_AND_STDDEV=TRUE
! /APPEND_TO_EXISTING_VALUES=FALSE
;
visual3d/documentation/pipeline/metric_commands/metric_mean.1758220141.txt.gz · Last modified: 2025/09/18 18:29 by wikisysop