CGM2_4#

class pyCGM2.Model.CGM2.cgm2.CGM2_4#

Implementation of the CGM2.4 model.

Extends the CGM2.3 model to incorporate additional features and functionalities specific to the CGM2.4 protocol.

ANALYSIS_KINEMATIC_LABELS_DICT#

Dictionary mapping ‘Left’ and ‘Right’ to lists of kinematic analysis labels.

Type:

Dict[str, List[str]]

ANALYSIS_KINETIC_LABELS_DICT#

Dictionary mapping ‘Left’ and ‘Right’ to lists of kinetic analysis labels.

Type:

Dict[str, List[str]]

LOWERLIMB_TRACKING_MARKERS#

Constant list of lower limb tracking markers.

Type:

List[str]

LOWERLIMB_SEGMENTS#

Constant list of lower limb segments.

Type:

List[str]

LOWERLIMB_JOINTS#

Constant list of lower limb joints.

Type:

List[str]

__init__()#

Methods

__init__()

addAnthropoInputParameters(iDict[, optional])

Add measured anthropometric data to the model.

addChain(label, indexSegmentList)

Add a segment chain to the model.

addJoint(label, proxLabel, distLabel, ...)

Add a joint to the model.

addSegment(label, index, sideEnum[, ...])

Add a segment to the model.

calibrate(aquiStatic, dictRef, dictAnatomic)

Calibrate the CGM2.4 model with the given static acquisition data.

calibrationProcedure()

Define the calibration procedure for the model.

checkCalibrationProperty(...)

Check if a calibration property matches a specific value.

computeMotion(aqui, dictRef, dictAnat, ...)

Compute poses for both Technical and Anatomical coordinate systems.

computeOptimizedSegmentMotion(aqui, ...)

Compute poses of both Technical and Anatomical coordinate systems for specific segments of the model.

configure([detectedCalibrationMethods])

Configure the model based on detected calibration methods.

decomposeTrackingMarkers(acq, ...)

Decompose tracking markers to their components.

detectCalibrationMethods(acqStatic)

Class method to detect the method used to calibrate knee and ankle joint centres.

displayMotionCoordinateSystem(acqui, ...[, ...])

Display a motion coordinate system.

displayMotionViconCoordinateSystem(acqui, ...)

Display a motion Vicon coordinate system.

displayStaticCoordinateSystem(aquiStatic, ...)

Display a static coordinate system.

getAbdAddAnkleJointOffset([side])

Calculate and store the ankle abduction/adduction offset for specified side(s).

getBodyPart()

[Obsolete] Return the body part represented by the model.

getCentreOfMass()

Return the center of mass trajectory.

getClinicalDescriptor(dataType, ...[, ...])

Return a clinical descriptor.

getFootOffset([side])

Calculate and store the foot offsets for specified side(s).

getHindFootOffset([side])

Calculate and return the hindfoot offsets, including plantar flexion offset and rotation offset.

getJoint(label)

Retrieve a Joint instance based on its label.

getJointList()

Retrieve a list of all joint labels.

getProperty(propertyLabel)

Return a specified property.

getSegment(label)

Retrieve a Segment instance based on its label.

getSegmentByIndex(index)

Retrieve a Segment instance based on its index.

getSegmentIndex(label)

Retrieve the index of a Segment based on its label.

getSegmentList()

Retrieve a list of all segment labels.

getShankOffsets([side])

Calculate and store the shank offset for specified side(s).

getStaticIkTargets()

Get the marker labels used for static inverse kinematics.

getStaticMarkers(dcm)

Return static markers based on the detected calibration methods.

getStaticTrackingMarkers()

Get tracking markers.

getThighOffset([side])

Calculate and store the thigh offset for specified side(s).

getTibialTorsionOffset([side])

Calculate and store the tibial torsion offset for specified side(s).

getTrackingMarkers(acq)

Return tracking markers.

get_markerLabelForPiGStatic(dcm)

Class method returning marker labels of the knee and ankle joint centres.

isCalibrationProperty(label)

Check if a calibration property exists by its label.

isProperty(label)

Check if a property exists by its label.

opensimGeometry()

Returns a dictionary used to configure the osim file for OpenSim models.

opensimIkTask()

Returns marker weights used for inverse kinematics tasks in OpenSim.

opensimTrackingMarkers()

Retrieves tracking markers for OpenSim model configuration, excluding specific segments.

removeJoint(jointLabels)

Remove Joint instances based on their labels.

removeSegment(segmentLabels)

Remove Segment instances based on their labels.

setBodyPart(bodypart)

[Obsolete] Specify which body part is represented by the model.

setCalibrationProperty(propertyLabel, value)

Set or update a calibration property in the property dictionary.

setCentreOfMass(com)

Set the center of mass trajectory.

