====== Create Mean Signal ======
||
This example will time normalize a signal (in this case Knee Flexion Angle) between events (**RHS** to **RHS**) for Right Knee angles and (**LHS** to **LHS**) for Left Knee angles, and compute a **GLOBAL** mean and Standard Deviation. A meta-command will be used.
\\
Add the **Global_Normalized_Signal_Mean** command to the pipeline. Double click on the command to launch the dialog.
{{:GNSM1.jpg}}
Select the **RKNEE_ANGLE** Signal and the event sequence (e.g **RHS** to **RHS**) and select Add A New Signal
{{:GNSM2.jpg}}
Select the **LKNEE_ANGLE** Signal and the event sequence (e.g **LHS** to **LHS**) and select Add A New Signal
{{:GNSM3.jpg}}
Enter in the **P2D Result Signal Name** and the select **Create Standard Deviation Button**
{{:GNSM4.jpg}}
When you select **OK** the text representation of the command should be as follows:
Global_Normalized_Signal_Mean
/SIGNAL_TYPES=LINK_MODEL_BASED+LINK_MODEL_BASED
/SIGNAL_NAMES=RKNEE_ANGLE+LKNEE_ANGLE
/SIGNAL_FOLDER=ORIGINAL+ORIGINAL
/SIGNAL_COMPONENTS=X+X
/START_LABEL=
/END_LABEL=
/EVENT_SEQUENCE= RHS+RHS++LHS+LHS
! /EXCLUDE_EVENTS=
/RESULT_NAME=KNEE_FLEXION
! /RESULT_FOLDER=ORIGINAL
/NORMALIZE_POINTS=101
/CREATE_STANDARD_DEVIATION=TRUE
! /CALCULATE_PER_FILE=FALSE
;
**Note:** If **CALCULATE_PER_FILE=FALSE**. Signals from all active files are used to compute the mean
**Note:** If **CALCULATE_PER_FILE=TRUE**. The mean value is computed for Signals from each active files. The global mean value is then the mean value of the mean values.
**Note:** That the Output signal is a P2D Signal, which is associated with every file. The resulting signal, therefore, is stored in the **GLOBAL_WORKPACE**
\\
The Meta-Command **Create_Global_Means_For_Left_Right** will be used for processing all 3 components of a number of model based signals using one pipeline command. Let the original cmo file contain the following signals:
RANKLE_ANGLE
RKNEE_ANGLE
RHIP_ANGLE
LANKLE_ANGLE
LKNEE_ANGLE
LHIP_ANGLE
Let the events for heel strike be labeled **LHS** and **RHS** and that mean signal should be computed from heel strike to heel strike.
\\
The Pipeline script for the **Create_Global_Means_For_Left_Right** meta-command is below:
Create_Global_Means_For_Left_Right
/TYPE=ANGLE
/JOINTS=ANKLE+KNEE+HIP
/START_EVENT=HS
/END_EVENT=HS
;
The following should be cut and pasted into the **Create_Global_Means_For_Left_Right.v3m** Meta_Command folder which should be placed within the Plugins folder.
! BEGIN_META
! META_CMD_NAME=Create_Global_Means_For_Left_Right
! META_PARAM= TYPE : string ::yes
! META_PARAM= JOINTS : string ::yes
! META_PARAM= START_EVENT : string ::yes
! META_PARAM= END_EVENT : string ::yes
! END_META
! Create a Global_Normalized_Signal_Mean event for left and right
! sides with common labels (e.g. RHS and LHS)
For_Each
/ITERATION_PARAMETER_NAME=INDEX1
/ITEMS=::JOINTS
;
For_Each
/ITERATION_PARAMETER_NAME=INDEX2
/ITEMS=X+Y+Z
;
Global_Normalized_Signal_Mean
/SIGNAL_TYPES=LINK_MODEL_BASED+LINK_MODEL_BASED
/SIGNAL_NAMES=R&::INDEX1&_&::TYPE+L&::INDEX1&_&::TYPE
/SIGNAL_FOLDER=ORIGINAL+ORIGINAL
/SIGNAL_COMPONENTS=::INDEX2+::INDEX2
/START_LABEL=R&::START_EVENT+L&::END_EVENT
/END_LABEL=R&::START_EVENT+L&::END_EVENT
! /EVENT_SEQUENCE=
! /EXCLUDE_EVENTS=
/RESULT_NAME=::INDEX1&_&::TYPE&_&::INDEX2
! /RESULT_FOLDER=ORIGINAL
! /NORMALIZE_POINTS=101
! /CREATE_STANDARD_DEVIATION=FALSE
! /CALCULATE_PER_FILE=FALSE
;
End_For_Each
/ITERATION_PARAMETER_NAME=INDEX2
;
End_For_Each
/ITERATION_PARAMETER_NAME=INDEX1
;