pyCGM2.Lib.analysis.makeAnalysis#

pyCGM2.Lib.analysis.makeAnalysis(DATA_PATH: str, filenames: List, eventType: str = 'Gait', kinematicLabelsDict: Dict | None = {'Left': ['LHipAngles', 'LKneeAngles', 'LAnkleAngles', 'LFootProgressAngles', 'LPelvisAngles', 'LForeFootAngles', 'LThoraxAngles', 'LSpineAngles', 'LNeckAngles', 'LHeadAngles', 'LShoulderAngles', 'LElbowAngles', 'LWristAngles'], 'Right': ['RHipAngles', 'RKneeAngles', 'RAnkleAngles', 'RFootProgressAngles', 'RPelvisAngles', 'RForeFootAngles', 'RThoraxAngles', 'RSpineAngles', 'RNeckAngles', 'RHeadAngles', 'RShoulderAngles', 'RElbowAngles', 'RWristAngles']}, kineticLabelsDict: Dict | None = {'Left': ['LHipMoment', 'LKneeMoment', 'LAnkleMoment', 'LHipPower', 'LKneePower', 'LAnklePower', 'LStanGroundReactionForce', 'LGroundReactionForce'], 'Right': ['RHipMoment', 'RKneeMoment', 'RAnkleMoment', 'RHipPower', 'RKneePower', 'RAnklePower', 'RStanGroundReactionForce', 'RGroundReactionForce']}, emgChannels: List | None = ['Voltage.EMG1', 'Voltage.EMG2', 'Voltage.EMG3', 'Voltage.EMG4', 'Voltage.EMG5', 'Voltage.EMG6', 'Voltage.EMG7', 'Voltage.EMG8', 'Voltage.EMG9', 'Voltage.EMG10', 'Voltage.EMG11', 'Voltage.EMG12', 'Voltage.EMG13', 'Voltage.EMG14', 'Voltage.EMG15', 'Voltage.EMG16'], geometryMuscleLabelsDict: Dict | None = None, dynamicMuscleLabelsDict: Dict | None = None, pointLabelSuffix: str | None = None, subjectInfo: Dict | None = None, experimentalInfo: Dict | None = None, modelInfo: Dict | None = None, **kwargs)#

This function normalises data in time and returns an Analysis Instance ie a nested dictionary containing spatiotemporal parameters, normalized kinematics, normalized kinetics and normalized EMG envelops from a list of c3d files.

By default: the function calls :

  • kinematic and kinetic ouputs of the CGM

  • emg channels names Voltage.EMG1 to Voltage.EMG16

You can also compute spatiotemporal parameters, normalized kinematics, normalized kinetics and normalized EMG envelops from different set of c3d files. For that, use the named arguments :

  • pstfilenames

  • kinematicfilenames

  • kineticfilenames

  • emgfilenames

Parameters:
  • DATA_PATH (str) – Folder path containing c3d files.

  • filenames (List[str]) – List of c3d filenames for analysis.

  • eventType (str, optional) – Type of events, defaults to ‘Gait’. Options include ‘Gait’ and ‘unknown’.

  • kinematicLabelsDict (Dict, optional) – Dictionary specifying kinematic data to normalize.

  • kineticLabelsDict (Dict, optional) – Dictionary specifying kinetic data to normalize.

  • emgChannels (List[str], optional) – List of EMG channels. Defaults to channels defined in pyCGM2.EMG_CHANNELS.

  • geometryMuscleLabelsDict (Optional[Dict], optional) – Dictionary specifying muscle geometry labels.

  • dynamicMuscleLabelsDict (Optional[Dict], optional) – Dictionary specifying dynamic muscle labels.

  • pointLabelSuffix (Optional[str], optional) – Suffix associated with point outputs.

  • subjectInfo (Optional[Dict], optional) – Metadata information about the subject.

  • experimentalInfo (Optional[Dict], optional) – Metadata information about the experiment.

  • modelInfo (Optional[Dict], optional) – Metadata information about the model.

Keyword Arguments:
  • btkAcqs (List[btk.btkAcquisition]) – Optional list of btkAcquisition instances to process.

  • pstfilenames (List[str]) – Optional list of c3d files for computing spatiotemporal parameters.

  • kinematicfilenames (List[str]) – Optional list of c3d files for normalizing kinematic data.

  • kineticfilenames (List[str]) – Optional list of c3d files for normalizing kinetic data.

  • emgfilenames (List[str]) – Optional list of c3d files for normalizing EMG data.

Returns:

analysis.Analysis – an analysis instance

Examples:

analysisInstance = analysis.makeAnalysis(DATA_PATH, [file1.c3d,"file2.c3d"])

The code takes 2 c3d files, then time normalized kinematics, kinetics and emg. Kinematic and kinetic labels are the default CGM output labels. The Emg channels are defined in the emg.setting file

analysisInstance2 = analysis.makeAnalysis(DATA_PATH, [file1.c3d,"file2.c3d"],
..........................................kinematicLabelsDict = {"Left": ["LHipAngles,LKneeAngles"], "Right": ["RHipAngles,RKneeAngles"]},
..........................................kineticLabelsDict = {"Left": ["LHipMoment,LKneePower"], "Right": ["RHipMoment,RKneeMoment"],
..........................................emgChannels = ["Voltage.EMG1","Voltage.EMG2","Voltage.EMG3"],
..........................................subjectInfo = {"Name":"Doe","Firstname":"John"},
..........................................experimentalInfo = {"Barefoot":"No"},
..........................................modelInfo = {"Model":"CGM1"})

The code called specific model outputs and emg channels. In addition, the code also adds subject, experimental and model metadata. These information will be displayed in the exported spreadsheet.