setClinicalDescriptor(jointOrSegmentLabel, ...)

Set a clinical descriptor.

setCoordinateSystemDefinition(segmentLabel, ...)

Set coordinate system definition.

setProperty(propertyLabel, value)

Set or update a property in the property dictionary.

setSTAexpertMode(boolFlag)

Set STA expert mode.

setStaticFilename(name)

Set the static filename used for static calibration.

setStaticIkTargets(targetNames)

Set the marker labels used for static inverse kinematics.

setStaticTrackingMarkers(markers)

Set tracking markers.

setVersion(string)

Amend the model version.

updateSegmentFromCopy(targetLabel, segmentToCopy)

Update a segment from a copy of another segment instance.

viconExport(NEXUS, acq, vskName, ...)

Exports model outputs to Vicon Nexus software.

Attributes

ANALYSIS_KINEMATIC_LABELS_DICT

ANALYSIS_KINETIC_LABELS_DICT

KAD_MARKERS

LOWERLIMB_JOINTS

LOWERLIMB_SEGMENTS

LOWERLIMB_TRACKING_MARKERS

THORAX_JOINTS

THORAX_SEGMENTS

THORAX_TRACKING_MARKERS

UPPERLIMB_JOINTS

UPPERLIMB_SEGMENTS

UPPERLIMB_TRACKING_MARKERS

VERSIONS

calibrate(aquiStatic: btkAcquisition, dictRef: Dict, dictAnatomic: Dict, options: Dict | None = None)#

Calibrate the CGM2.4 model with the given static acquisition data.

Parameters:
  • aquiStatic (btk.btkAcquisition) – The static acquisition data.

  • dictRef (Dict) – Dictionary for building the technical coordinate system.

  • dictAnatomic (Dict) – Dictionary for building the anatomical coordinate system.

  • options (Optional[Dict]) – Additional options for calibration. Defaults to None.

computeMotion(aqui: btkAcquisition, dictRef: Dict, dictAnat: Dict, motionMethod: motionMethod, options: Dict | None = None) None#

Compute poses for both Technical and Anatomical coordinate systems. The method differentiates between Determinist and Sodervisk motion methods. For the Sodervisk method, it performs segmental least-square motion processes. Handles different body segments, including pelvis, thighs, shanks, feet, thorax, head, and arms.

Parameters:
  • aqui (btk.btkAcquisition) – Acquisition data.

  • dictRef (Dict) – Technical referential definitions.

  • dictAnat (Dict) – Anatomical referential definitions.

  • motionMethod (enums.motionMethod) – Segmental motion method.

  • options (Optional[Dict]) – Additional arguments for embedded functions.

Returns:

None – Performs computations and updates the object’s state.

computeOptimizedSegmentMotion(aqui: btkAcquisition, segments: List[str], dictRef: Dict, dictAnat: Dict, motionMethod: motionMethod, options: Dict) None#

Compute poses of both Technical and Anatomical coordinate systems for specific segments of the model. It filters out direction markers from tracking markers and computes optimized motion for various body segments like pelvis, thighs, shanks, and feet.

Parameters:
  • aqui (btk.btkAcquisition) – Motion acquisition data.

  • segments (List[str]) – List of segments to be processed.

  • dictRef (Dict) – Definitions of technical referential.

  • dictAnat (Dict) – Definitions of anatomical referential.

  • motionMethod (enums.motionMethod) – Segmental motion method to apply.

  • options (Dict) – Additional options.

Returns:

None – Modifies the state of the object without returning any value.

getHindFootOffset(side: str = 'Both')#

Calculate and return the hindfoot offsets, including plantar flexion offset and rotation offset.

Parameters:

side (str, optional) – Lower limb side to compute the offsets for. Options are “Both”, “Left”, or “Right”. Defaults to “Both”.

Returns:

None – This method does not return anything but updates the model’s parameters.

opensimGeometry() Dict#

Returns a dictionary used to configure the osim file for OpenSim models.

Returns:

Dict – Configuration for osim file defining joints and segments relationships.

opensimIkTask() Dict#

Returns marker weights used for inverse kinematics tasks in OpenSim.

Returns:

Dict – Weights for each marker used in the inverse kinematics process.

viconExport(NEXUS, acq: btkAcquisition, vskName: str, pointSuffix: str, staticProcessingFlag: bool) None#

Exports model outputs to Vicon Nexus software. Handles exporting of measured markers, joint centers, angles, bones, forces, moments, power, and center of mass.

Parameters:
  • NEXUS – Nexus software interface object.

  • acq (btk.btkAcquisition) – Acquisition data.

  • vskName (str) – Name of the VSK file.

  • pointSuffix (str) – Suffix for the point names.

  • staticProcessingFlag (bool) – Flag indicating if static processing is being done.

Returns:

None – Exports data directly to Nexus software.