StaticOptimisationXmlProcedure#

class pyCGM2.Model.Opensim.interface.procedures.staticOptimisation.opensimStaticOptimizationInterfaceProcedure.StaticOptimisationXmlProcedure(DATA_PATH: str, scaledOsimName: str, resultsDirectory: str | None)#

Handles the setup and execution of static optimization analyses in OpenSim.

This class is responsible for configuring the Static Optimization tool in OpenSim based on the provided BTK acquisition data and specified model files.

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. If None, defaults to DATA_PATH.

__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 static optimization analysis.

prepareXml()

Prepares the XML configuration for the Static Optimization Tool in OpenSim.

run()

Executes the static optimization analysis using the configured XML files.

setFrameRange(begin, end)

Sets the frame range for the static optimization analysis.

setModelVersion(modelVersion)

Sets the model version.

setResultsDirname(dirname)

Sets the results directory name.

setSetupFiles(analysisToolTemplateFile, ...)

Sets up the file paths for the Static Optimization tool and external load file.

setTimeRange(begin, end)

Sets the time range for the static optimization 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 static optimization 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 Static Optimization Tool in OpenSim.

run()#

Executes the static optimization analysis using the configured XML files.

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

Sets the frame range for the static optimization 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.

setResultsDirname(dirname: str) None#

Sets the results directory name.

Parameters:

dirname (str) – The name of the directory to store results.

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

Sets up the file paths for the Static Optimization tool and external load file.

Parameters:
  • analysisToolTemplateFile (str) – Path to the Static Optimization tool template file.

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

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

Sets the time range for the static optimization analysis.

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

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