CGM1#
- class pyCGM2.Model.CGM2.cgm.CGM1#
- Conventional Gait Model 1 (aka Vicon Plugin Gait Clone). - __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 model using static acquisition data. - Define the calibration procedure for the model. - checkCalibrationProperty(...)- Check if a calibration property matches a specific value. - computeMotion(aqui, dictRef, dictAnat, ...)- Compute poses of 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). - 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). - 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. - Provides geometry configuration for OpenSim models. - Returns marker weights for Inverse Kinematics (IK) in OpenSim. - 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. - 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 Nexus for Vicon systems. - 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[str, Any], dictAnatomic: Dict[str, Any], options: Dict[str, Any] | None = None) None#
- Calibrate the model using static acquisition data. - This method carries out the calibration of the model using static acquisition data, reference markers, and anatomical markers. It allows for optional parameters to customize the calibration process. - Parameters:
- aquiStatic (btk.btkAcquisition) – Static acquisition data for calibration. 
- dictRef (Dict[str, Any]) – Dictionary for technical coordinate system reference markers. 
- dictAnatomic (Dict[str, Any]) – Dictionary for anatomical coordinate system reference markers. 
- options (Optional[Dict[str, Any]]) – Additional options for calibration, if any. 
 
 
 - calibrationProcedure()#
- Define the calibration procedure for the model. - This method outlines the calibration procedure by defining technical and anatomical coordinate systems for various segments. It involves lower limb, trunk, and upper limb calibration procedures. - Returns:
- tuple – A tuple containing two dictionaries, one for the markers and sequence used for building the technical coordinate system and another for the anatomical coordinate system. 
 
 - computeMotion(aqui: btkAcquisition, dictRef: Dict[str, Any], dictAnat: Dict[str, Any], motionMethod: motionMethod, options: Dict[str, Any] | None = None) None#
- Compute poses of both Technical and Anatomical coordinate systems. - Parameters:
- aqui (btk.btkAcquisition) – Acquisition data. 
- dictRef (Dict[str, Any]) – Technical referential definitions. 
- dictAnat (Dict[str, Any]) – Anatomical referential definitions. 
- motionMethod (enums.motionMethod) – Segmental motion method. 
- options (Optional[Dict[str, Any]], optional) – Passed arguments to embedded functions. Defaults to None. 
 
 - Options:
- pigStatic (bool): Compute foot coordinate system according to the Vicon Plugin-gait. forceFoot6DoF (bool): Apply 6DOF pose optimization on the foot. 
 
 - computeOptimizedSegmentMotion(aqui: btkAcquisition, segments: List[str], dictRef: Dict[str, Any], dictAnat: Dict[str, Any], motionMethod: motionMethod, options: Dict[str, Any]) None#
- Compute poses of both Technical and Anatomical coordinate systems for specific segments of the model. - Parameters:
- aqui (btk.btkAcquisition) – Motion acquisition data. 
- segments (List[str]) – Segments of the model. 
- dictRef (Dict[str, Any]) – Technical referential definitions. 
- dictAnat (Dict[str, Any]) – Anatomical referential definitions. 
- motionMethod (enums.motionMethod) – Segmental motion method to apply. 
- options (Dict[str, Any]) – Passed known-arguments. 
 
 
 - configure(detectedCalibrationMethods: Dict | None = None)#
- Configure the model based on detected calibration methods. - Parameters:
- detectedCalibrationMethods (Dict, optional) – Dictionary of detected calibration methods. Defaults to None. 
 
 - getAbdAddAnkleJointOffset(side: str = 'both') None#
- Calculate and store the ankle abduction/adduction offset for specified side(s). - Computes the angle in the frontal plane between the ankle marker and the ankle flexion axis. - Parameters:
- side (str, optional) – Side of the body to compute the offset for. Can be ‘both’, ‘left’, or ‘right’. Defaults to ‘both’. 
 
 - getFootOffset(side: str = 'both') None#
- Calculate and store the foot offsets for specified side(s). - Computes the plantar flexion offset and the rotation offset of the foot. - Parameters:
- side (str, optional) – Side of the body to compute the offset for. Can be ‘both’, ‘left’, or ‘right’. Defaults to ‘both’. 
 
 - getShankOffsets(side: str = 'both') None#
- Calculate and store the shank offset for specified side(s). - Computes the angle between the projection of the lateral shank marker and the ankle flexion axis. - Parameters:
- side (str, optional) – Side of the body to compute the offset for. Can be ‘both’, ‘left’, or ‘right’. Defaults to ‘both’. 
 
 - getStaticMarkers(dcm: Dict)#
- Return static markers based on the detected calibration methods. - Parameters:
- dcm (Dict) – Dictionary returned from the function detectCalibrationMethods. 
- Returns:
- List[str] – List of static markers. 
 
 - getThighOffset(side: str = 'both') None#
- Calculate and store the thigh offset for specified side(s). - Computes the angle between the projection of the lateral thigh marker and the knee flexion axis. - Parameters:
- side (str, optional) – Side of the body to compute the offset for. Can be ‘both’, ‘left’, or ‘right’. Defaults to ‘both’. 
 
 - getTibialTorsionOffset(side: str = 'both') None#
- Calculate and store the tibial torsion offset for specified side(s). - Computes the tibial torsion offsets based on the anatomical frame of the thigh and shank segments. - Parameters:
- side (str, optional) – Side of the body to compute the offset for. Can be ‘both’, ‘left’, or ‘right’. Defaults to ‘both’. 
 
 - getTrackingMarkers(acq: btkAcquisition) List[str]#
- Return tracking markers. - Parameters:
- acq (btk.btkAcquisition) – Acquisition object. 
- Returns:
- List[str] – List of tracking markers. 
 
 - opensimGeometry() dict#
- Provides geometry configuration for OpenSim models. - This method returns a dictionary containing the necessary information to configure the osim file for OpenSim. It includes joint labels and segment labels for key body parts. - Returns:
- dict – A dictionary with configuration details for OpenSim geometry. 
 
 - opensimIkTask() dict#
- Returns marker weights for Inverse Kinematics (IK) in OpenSim. - This method provides a dictionary of markers and their respective weights, which are used in the IK process of OpenSim. - Returns:
- dict – A dictionary where keys are marker names and values are their weights for IK. 
 
 - opensimTrackingMarkers() dict#
- Retrieves tracking markers for OpenSim model configuration, excluding specific segments. - This method provides a dictionary of tracking markers for segments, excluding those listed in the ‘excluded’ list. It is useful for configuring OpenSim models. - Returns:
- dict – A dictionary with segment names as keys and corresponding tracking markers as values. 
 
 - setVersion(string: str) None#
- Amend the model version. - Parameters:
- string (str) – New version string to be set. 
 
 - viconExport(NEXUS, acq: btkAcquisition, vskName: str, pointSuffix: str, staticProcessingFlag: bool) None#
- Exports model outputs to Nexus for Vicon systems. - Parameters:
- NEXUS (viconnexus) – Nexus handle for Vicon software integration. 
- acq (btk.btkAcquisition) – Acquisition data. 
- vskName (str) – Name of the VSK file. 
- pointSuffix (str) – Suffix for the points to be exported. 
- staticProcessingFlag (bool) – Flag to determine if only static model outputs will be exported. 
 
 
 
