InverseKinematicXmlProcedure#
- class pyCGM2.Model.Opensim.interface.procedures.inverseKinematics.opensimInverseKinematicsInterfaceProcedure.InverseKinematicXmlProcedure(DATA_PATH: str, scaledOsimName: str, resultsDirectory: str | None)#
Procedure for handling inverse kinematics in OpenSim using XML configuration. This class manages the setup and execution of inverse kinematics analyses.
- Parameters:
DATA_PATH (str) – The path to the data directory.
scaledOsimName (str) – The name of the scaled OpenSim model file.
resultsDirectory (Optional[str]) – The directory for storing results. If None, results will be stored in DATA_PATH.
- __init__(DATA_PATH: str, scaledOsimName: str, resultsDirectory: str | None)#
Methods
__init__
(DATA_PATH, scaledOsimName, ...)finalize
()Finalizes the procedure, including file renaming and cleanup.
getXml
()Retrieves the XML associated with the procedure.
prepareTrial_fromBtkAcq
(acq, dynamicFile, ...)Prepares a trial from a BTK acquisition for inverse kinematics analysis.
prepareWeights
(weights_dict)Sets the marker weights for the inverse kinematics analysis.
Prepares the XML configuration for the inverse kinematics analysis.
run
()Runs the inverse kinematics analysis.
setAccuracy
(value)Sets the accuracy for the inverse kinematics analysis.
setFrameRange
(begin, end)Sets the frame range for the inverse kinematics analysis.
setModelVersion
(modelVersion)Sets the model version.
setResultsDirname
(dirname)Sets the directory name where the results will be stored.
setSetupFile
(ikToolFile)Sets up the IK tool file for the inverse kinematics analysis.
setTimeRange
(begin, end)Sets the time range for the inverse kinematics analysis.
- finalize()#
Finalizes the procedure, including file renaming and cleanup.
- prepareTrial_fromBtkAcq(acq: btkAcquisition, dynamicFile: str, progressionAxis: str, forwardProgression: bool) None #
Prepares a trial from a BTK acquisition for inverse kinematics analysis.
- Parameters:
acq (btk.btkAcquisition) – The BTK acquisition object.
dynamicFile (str) – The filename for the dynamic trial.
progressionAxis (str) – The axis of progression.
forwardProgression (bool) – Indicates the direction of forward progression.
- prepareWeights(weights_dict: Dict[str, float]) None #
Sets the marker weights for the inverse kinematics analysis.
- Parameters:
weights_dict (Dict[str, float]) – A dictionary mapping marker names to their weights.
- prepareXml()#
Prepares the XML configuration for the inverse kinematics analysis.
- run()#
Runs the inverse kinematics analysis.
- setAccuracy(value: float) None #
Sets the accuracy for the inverse kinematics analysis.
- Parameters:
value (float) – The accuracy value.
- setFrameRange(begin: int | None, end: int | None) None #
Sets the frame range for the inverse kinematics analysis.
- Parameters:
begin (Optional[int]) – The beginning frame number. If None, it starts from the first frame.
end (Optional[int]) – The ending frame number. If None, it ends at the last frame.
- setSetupFile(ikToolFile: str) None #
Sets up the IK tool file for the inverse kinematics analysis.
- Parameters:
ikToolFile (str) – The path to the IK tool setup file.
- setTimeRange(begin: float, end: float) None #
Sets the time range for the inverse kinematics analysis.
- Parameters:
begin (float) – The beginning time.
end (float) – The ending time.