---
title: "Defining the hip model"
canonical: "https://help.vicon.com/space/ProCalc16/12650396/Defining%20the%20hip%20model"
format: markdown
---
Before you begin, ensure you have <span style="color: #172B4D">unzipped</span> the ProCalc Tutorials data as described in [About the data for this tutorial](https://vicon-help.atlassian.net/wiki/spaces/ProCalc16/pages/12650237/Vicon+ProCalc+Generating+VSKs+Tutorial#ViconProCalcGeneratingVSKsTutorial-AboutData).

Start ProCalc, and on the **Data Management** tab, navigate to the**Generating VSKs **folder and double-click the trial called **Static** to load it.

When the trial is loaded, the labeled markers that reflect the image illustrated in [About the Conventional Gait Model 2.3](https://vicon-help.atlassian.net/wiki/spaces/ProCalc16/pages/12649288/About+the+Conventional+Gait+Model+2.3#AbouttheConventionalGaitModel2.3-CGM2MarkerSet) are displayed.

You now need to create two new schemes:

- Input parameters scheme
- Variables scheme

To create the schemes, on the relevant tabs (**Input Parameters** and **Variables**), click the Create button > Macro (inline-media-image)

 to the right of the **Scheme** drop-down menu and enter an appropriate name for the scheme, eg, **CGM2.3**.

CGM2.1 (on which 2.3 is based) introduces the hip model – it is based on a paper by *Hara et al* (2016) that proposes a simple regression equation, using the Leg Length as the only variable:  
> Macro (inline-media-image)



## Define the input parameters

First, you need to define the subject parameter named Leg Length. If you used the standard CGM2 VST file when you defined your subject in Nexus, as in the supplied tutorial files, add the following parameters. (If you used a different VST, ensure you have replaced any hinge joints with ball joints, as described in [Updating the joints in the VST](https://vicon-help.atlassian.net/wiki/spaces/ProCalc16/pages/12649859).) :

1. On the **Input Parameter** tab, create or select the CGM2.3 scheme.
2. To add a parameter, click the Edit button > Macro (inline-media-image)

.
3. Click the **Add** button > Macro (inline-media-image)

 in the bottom left corner to add another parameter.
4. From the **Subject Measurements** drop-down menu at the bottom, select **LLegLength**, then click **Use**.
5. Ensure that the following properties are set:
  - **Quantity**: Length
  - **Unit**: mm
6. Repeat steps 3-5, but this time with **RLegLength**.
7. With the two parameters in the list, click the Save button at the top > Macro (inline-media-image)

 to save the scheme.

## Add hip model variables to the variables scheme

To define the hip model variables, complete the following steps:

> Macro (toc)

> Macro (scroll-pagebreak)

### Define the hip joint center regression equations

To define the hip joint center regression equations:

1. On the **Variables** tab, create or select the CGM2.3 scheme.
2. Click the **Add** button > Macro (inline-media-image)

 to add a new variable.
3. Name the variable **LHJCx**.
4. Select function **Arithmetic** and then **Add: A + B**.
5. For **A**, choose type **Length** and then **LLegLength**.
6. For **B**, choose type **Length** and then **1mm**.
7. In the **Factor** column for **A**, enter **-0.063**.
8. In the **Factor** column for **B**, enter **11**.  
The calculated value is displayed in the log.
9. Repeat steps 3-8 for LHJCy and LHJCz, making sure that you enter the correct factors according to the above equations.
10. Repeat steps 3-8 for RHJCx, RHJCy and RHJCz. However, make sure that you *negate* the factors for RHJCy (Y is the mediolateral direction, so will be the opposite for left and right).

> ✅ **Tip**   
> ✅ To generate a right-side variable that is equivalent to a left-side variable that you have defined (or vice versa), use the **Copy** button 
> ✅ 
> ✅ ![image](media://777358fd-da4d-43fe-b3ff-50316cb76dc1)
> ✅ 
> ✅  and then the Mirror button 
> ✅ 
> ✅ ![image](media://4d619044-d99b-43ec-8841-d9ae06fe2f64)
> ✅ 
> ✅ .


At the end of this step, six variables are defined, as follows:

![image](media://3c937c75-0a16-4f6f-8e6d-a0aeac461ae6)

> Macro (scroll-pagebreak)

### Define the reference coordinate system for the hip joint center

The reference coordinate system will be the *Pelvis* coordinate system. You define the Pelvis coordinate system using the mid-point between the ASIS points as the origin, the RASI-LASI line as the main defining (Y) axis, and the mid-point between LPSI and RPSI to define the pelvic plane:

1. Define a new point named **PelvisFront **with:
  - Function: **Point** then **Halfway between A and B**
  - A – Type: **Point**, Input Variable: **LASI **
  - B – Type: **Point**, Input Variable: **RASI**
2. Similarly, define a new point named **PelvisBack** halfway between **LPSI** and **RPSI**.
3. Create a new point named **PelvisOrigin** with:
  - Function: **Point** and **Distance A from point B towards Point C**
  - A – Type: **Length**, Input Variable: **1mm**, Fact: A factor that corresponds to half the marker diameter plus the thickness of the marker's plastic base. For example, if you use 14 mm markers with a plastic base that is 1 mm thick, specify a factor of 8. The idea is to offset the pelvic origin posteriorly to account for the diameter of the LASI/RASI markers.
  - B - Type: **Point**, Input Variable: **PelvisFront**
  - C - Type: **Point**, Input Variable: **PelvisBack**
4. Create the Pelvis segment, which must be named **Root** (This is because the segment is named **Root** in the VSK file that we want to update, and the names must match.) To do this, you must create the two vectors that are needed to define the segment, the mediolateral axis and the anterior-posterior one. First, add a new variable named **PelvisML** with:
  - Function: **Vector** then **From point A to point B **
  - A – Type: **Point**, Input Variable: **RASI **
  - B – Type: **Point**, Input Variable: **LASI** (the vector must point towards the left)
5. Add a similar variable **PelvisAP**, but with A: **PelvisFront** and B: **PelvisBack**.
6. Add a new variable named **Root** with:
  - Function: **Segment** and **Origin A, Y-Axis=B, Z-Axis=B x C**
  - A: **PelvisOrigin**,
  - B: **PelvisML**
  - C: **PelvisAP**

Because the cross-product of the ML and AP vectors points up, the pelvis segment is now correctly defined, with the x-axis pointing forward, the y-axis pointing left and the z-axis up. 

### Define the hip joint centers

1. Add a new variable named **LHJC** with:
  - Function: **Point** and **{A, B, C} in Segment D's local coordinates**
  - A, B and C: **LHJCx**, **LHJCy** and **LHJCz**
  - D: **Root**
2. Repeat 1-2 for a new variable named **RHJC**.
3. Make sure that the LHJC and RHJC are displayed in reasonable positions in the 3D workspace.

The following image shows the **LHJC** relative to the pelvic origin.

![image](media://ba924856-b775-4797-8de3-b374f3598a58)