AnalysesXmlProcedure#

class pyCGM2.Model.Opensim.interface.procedures.analysisReport.opensimAnalysesInterfaceProcedure.AnalysesXmlProcedure(DATA_PATH: str, scaledOsimName: str, resultsDirectory: str | None)#

Handles the setup and execution of various analyses in OpenSim using XML configurations.

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 analysis.

prepareTrial_fromMotFiles(kinematicMotFile, ...)

Prepares the trial data from MOT files for analysis.

prepareXml()

Prepares the XML configuration for the analysis in OpenSim.

run()

Executes the analysis using the configured XML files.

setFrameRange(begin, end)

Sets the frame range for the analysis.

setModelVersion(modelVersion)

Sets the model version.

setResultsDirname(dirname)

Sets the directory name where the results will be stored.

setSetupFiles(analysisToolTemplateFile, ...)

Sets up the file paths for the analysis tool and, optionally, the external load file.

setTimeRange(begin, end)

Sets the time range for the 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 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.

prepareTrial_fromMotFiles(kinematicMotFile: str, externalLoadDataFile: str | None) None#

Prepares the trial data from MOT files for analysis.

Parameters:
  • kinematicMotFile (str) – Name of the kinematic MOT file.

  • externalLoadDataFile (Optional[str]) – Name of the external load data file, if available.

Raises:

Exception – If the specified MOT file is not found.

prepareXml()#

Prepares the XML configuration for the analysis in OpenSim.

run()#

Executes the analysis using the configured XML files.

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

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

Raises:

Exception – If no acquisition data is detected.

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

Sets up the file paths for the analysis tool and, optionally, the external load file.

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

  • externalLoadTemplateFile (Optional[str]) – Path to the external load template file, if applicable.

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

Sets the time range for the analysis.

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

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