Tutorial: Gait Profile Score and Movement Analysis Profile Pipeline: Difference between revisions

From Software Product Documentation
Jump to navigation Jump to search
m (Text replacement - "www.c-motion.com/download" to "www.has-motion.com/download")
 
(27 intermediate revisions by one other user not shown)
Line 1: Line 1:
{{Languages}}
{{Languages}}
This page is currently being updated.


{| align="right"
{| align="right"
Line 23: Line 22:


*[https://view.officeapps.live.com/op/view.aspx?src=https%3A%2F%2Fwalkingwithrichard.files.wordpress.com%2F2017%2F03%2Fgdi-gps-calculator-v-3-2.xlsx&wdOrigin=BROWSELINK GPS Excel Sheet Calculator]
*[https://view.officeapps.live.com/op/view.aspx?src=https%3A%2F%2Fwalkingwithrichard.files.wordpress.com%2F2017%2F03%2Fgdi-gps-calculator-v-3-2.xlsx&wdOrigin=BROWSELINK GPS Excel Sheet Calculator]
*[https://www.c-motion.com/download/examples/GaitProfileScore/GPS_Equations.pdf GPS Equations and Descriptions PDF]
*[https://www.has-motion.com/download/examples/GaitProfileScore/GPS_Equations.pdf GPS Equations and Descriptions PDF]


'''Downloads'''
'''Downloads'''
* GPS_Tutorial.zip
* [https://www.has-motion.com/download/examples/GaitProfileScore/GPS_Tutorial_Files.zip GPS_Tutorial_Files.zip]


==GPS Description and Conventions==
==GPS Description and Conventions==
Line 53: Line 52:
==Equations==
==Equations==


Although the Gait Profile Score was explained in the 2009 paper, the equations were not explicitly written. The 2012 paper contains explicit written equations but due to some formatting errors they are incorrect. The [https://www.c-motion.com/download/examples/GaitProfileScore/GPS_Equations.pdf GPS Equations and Descriptions PDF] has the correct version of these equations, which are also described below:
Although calculating the Gait Profile Score was explained in Baker et al's 2009 paper, the equations were not explicitly written. Their 2012 paper contains explicit written equations but due to some formatting errors these are incorrect. The [https://www.has-motion.com/download/examples/GaitProfileScore/GPS_Equations.pdf GPS Equations and Descriptions PDF] has the correct version of these equations, which are also described below:


The '''Global Variable Scores (GVS)''' is the root mean square difference between a specific time normalized gait variable (x) and the mean data from the reference population calculated across the gait cycle (x ref).  
The '''Global Variable Scores (GVS)''' is the root mean square difference between a specific time normalized gait variable (x) and the mean data from the reference population calculated across the gait cycle (x ref).  
Line 99: Line 98:
# Left/Right Foot Segments
# Left/Right Foot Segments


If you are unfamiliar with building models in Visual3D, the [https://www.c-motion.com/v3dwiki/index.php?title=YouTube_Tutorial:_Model_Building Model Building Tutorial] is a good place to start. The zip files for this tutorial contain a workspace with a pre-built and pre-applied model.
If you are unfamiliar with building models in Visual3D, the [https://www.c-motion.com/v3dwiki/index.php?title=YouTube_Tutorial:_Model_Building Model Building Tutorial] is a good place to start if you want to alter the tutorial pipeline. The zip files for this tutorial contain a workspace with a pre-built and pre-applied model.


Once a model has been created, the joint angles for each of the nine kinematic variables need to be calculated. Below is an example of calculating the Left Ankle Angle:
Once a model has been created, the joint angles for each of the nine kinematic variables need to be calculated. Below is an example of calculating the Left Ankle Angle:
Line 130: Line 129:
==Step 2: Create a Normalized Database==
==Step 2: Create a Normalized Database==


==Step 3: Calculating GPS Values using Visual3D Pipeline==
To calculate GPS values a reference database needs to be created. The database should contain gait data with the same nine kinematic variables described above, which should be normalized to 51 points per gait cycle (in this tutorial, the gait cycles are defined as LHS to LHS).
'''Example 1'''


'''Example 2'''
The '''GPS_Tutorial_Files.zip''' contains a pre-made normalized database. The database uses the data from Subjects 2, 3 and 4. If you would like to create your own, the steps to do so can be found under the [https://www.c-motion.com/v3dwiki/index.php?title=Normative_Data_From_CMO_Library Normative Data from CMZ Library] page. In Visual3D, databases are saved as .vnd file types.


==Step 3: Calculating GPS Values using Visual3D Pipeline==


----
This tutorial uses Subject 1 as the test subject and Subjects 2, 3 and 4 as reference subjects. Each subject has four exercises worth of data. The pipeline is approximately 1000 lines long, so it will be described rather than included in it's entirety on this page.
'''Old Tutorial'''


Summary
The '''GPS_Tutorial.zip''' contains two versions of this pipeline, one labeled "GPS_15features" which does not include the pelvis on the right side (as per Baker et als convention). This is the recommended pipeline to use. However, if you want to see the difference that including the pelvis on the right, there is also a pipeline labeled "GPS_18features".


To calculate the GPS, a control database must be created (.vnd file) and a subject's CMO file must be created.
# '''Calculating Joint Angles: ''' For each of the kinematic variables (ankle angle, knee angle, hip angle, pelvis angle, foot progression) the Compute_Model_Based_Data command can be used to produce joint angle values. This is repeated once for the right side and once for the left side. The values are stored under the LINK_MODEL_BASED :: ORIGINAL folder.
# '''Create Global Signals for Joint Angles: ''' The Global_Normalized_Mean function can be used to store specific components of a signal as a normalized global variable. In this case, the signals are normalized from LHS to LHS to 51 points, and we are interested in the following components of each kinematic variable, which are stored under the GLOBAL workspace in the P2D :: PROCESSED folder.
#* '''Ankle Dorsiflexion: '''L_Ankle_Angle_X
#* '''Knee Flexion: '''L_Knee_Angle_X
#* '''Hip Flexion: '''L_Hip_Angle_X
#* '''Hip Abduction: '''L_Hip_Angle_Y
#* '''Hip Rotation: '''L_Hip_Angle_Z
#* '''Pelvic Tilt: '''L_Pelvic_Angle_X
#* '''Pelvic Rotation: '''L_Pelvic_Angle_Y
#* '''Pelvic Obliquity: '''L_Pelvic_Angle_Z
#* '''Foot Progression:''' L_Foot_Progression_Z


This tutorial describes step by step how to create a .vnd file and then create the GPS for a subject.
An example on how to normalize the left ankle to 51 points.
 
Global_Normalized_Signal_Mean
Starting out
/SIGNAL_TYPES=LINK_MODEL_BASED
 
/SIGNAL_FOLDER=ORIGINAL
This tutorial uses the 15 kinematic variables used in Richard Baker's first paper; pelvic tilt, pelvic obliquity and pelvic rotation and hip flexion, hip abduction, hip internal rotation, knee flexion, ankle dorsiflexion and foot progression. <ref name=B1></ref>
/SIGNAL_NAMES=L_Ankle_Angle
 
/SIGNAL_COMPONENTS=X
Since the pelvis is common to the left and right sides, only the left side is used to calculate the pelvic angles (so the pelvis is only analyzed from left foot strike to left foot strike (LHS+LHS). <ref name=B1></ref>
/COMPONENT_SEQUENCE=
 
! /START_LABEL=
The tutorial also calculates the GVS at every 2% of the gait cycle, so the signal is normalized to 51 points <ref name=B3></ref>.
! /END_LABEL=
 
/EVENT_SEQUENCE=LHS+LHS
Step 1. Create Model
! /EXCLUDE_EVENTS=
 
/RESULT_FOLDER=PROCESSED
To calculate the GPS using the specified kinematic variables <ref name=B1></ref>, you must have a model with at least 7 segments in your model:
/RESULT_NAME=L_Ankle_Angle_X
#A Pelvis
/NORMALIZE_POINTS=51
#Left/Right Thigh Segments
/CREATE_STANDARD_DEVIATION=TRUE
#Left/Right Shank Segments
! /CALCULATE_PER_FILE=FALSE
#Left/Right Foot Segments
;
 
In addition to these segments, I also created Left/Right Virtual Feet segments and a virtual lab segment:
 
:1. In order to calculate more meaningful ankle joint angles, I created a virtual foot using this [[Tutorial:_Foot_and_Ankle_Angles#Virtual_Foot_Method_3_-_Projected_landmarks|method]]. The virtual feet are called Right/Left Virtual Foot (R/LMF).
 
:2. Since my subject is walking in the +/- direction of the lab, I also created a [[Tutorial:_Virtual_Laboratory#Example:_Creating_a_virtual_laboratory_that_changes_with_the_direction_of_walking|dynamic virtual lab]] which changes direction based on the subject's direction of progression. The virtual lab is called Virtual Lab Pelvis. I then calculated the pelvis angle and foot progression angles relative to the virtual lab segment.
 
Step 2. Define Joint Angles
 
To calculate the kinematic variables <ref name=B1></ref>, nine signals must be created. The signal name is user defined, but this tutorial uses the following names:
<br>
{| style= width="100%" align="left"
| style="width: 10%" align="left" style="vertical-align:top"|
:LFootProgression
:LAnkleAngle
:LKneeAngle
:LHipAngle
:LPelvisAngle
| style= "width: 10%" align="left" style="vertical-align:top"|
:RFootProgression
:RAnkleAngle
:RKneeAngle
:RHipAngle
|}
<br>
Since the [[Pipeline_Commands:RECALC_Pipeline|Recalc pipeline]] is stored in the Report template (.rgt), a report template which stores these signal definitions was created. This report template can be downloaded [http://www.c-motion.com/download/examples/GaitProfileScore/ReportTemplate.rgt here].
<br>
<b>NOTE:</b> It is recommend that the left and right sides have the same convention for +/-.
<br>
<br>
<br>
<br>
 
Create Normal Database
 
The GPS requires some reference data to compare against. For this tutorial, the subject's data is compared against a control database. Instructions to create a normal database can be found in the [[Normative Data From CMO Library|GPS Normal Database Tutorial]]. This tutorial describes how to easily create the normal data script and how to save the control data as a .vnd file.
 
The script used to create the normal data can be found [http://www.c-motion.com/download/examples/GaitProfileScore/NormalizeControlData.v3s here].
 
To complete this tutorial, sample control data can be downloaded from [http://www.c-motion.com/download/examples/GaitProfileScore/ControlData.vnd here]. Please note this "control database" was created from subject - so you should NOT use this as actual data.
 
Calculate GPS for a subject
 
1. Prepare Subject CMO
 
Make sure the subject's CMO has the same model template used for the control subjects and the same signals are defined.
 
Gait events must also be created in the CMZ file.
 
2. Create Subject Normalized Signals
 
First calculate the appropriate kinematic variables in the LINK_MODEL_BASED folder.
 
The normalized signals should be the <b>same</b> for the control and test subject. By the <b>same</b>, we mean the signals should be normalized to the same number of points (ex. 51 <ref name=B3></ref>) between the same events (ex. LHS+LHS).
 
 
:<b>A.</b> Set the active file to ALL_FILES
 
:<b>B.</b> Run the [http://www.c-motion.com/download/examples/GaitProfileScore/NormalizeSubjectData.v3s NormalizeSubjectData.v3s] script
 
<b>NOTE:</b> The same script was used to normalize the subject's data as for the control database. The only change was that the result folder was changed from GPS_CONTROL to GPS_SUBJECT in Notepad++ and then the new script was saved.
 
3. Calculate GPS Signals
 
:<b>A.</b> Run the [http://www.c-motion.com/download/examples/GaitProfileScore/CalculateGPS_2015_06_02.v3s CalculateGPS_2015_06_02.v3s] (show below)
 
:<b>B.</b> When prompted select the control database, an example database can be downloaded [http://www.c-motion.com/download/examples/GaitProfileScore/ControlData.vnd here]
 
<b> Script Requirements:</b>
 
This script requires the subject data to be stored in the P2D::GPS_SUBJECT folder and the control data to be stored in the P2D::GPS_CONTROL folders. The names for the associated signals should be the same, for example the left dorsiflexion angle should be the LAnkleAngle_X_LHS_LHS in both the subject and control folders.
 
The script will use ALL signals in the GPS_SUBJECT folder for the calculations. The 2009 paper <ref name=B1></ref> used 15 kinematic variables, if you would like to do the same, only 15 signals should exist in your GPS_SUBJECT folder.
 
As long as your normalized signals are stored in the GPS_SUBJECT and GPS_CONTROL folders, and the signal names are consistent between both folders, you can use this script with signals that use a different naming convention or as many kinematic variables as you would like.


<b> Script: </b>
'''Note: Step 3 and 4 are done in the Global Workspace'''


!=====================================================
:3. '''Open Reference Database: ''' For the last two steps the normal database has to be loaded into the Visual3D workspace. This can be done using the File_Open command as seen below, however the file path will need to be changed on where you downloaded the normal database:
! Gait Profile Score and Movement Analysis Profile Pipeline
  !------Open Normal Database------
! Date: 2015
  ! Note: file path may differ
! Need: A complete .cmo file with walking trials
  !       Normal data in .p2d format
  ! Purpose: Replicate the GPS and MAS as described in Baker et al., 2009,
! The Gait Profile Score and Movement ANalysis Profile, Gait and Posture, 30,
! p.265.
!=======================================================
  File_Open
  File_Open
  ! /FILE_NAME=
  /FILE_NAME=C:\Users\amyco\Documents\GPS\GPS_Normalized_Database.vnd
  ! /SUFFIX=
  ! /SUFFIX=
  /SET_PROMPT=Open Control Database for GPS
  !/SET_PROMPT=Open Control Database for GPS
  ;  
  ;  
 
Select_Active_File
:4. '''Calculating GVS: ''' For each axis of each joint, the reference signal is subtracted from the test signal, then the root mean square is calculated. This is repeated for right and left sides. Below is an example of calculating GVS for the right foot.
/FILE_NAME=GLOBAL
 
! /QUERY=
  !--------Find GVS for Right Foot---------
;
  Subtract_Signals
Set_Pipeline_Parameter_To_List_Of_Signal_Names
! Get a list of the kinematic variables which will be used to calculate the GPS
! The normalized signals should be stored in the P2D::GPS_SUBJECT folder
  ! - ONLY signals to be included in the GPS should be in this folder
! - The signal names from this folder be identical to the corresponding control signals
! - Control signals should be stored in the P2D::GPS_CONTROL folder
  /PARAMETER_NAME=SIGNAL_LIST
  /SIGNAL_TYPES=P2D
  /SIGNAL_TYPES=P2D
  /SIGNAL_FOLDER=GPS_SUBJECT
/SIGNAL_NAMES=R_Foot_Progression_Z+R_Foot_Progression_Z_nd
  /SIGNAL_FOLDER=PROCESSED
/RESULT_NAME=R_Foot_Progression_Z
/RESULT_FOLDER=R_GVS_Diff
  ;
  ;
   
  Metric_Root_Mean_Squared
  Get_Pipeline_Parameter_Count
  !Calculate the GVS
  ! Calculate the number of kinematic variables to be used for the GPS
  !The GVS is the RMS of the difference between the Subject and Control Data
  /PARAMETER_NAME=KIN_VARIABLES
/RESULT_METRIC_FOLDER=R_GVS
  /PARAMETER_VALUE=::SIGNAL_LIST
/RESULT_METRIC_NAME=_RMS
/APPLY_AS_SUFFIX_TO_SIGNAL_NAME=TRUE
/SIGNAL_TYPES=DERIVED
/SIGNAL_FOLDER=R_GVS_Diff
/SIGNAL_NAMES=R_Foot_Progression_Z
  /COMPONENT_SEQUENCE=Y
  /EVENT_SEQUENCE=
/EXCLUDE_EVENTS=
/SEQUENCE_PERCENT_START=
/SEQUENCE_PERCENT_END=
/GENERATE_MEAN_AND_STDDEV=FALSE
! /APPEND_TO_EXISTING_VALUES=FALSE
  ;
  ;
   
  Evaluate_Expression
  For_Each
  ! Square the GVS value for each variable
  /ITERATION_PARAMETER_NAME=SIGNAL
/EXPRESSION=(METRIC::R_GVS::R_Foot_Progression_Z_RMS) ^ 2
  ! Loop over each signal in the list
  !/SIGNAL_TYPES=METRIC
  /ITEMS=::SIGNAL_LIST
  !/SIGNAL_FOLDER=R_GVS
! /SIGNAL_NAMES=
/RESULT_TYPES=METRIC
/RESULT_FOLDERS=R_GPS_MATH
/RESULT_NAME=R_Foot_Progression_RMS_SQR
  ! /APPLY_AS_SUFFIX_TO_SIGNAL_NAME=FALSE
  ;
  ;
! -------------------------
 
! Calculate GVS
:5. '''Calculating GPS:''' The Evaluate_Expression function is used to implement the equation described above. The results are stored in the individual exercise files under the METRIC :: GPS folder. Below is an example of calculating the overall GPS.
! -------------------------
 
!--------Calculate GPS----------  
Subtract_Signals
Add_Signals
! Calculate the difference between the Subject and Control Data
/SIGNAL_TYPES=METRIC
/SIGNAL_TYPES=P2D
  /SIGNAL_FOLDER=L_GPS_MATH
/SIGNAL_FOLDER=GPS_SUBJECT+GPS_CONTROL
  /SIGNAL_NAMES=
/SIGNAL_NAMES=::SIGNAL
  /COMPONENT_SEQUENCE=ALL
! /COMPONENT_SEQUENCE=
  /RESULT_NAME=GPS_SUM
/RESULT_FOLDER=GVS_SIGNAL_DIFF
  /RESULT_FOLDER=L_GPS_SUM
/RESULT_NAME=&::SIGNAL&
;
Metric_Root_Mean_Squared
! Calculate the GVS
! The GVS is the RMS of the difference between the Subject and Control Data
/RESULT_METRIC_FOLDER=GVS
/RESULT_METRIC_NAME=_RMS
/APPLY_AS_SUFFIX_TO_SIGNAL_NAME=TRUE
/SIGNAL_TYPES=DERIVED
/SIGNAL_FOLDER=GVS_SIGNAL_DIFF
/SIGNAL_NAMES=&::SIGNAL&
/COMPONENT_SEQUENCE=Y
/EVENT_SEQUENCE=
/EXCLUDE_EVENTS=
/SEQUENCE_PERCENT_START=
/SEQUENCE_PERCENT_END=
/GENERATE_MEAN_AND_STDDEV=FALSE
! /APPEND_TO_EXISTING_VALUES=FALSE
;
! -------------------------
! Calculate GPS
! -------------------------
Evaluate_Expression
! Square the GVS value for each variable
/EXPRESSION= ( METRIC::GVS:&:&::SIGNAL&_RMS ) ^ 2
! /SIGNAL_TYPES=
! /SIGNAL_FOLDER=ORIGINAL
! /SIGNAL_NAMES=
/RESULT_TYPES=METRIC
/RESULT_FOLDERS=GPS_MATH
/RESULT_NAME=&::SIGNAL&_RMS_SQR
! /APPLY_AS_SUFFIX_TO_SIGNAL_NAME=FALSE
;
End_For_Each
  /ITERATION_PARAMETER_NAME=SIGNAL
;
Set_Pipeline_Parameter
! Update the signal list to reflect the suffixes added to the original signal names
  /PARAMETER_NAME=SIGNAL_LIST2
  /PARAMETER_VALUE=::SIGNAL_LIST
! /PARAMETER_VALUE_SEARCH_FOR=
  ! /PARAMETER_VALUE_REPLACE_WITH=
  ! /PARAMETER_VALUE_PREFIX=
/PARAMETER_VALUE_APPEND=_RMS_SQR
! /MULTI_PASS=FALSE
  ;
  ;
  Add_Signals
  Add_Signals
! Sum the squared GVS for each variable
  /SIGNAL_TYPES=METRIC
  /SIGNAL_TYPES=METRIC
  /SIGNAL_FOLDER=GPS_MATH
  /SIGNAL_FOLDER=R_GPS_MATH
  /SIGNAL_NAMES=::SIGNAL_LIST2
  /SIGNAL_NAMES=
  ! /COMPONENT_SEQUENCE=
  /COMPONENT_SEQUENCE=ALL
/RESULT_FOLDER=GPS_MATH
  /RESULT_NAME=GPS_SUM
  /RESULT_NAME=GPS_SUM
/RESULT_FOLDER=R_GPS_SUM
;
!Add Left and Right
Evaluate_Expression
/EXPRESSION= (METRIC::L_GPS_SUM::GPS_SUM+METRIC::R_GPS_SUM::GPS_SUM)
! /SIGNAL_TYPES=
! /SIGNAL_FOLDER=ORIGINAL
! /SIGNAL_NAMES=
/RESULT_TYPES=METRIC
/RESULT_FOLDERS=GPS_Sum
/RESULT_NAME=Total_GPS_Sum
!/APPLY_AS_SUFFIX_TO_SIGNAL_NAME=FALSE
;
! Go back to file workspace so we can save the Final GGA there
Select_Active_File
/FILE_NAME=&::c3dFILE
! /QUERY=
  ;
  ;
  Evaluate_Expression
  Evaluate_Expression
  ! Calculate the GPS  
  ! Calculate the GPS  
  ! The GPS is the RMS of the kinematic variables
  ! The GPS is the RMS of the kinematic variables
  ! Since the GVS of the kinematic variables were already squared and summed, the signal only needs to be divided by the number of variables and the square root taken
  ! Since the GVS of the kinematic variables were already squared and summed,  
  /EXPRESSION= SQRT ( (1 / &::KIN_VARIABLES&) * ( METRIC::GPS_MATH::GPS_SUM ) )
the signal only needs to be divided by the number of variables and the square root taken
  /EXPRESSION= SQRT (GLOBAL::METRIC::GPS_Sum::Total_GPS_SUM/15)
  ! /SIGNAL_TYPES=
  ! /SIGNAL_TYPES=
  ! /SIGNAL_FOLDER=ORIGINAL
  ! /SIGNAL_FOLDER=ORIGINAL
Line 364: Line 265:
  /RESULT_TYPES=METRIC
  /RESULT_TYPES=METRIC
  /RESULT_FOLDERS=GPS
  /RESULT_FOLDERS=GPS
  /RESULT_NAME=GPS
  /RESULT_NAME=Total_GPS
  ! /APPLY_AS_SUFFIX_TO_SIGNAL_NAME=FALSE
  ! /APPLY_AS_SUFFIX_TO_SIGNAL_NAME=FALSE
  ;
  ;
!File_Save
!;

Latest revision as of 11:20, 22 May 2024

Language:  English  • français • italiano • português • español 

Academic Background

Baker et al. published two papers defining the calculation and applications of the Gait Profile Score (GPS):

  1. Baker, R., McGinley, J.L., Schwartz, M.H., Beynon, S., Rozumalski, A., Graham, H.K., Tirosh, O. (2009). The gait profile score and movement analysis profile. Gait Posture, 30(3), 265–269.
  2. Baker, R., McGinley, J. L., Schwartz, M., Thomason, P., Rodda, J., & Graham, H. K. (2012). The minimal clinically important difference for the Gait Profile Score. Gait Posture, 35(4), 612-615.

This tutorial describes how to create a pipeline to compute the Gait Profile Score and Movement Analysis Profile as detailed in the papers published by Baker et al.

Relevant Links

Downloads

GPS Description and Conventions

The Gait Profile Score (GPS) is a clinical index that can be used to measure the overall deviation of gait data relative to normative data. It is composed of Gait Variable Scores (GVSs) calculated from 9 key kinematic gait variables, which can be presented as a Movement Analysis Profile (MAP).

These kinematic variables are:

  • Knee Flexion/Extension
  • Ankle Dorsiflexion/Plantarflexion
  • Pelvic Tilt
  • Pelvic Rotation
  • Pelvic Obliquity
  • Hip Flexion/Extension
  • Hip Abduction/Adduction
  • Hip Rotation
  • Foot Progression

Each of these kinematic variables should be normalized to the gait cycle (as in above right image), and should be sampled every 2% of the gait cycle (such that each signal has 51 points).

The GPS score can be computed for the left and/or the right side. It can also be computed as a overall index for both sides.

Please note: Since the pelvic movement is not specific to a any side, the authors recommend only including it when computing the GPS for the left side (as a convention). This means that for the left side, a total of 9 variables are used to compute the GPS, instead of only 6 for the right side. The overall GPS for both sides would therefore include all 9 variables.

Equations

Although calculating the Gait Profile Score was explained in Baker et al's 2009 paper, the equations were not explicitly written. Their 2012 paper contains explicit written equations but due to some formatting errors these are incorrect. The GPS Equations and Descriptions PDF has the correct version of these equations, which are also described below:

The Global Variable Scores (GVS) is the root mean square difference between a specific time normalized gait variable (x) and the mean data from the reference population calculated across the gait cycle (x ref).

caption

i = the number of kinematic variables used

t = the specific point in the gait cycle

T = total number of points in the gait cycle

xi,t = the value of gait variable i at point t

xi,t ref = the mean of gait variable i at point t in the reference population

If normalizing to every 2% of the gait cycle, T is equal to 51.

The Gait Profile Score (GPS) the root mean square average of all the Gait Variable Scores:

caption

i = the specific kinematic variable

T = total number of kinematic variables used

If using 15 kinematic variables, N is equal to 15.

As described in the previous section, the GPS can be calculated for the right side, the left side, or as an overall value. In Richard Baker's GPS Excel Sheet Calculator, there is also an added log transform to the final GPS value (this is optional).

Step 1: Model Creation and Joint Angle Definition

To calculate the GPS using the described kinematic variables, you must have a model with at least 7 segments:

  1. Pelvis
  2. Left/Right Thigh Segments
  3. Left/Right Shank Segments
  4. Left/Right Foot Segments

If you are unfamiliar with building models in Visual3D, the Model Building Tutorial is a good place to start if you want to alter the tutorial pipeline. The zip files for this tutorial contain a workspace with a pre-built and pre-applied model.

Once a model has been created, the joint angles for each of the nine kinematic variables need to be calculated. Below is an example of calculating the Left Ankle Angle:

!--------Left Ankle Angle----------!
Compute_Model_Based_Data
/RESULT_NAME=L_Ankle_Angle
/SUBJECT_TAG=ALL_SUBJECTS
/FUNCTION=JOINT_ANGLE
/SEGMENT=LMF
/REFERENCE_SEGMENT=LSK
/RESOLUTION_COORDINATE_SYSTEM=
! /USE_CARDAN_SEQUENCE=FALSE
! /NORMALIZATION=FALSE
! /NORMALIZATION_METHOD=
! /NORMALIZATION_METRIC=
! /NEGATEX=FALSE
! /NEGATEY=FALSE
! /NEGATEZ=FALSE
! /AXIS1=X
! /AXIS2=Y
! /AXIS3=Z
! /TREADMILL_DATA=FALSE
! /TREADMILL_DIRECTION=UNIT_VECTOR(0,1,0)
! /TREADMILL_SPEED=0.0
;

The zip file download for this tutorial contains a pipeline that calculates joint angles for all nine kinematic variables.

Step 2: Create a Normalized Database

To calculate GPS values a reference database needs to be created. The database should contain gait data with the same nine kinematic variables described above, which should be normalized to 51 points per gait cycle (in this tutorial, the gait cycles are defined as LHS to LHS).

The GPS_Tutorial_Files.zip contains a pre-made normalized database. The database uses the data from Subjects 2, 3 and 4. If you would like to create your own, the steps to do so can be found under the Normative Data from CMZ Library page. In Visual3D, databases are saved as .vnd file types.

Step 3: Calculating GPS Values using Visual3D Pipeline

This tutorial uses Subject 1 as the test subject and Subjects 2, 3 and 4 as reference subjects. Each subject has four exercises worth of data. The pipeline is approximately 1000 lines long, so it will be described rather than included in it's entirety on this page.

The GPS_Tutorial.zip contains two versions of this pipeline, one labeled "GPS_15features" which does not include the pelvis on the right side (as per Baker et als convention). This is the recommended pipeline to use. However, if you want to see the difference that including the pelvis on the right, there is also a pipeline labeled "GPS_18features".

  1. Calculating Joint Angles: For each of the kinematic variables (ankle angle, knee angle, hip angle, pelvis angle, foot progression) the Compute_Model_Based_Data command can be used to produce joint angle values. This is repeated once for the right side and once for the left side. The values are stored under the LINK_MODEL_BASED :: ORIGINAL folder.
  2. Create Global Signals for Joint Angles: The Global_Normalized_Mean function can be used to store specific components of a signal as a normalized global variable. In this case, the signals are normalized from LHS to LHS to 51 points, and we are interested in the following components of each kinematic variable, which are stored under the GLOBAL workspace in the P2D :: PROCESSED folder.
    • Ankle Dorsiflexion: L_Ankle_Angle_X
    • Knee Flexion: L_Knee_Angle_X
    • Hip Flexion: L_Hip_Angle_X
    • Hip Abduction: L_Hip_Angle_Y
    • Hip Rotation: L_Hip_Angle_Z
    • Pelvic Tilt: L_Pelvic_Angle_X
    • Pelvic Rotation: L_Pelvic_Angle_Y
    • Pelvic Obliquity: L_Pelvic_Angle_Z
    • Foot Progression: L_Foot_Progression_Z

An example on how to normalize the left ankle to 51 points.

Global_Normalized_Signal_Mean
/SIGNAL_TYPES=LINK_MODEL_BASED
/SIGNAL_FOLDER=ORIGINAL
/SIGNAL_NAMES=L_Ankle_Angle
/SIGNAL_COMPONENTS=X
/COMPONENT_SEQUENCE=
! /START_LABEL=
! /END_LABEL=
/EVENT_SEQUENCE=LHS+LHS
! /EXCLUDE_EVENTS=
/RESULT_FOLDER=PROCESSED
/RESULT_NAME=L_Ankle_Angle_X
/NORMALIZE_POINTS=51
/CREATE_STANDARD_DEVIATION=TRUE
! /CALCULATE_PER_FILE=FALSE
;

Note: Step 3 and 4 are done in the Global Workspace

3. Open Reference Database: For the last two steps the normal database has to be loaded into the Visual3D workspace. This can be done using the File_Open command as seen below, however the file path will need to be changed on where you downloaded the normal database:
!------Open Normal Database------
! Note: file path may differ 
File_Open
/FILE_NAME=C:\Users\amyco\Documents\GPS\GPS_Normalized_Database.vnd
! /SUFFIX=
!/SET_PROMPT=Open Control Database for GPS
; 
4. Calculating GVS: For each axis of each joint, the reference signal is subtracted from the test signal, then the root mean square is calculated. This is repeated for right and left sides. Below is an example of calculating GVS for the right foot.
!--------Find GVS for Right Foot---------
Subtract_Signals
/SIGNAL_TYPES=P2D
/SIGNAL_NAMES=R_Foot_Progression_Z+R_Foot_Progression_Z_nd
/SIGNAL_FOLDER=PROCESSED
/RESULT_NAME=R_Foot_Progression_Z
/RESULT_FOLDER=R_GVS_Diff
;
Metric_Root_Mean_Squared
!Calculate the GVS
!The GVS is the RMS of the difference between the Subject and Control Data
/RESULT_METRIC_FOLDER=R_GVS
/RESULT_METRIC_NAME=_RMS
/APPLY_AS_SUFFIX_TO_SIGNAL_NAME=TRUE
/SIGNAL_TYPES=DERIVED
/SIGNAL_FOLDER=R_GVS_Diff
/SIGNAL_NAMES=R_Foot_Progression_Z
/COMPONENT_SEQUENCE=Y
/EVENT_SEQUENCE=
/EXCLUDE_EVENTS=
/SEQUENCE_PERCENT_START=
/SEQUENCE_PERCENT_END=
/GENERATE_MEAN_AND_STDDEV=FALSE
! /APPEND_TO_EXISTING_VALUES=FALSE
;
Evaluate_Expression
! Square the GVS value for each variable
/EXPRESSION=(METRIC::R_GVS::R_Foot_Progression_Z_RMS) ^ 2
!/SIGNAL_TYPES=METRIC
!/SIGNAL_FOLDER=R_GVS
! /SIGNAL_NAMES=
/RESULT_TYPES=METRIC
/RESULT_FOLDERS=R_GPS_MATH
/RESULT_NAME=R_Foot_Progression_RMS_SQR
! /APPLY_AS_SUFFIX_TO_SIGNAL_NAME=FALSE
;
5. Calculating GPS: The Evaluate_Expression function is used to implement the equation described above. The results are stored in the individual exercise files under the METRIC :: GPS folder. Below is an example of calculating the overall GPS.
!--------Calculate GPS---------- 
Add_Signals
/SIGNAL_TYPES=METRIC
/SIGNAL_FOLDER=L_GPS_MATH
/SIGNAL_NAMES=
/COMPONENT_SEQUENCE=ALL
/RESULT_NAME=GPS_SUM
/RESULT_FOLDER=L_GPS_SUM
;
Add_Signals
/SIGNAL_TYPES=METRIC
/SIGNAL_FOLDER=R_GPS_MATH
/SIGNAL_NAMES=
/COMPONENT_SEQUENCE=ALL
/RESULT_NAME=GPS_SUM
/RESULT_FOLDER=R_GPS_SUM
;
!Add Left and Right
Evaluate_Expression
/EXPRESSION= (METRIC::L_GPS_SUM::GPS_SUM+METRIC::R_GPS_SUM::GPS_SUM)
! /SIGNAL_TYPES=
! /SIGNAL_FOLDER=ORIGINAL
! /SIGNAL_NAMES=
/RESULT_TYPES=METRIC
/RESULT_FOLDERS=GPS_Sum
/RESULT_NAME=Total_GPS_Sum
!/APPLY_AS_SUFFIX_TO_SIGNAL_NAME=FALSE
;
! Go back to file workspace so we can save the Final GGA there
Select_Active_File 
/FILE_NAME=&::c3dFILE
! /QUERY= 
;
Evaluate_Expression
! Calculate the GPS 
!	The GPS is the RMS of the kinematic variables
!	Since the GVS of the kinematic variables were already squared and summed, 
!   the signal only needs to be divided by the number of variables and the square root taken
/EXPRESSION= SQRT (GLOBAL::METRIC::GPS_Sum::Total_GPS_SUM/15)
! /SIGNAL_TYPES=
! /SIGNAL_FOLDER=ORIGINAL
! /SIGNAL_NAMES=
/RESULT_TYPES=METRIC
/RESULT_FOLDERS=GPS
/RESULT_NAME=Total_GPS
! /APPLY_AS_SUFFIX_TO_SIGNAL_NAME=FALSE
;
!File_Save
!;
Retrieved from ""