InverseDynamicsXmlProcedure#

class pyCGM2.Model.Opensim.interface.procedures.inverseDynamics.opensimInverseDynamicsInterfaceProcedure.InverseDynamicsXmlProcedure(DATA_PATH: str, scaledOsimName: str, resultsDirectory: str | None)#

Provides a procedure for setting up and executing inverse dynamics analyses in OpenSim.

This class handles the preparation of trials from BTK acquisitions, configuration of analysis parameters, and execution of the inverse dynamics tool in OpenSim.

Parameters:
  • DATA_PATH (str) – Path to the data directory.

  • scaledOsimName (str) – Name of the scaled OpenSim model file.

  • resultsDirectory (Optional[str]) – Directory for storing results.

__init__(DATA_PATH: str, scaledOsimName: str, resultsDirectory: str | None)#

Methods

__init__(DATA_PATH, scaledOsimName, ...)

finalize()

Finalizes the process, including renaming and cleanup of the setup files.

getXml()

Retrieves the XML associated with the procedure.

prepareTrial_fromBtkAcq(acq, dynamicFile, ...)

Prepares the trial data from a BTK acquisition for inverse dynamics analysis.

prepareXml()

Prepares the XML configuration for the Inverse Dynamics Tool in OpenSim.

run()

Executes the inverse dynamics analysis using the configured XML files.

setFrameRange(begin, end)

Sets the frame range for the inverse dynamics analysis.

setModelVersion(modelVersion)

Sets the model version.

setResultsDirname(dirname)

Sets the directory name where the results will be stored.

setSetupFiles(idToolTemplateFile, ...)

Sets up the necessary files for inverse dynamics analysis.

setTimeRange(begin, end)

Sets the time range for the inverse dynamics analysis.

finalize()#

Finalizes the process, including renaming and cleanup of the setup files.

prepareTrial_fromBtkAcq(acq: btkAcquisition, dynamicFile: str, mfpa: Any, progressionAxis: str, forwardProgression: bool) None#

Prepares the trial data from a BTK acquisition for inverse dynamics analysis.

Parameters:
  • acq (btk.btkAcquisition) – BTK acquisition object.

  • dynamicFile (str) – Name of the dynamic file.

  • mfpa (Any) – Parameter for foot reaction analysis (specific type depends on the context).

  • progressionAxis (str) – Axis of progression.

  • forwardProgression (bool) – Direction of forward progression.

prepareXml()#

Prepares the XML configuration for the Inverse Dynamics Tool in OpenSim.

run()#

Executes the inverse dynamics analysis using the configured XML files.

setFrameRange(begin: int | None, end: int | None) None#

Sets the frame range for the inverse dynamics analysis.

Parameters:
  • begin (Optional[int]) – The beginning frame number. If None, starts from the first frame.

  • end (Optional[int]) – The ending frame number. If None, ends at the last frame.

setSetupFiles(idToolTemplateFile: str, externalLoadTemplateFile: str) None#

Sets up the necessary files for inverse dynamics analysis.

Parameters:
  • idToolTemplateFile (str) – Path to the Inverse Dynamics tool template file.

  • externalLoadTemplateFile (str) – Path to the external load template file.

setTimeRange(begin: float, end: float) None#

Sets the time range for the inverse dynamics analysis.

Parameters:
  • begin (float) – The beginning time in seconds.

  • end (float) – The ending time in seconds.