Skip to content

Reproducibility package (repropack) for generating all the models, results and figures included in the referenced publication. We investigated the effects of maximum isometric forces of muscles crossing individual joints and all lower limb joints on the joint reactions of the lower limb and compared the results against the in vivo loading measur…

License

Notifications You must be signed in to change notification settings

metinbicer/fmax_iso_sensitivity

Repository files navigation

Overview

This repo contains the data, models and Python codes to reproduce the results of the following publication:

@article{Bicer2022fmaxiso,
  title={Altering the Strength of the Muscles Crossing the Lower Limb Joints Only Affects Knee Joint Reaction Forces},
  author={Metin Bicer, Andrew TM Phillips, Luca Modenese},
  journal={Gait & Posture},
  volume = {95},
  pages = {210-216},
  doi = {https://doi.org/10.1016/j.gaitpost.2022.03.020},
  year={2022},
  keywords = {Maximum isometric force, Musculoskeletal modelling, Joint reaction force, Total knee joint replacement, Walking}
}

The paper is available open access at this link.

Brief summary of the publication

In the manuscript:

  • We investigated effects of the strength alterations of the muscles crossing the hip, knee or ankle joints on the joint reaction forces.

  • In vivo measurements of the knee joint reaction forces (5 Grand Challenge Competition to Predict In Vivo Knee Loads) were used to assess our simulation results and select the most accurate model.

  • We found that the most accurate model was the one with 40% weakness in knee-crossing muscles, which represented the weakness of the subject with total knee replacement.

  • Modifying the strength of muscles crossing each lower limb joint mostly alters the estimated joint reaction force at the knee joint, and not at the hip and ankle.

  • The knee joint reaction force decreases with reducing the strength of muscles crossing the knee or ankle joints, while it increases when reducing the strength of hip-crossing muscles.

Requirements

To reproduce the results,

  1. download OpenSim 3.3

  2. have Python installed, preferably Anaconda

  3. create and activate a virtual environment with Python 2

    either

    conda create --name osim3 python=2.7
    conda activate osim3
    conda install numpy scipy pandas matplotlib scikit-learn
    

    or

    conda env create -f environment.yml
    conda activate osim3
    
  4. setup OpenSim API (please refer to OpenSim documentation). In the Anaconda Command Prompt, navigate to OpenSim installation folder and run the python script,

    cd OPENSIM_INSTALLATION_FOLDER\sdk\python
    python setup.py install
    
  5. clone the repository using the following command on git and change directory to fmax_iso_sensitivity folder,

    git clone https://github.com/metinbicer/fmax_iso_sensitivity.git
    cd fmax_iso_sensitivity
    

Note: To use different Python version, you may need to build the OpenSim API from scratch. Further information can be found from the documentation.

Scripts

The following scripts are used to reproduce the results

Script name Script action Related item in the manuscript
main.py reproduces the entire work with the user-defined parameters (subject's BW, unmodified scaled model, modified model names, modified joint names, % changes applied to the joint strengths, names of the gait trials. Imports certain functions from the following scripts N/A
createModels.py creates models with different joint strengths. createModels() is imported by main.py N/A
analysis.py batch processes using inverse dynamics, static optimization and joint reaction analysis. runAnalysis() is imported by main.py N/A
utils.py utility functions to process, save and load the results of all simulations. saveModelResults(), loadModelResults() and loadExpJRF() are imported by main.py to save and load all simulation results and in-vivo joint loads N/A
plot.py plots results (joint reactions, muscle activations and forces) obtained from simulations with models having different joint strength. In-vivo joint loads can be included. plotTrial() and meanPeakDeviationPlot() is imported by main.py plotTrial() -> Figures 1&2, meanPeakDeviationPlot() -> Figure 3
compareResults.py calculates metrics to compare simulation results from modified models to those obtained using the nominal model or all simulation results to in-vivo joint loads. compare() is imported by main.py Tables 1 and 2

Run

  • In the command prompt, type python main.py,
    1. runs inverse dynamics, static optimization and joint reaction analysis for all the data and models.
    2. saves joint reaction forces, muscle forces and activations to JRF.pkl, SO.pkl and ACT.pkl for all valid simulations
    3. loads the files saved in step 2, and eTibia_data.mat that contains in-vivo knee reaction loads
    4. plots joint reaction forces for each trial in a separate figure, muscle forces and activations for a trial
    5. creates tables comparing simulation results to in-vio loadings, and modified model outputs to nominal results
  • If you only want to analyse the previous analyses (saved to JRF.pkl), you need to comment out the following lines.
    L33: createModels(modelFileName, groupNames, changeAmounts)
    L35: runAnalysis(modelFileName, trials)
    L38: JRF, SO, ACT = saveModelResults(trials, BW)
    Then, type python main.py in the command window.

About

Reproducibility package (repropack) for generating all the models, results and figures included in the referenced publication. We investigated the effects of maximum isometric forces of muscles crossing individual joints and all lower limb joints on the joint reactions of the lower limb and compared the results against the in vivo loading measur…

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages