Pyomeca is a python library allowing you to carry out a complete biomechanical analysis; in a simple, logical and concise way.
Continuous integration (Linux) | |
Continuous integration (Windows) | |
Code coverage | |
Code quality | |
Last release | |
Installation |
See pyomeca's documentation site (under construction and not usable yet), as well as pyomeca's tutorial notebooks.
Here is an example of a complete EMG pipeline in just one command:
from pyomeca import Analogs3d
emg = (
Analogs3d.from_c3d("path/to/your/c3d.c3d", names=['anterior_deltoid', 'biceps'])
.band_pass(freq=2000, order=4, cutoff=[10, 425])
.center()
.rectify()
.low_pass(freq=2000, order=4, cutoff=5)
.normalization()
.time_normalization()
)
-
Object-oriented architecture where each class is associated with common and specialized functionalities:
- Markers3d: 3d markers positions
- Analogs3d: analogs (emg, force or any analog signal)
- GeneralizedCoordinate: generalized coordinate (joint angle)
- RotoTrans: roto-translation matrix
-
Specialized functionalities include signal processing routine commonly used in biomechanics: filters, normalization, onset detection, outliers detection, derivative, etc.
-
Each functionality can be chained. In addition to making it easier to write and read code, it allows you to add and remove analysis steps easily (such as Lego blocks).
-
Each class inherits from a numpy array, so you can create your own analysis step easily.
-
Easy reading and writing interface to common files in biomechanics:
- c3d (binary file used in biomechanics):
from_c3d
andto_c3d
- csv:
from_csv
andto_csv
- mat (MATLAB file):
from_mat
andto_mat
- sto (OpenSim storage file):
to_sto
(must install pyosim) - trc (OpenSim markers position file):
to_trc
(must install pyosim)
- c3d (binary file used in biomechanics):
-
Common linear algebra routine implemented: get Euler angles to/from roto-translation matrix, create a system of axes, set a rotation or translation, transpose or inverse, etc.
First, install miniconda or anaconda. Then type:
conda install pyomeca -c conda-forge
First, you need to install python, swig and numpy.
Then, follow the instructions to compile ezc3d.
Finally, install pyomeca with pip install git+https://github.com/pyomeca/pyomeca/
.
Pyomeca is designed to work well with other libraries that we have developed:
- pyosim: interface between OpenSim and pyomeca to perform batch musculoskeletal analyses
- ezc3d: Easy to use C3D reader/writer in C++, Python and Matlab
- biorbd: C++ interface and add-ons to the Rigid Body Dynamics Library, with Python and Matlab binders.
- pyoviz: pyomeca visualization toolkit and GUIs (still in development and not usable yet)
Pyomeca is Apache-licensed and the source code is available on GitHub.
If any questions or issues come up as you use pyomeca, please get in touch via GitHub issues.
We welcome any input, feedback, bug reports, and contributions.