Use pyCGM2 in Vicon Nexus
In this section:
CGM2 labeling templates (VSTs)
CGM2 VSTs are automatically installed in:
C:\Users\Public\Documents\Vicon\Nexus2.x\ModelTemplates
Note that VSTs are available for both lower and full body.
If you are using a version of CGM2 earlier than 2.5 and want to perform upper body modeling, run either a custom upper limb model or the full body Plug-in Gait model. If you use the full body PiG model, add a script prefix to the outputs, so that the PiG model does not overwrite your CGM2 lower body model. (If you're not sure which version of CGM2 you're using, see Find the version number of CGM2.)
For all versions of CGM2, you must use the appropriate marker set for the model, for example, you must run a 2.5 model using a 2.5 marker set.
Find information about CGM2
For more information about CGM2, see the following:
https://pycgm2.netlify.app/
Information about the CGM2 models:
- CGM 1.0 (Vicon Plug-in Gait Clone):
https://pycgm2.netlify.app/cgm/cgm1.0/ - CGM 1.1:
https://pycgm2.netlify.app/cgm/cgm1.1/ - CGM 2.1 (Hip Joint Center):
https://pycgm2.netlify.app/cgm/cgm2.1/ - CGM 2.2 (Inverse Kinematic):
https://pycgm2.netlify.app/cgm/cgm2.2/ - CGM 2.3 (Skin Clusters):
https://pycgm2.netlify.app/cgm/cgm2.3/ - CGM 2.4 (Forefoot):
https://pycgm2.netlify.app/cgm/cgm2.4/ - CGM 2.5 (Upper body model):
https://pycgm2.netlify.app/cgm/cgm2.5/ - CGM 2.6 (Knee calibration)
https://pycgm2.netlify.app/cgm/cgm2.6/
Note that each subsequent model includes the improvements made in all prior models, eg, skin cluster calculations, inverse kinematics, and hip joint center calculations will also be applied within the forefoot model.
Additional information about CGM2:
- CGM 4.2 (Event detection)
https://pycgm2.netlify.app/nexusqualisys/vicon-apps/events/ - CGM 4.2 (Kalman gap-filling)
https://pycgm2.netlify.app/nexusqualisys/vicon-apps/gaps/
Information about marker placement:
https://pycgm2.netlify.app/ressources/palpation/
Run the static CGM2 model
To apply the model, run the CGM2 - Calibration pipeline operation on static trials.
Add the CGM2 - Calibration pipeline operation to the current pipeline, select it and in the Properties pane, select the required parameters:
- Environment activation If you need to run an executable file to configure the Python environment before running the script, specify the full path to the file.
- Model Version Select the CGM version that you want to use.
- Marker Diameter Default is 14 mm.
- Suffix Add your preferred naming convention, eg,
CGM2
. Note that CGM2 automatically adds an underscore, so if you specify the suffixCGM2
, all the outputs will have the suffix_CGM2
. - Left Foot Flat and Right Foot Flat Default is selected.
- Head Level Select or clear the head horizontal option.
- Reset MP Reset computation of optional parameters, eg, interAsisDistance and shank offsets. If selected, the information entered in the Properties pane of the Subjects Resources tab is accounted for when applying the model.
- Force LHJC and Force RHJC Forces the local position of the left/right hip joint center in the pelvic coordinate system. Note that this applies only for the CGM2 model from CGM 2.1 and later.
- Disable IK To turn off inverse kinematics, select this check box.
When you run the operation, the model outputs appear in the Subjects tree.
Note that in the following example, the suffix CGM2
has been specified so that the outputs for CGM2 and Plug-in Gait can be compared. If no suffix had been specified, the outputs would be overwritten.
Run the knee calibration (CGM 2.6)
The knee calibration routine (CGM 2.6) provides two options: 2DoF Calibration or SARA. To apply the knee calibration, run the CGM2 - Functional Calibration pipeline operation between the static/calibration (see above) and the dynamic/fitting trials (see below).
Add the CGM2 - Functional Calibration pipeline operation to the current pipeline, select it and in the Properties pane, select the required parameters:
- Environment activation If you need to run an executable file to configure the Python environment before running the script, specify the full path to the file.
-
Method Select the required knee calibration method.
- 2DoF Calibration
- SARA Note that SARA can only be used with a subject that has been statistically calibrated in CGM 2.3 or later.
-
Side Select the option to which to apply the functional calibration.
- Auto Expects each leg to be calibrated from a separate trial. If not, you must specify the frame range for the movement of each leg within the trial.
- Left Runs on the left knee.
- Right Runs on the right knee.
- First Frame Default is Selected Start.
- Last Frame Default is Selected End.
Run the dynamic CGM2 model
To apply the model, run the CGM2 - Fitting pipeline operation on dynamic trials.
Add the CGM2 - Fitting pipeline operation to the current pipeline, select it and in the Properties pane, select the required parameters:
- Model Version: Select the CGM version that you want to use.
- Marker Diameter Default is 14 mm.
- Suffix Add your preferred naming convention, eg,
CGM2
. - Projection: Select the coordinate system for joint moment from the options:
- Default - CGM 1.0 = distal and all other CGM2 models default to JCS (Joint Coordinate System)
- Proximal
- Distal
- Global
- JCS - Joint Coordinate System
- Disable IK If selected, inverse kinematics is deactivated. Applicable only to the CGM2 model from CGM 2.3and later.
The model outputs appear in the Subjects tree. In the same way as in the static/calibration example above, to enable a comparison of CGM2 with Plug-in Gait, a suffix (CGM2
) was specified.
Find the version number of CGM2
You can find out which version of CGM2 is currently installed in either of these ways:
- Display a list of the installed modules for Nexus Python by entering this command:
"C:\Program Files\Vicon\Nexus2.14\Python\python.exe" -m pip freeze | findstr pyCGM2
- Look at the installed package directly, for example:
C:\Program Files\Vicon\Nexus2.14\Python\Lib\site-packages\pyCGM2-4.2.dist-info
C:\Program Files\Vicon\Nexus2.14\pyCGM2-wheels\pyCGM2-4.2-py3-none-any.whl