This is a small python package to create a Electromyogram (EMG) Intensity plots for facial muscles with facial structure.
Project description
electromyogram
This is a small python package to create a Electromyogram (EMG) Intensity plots for facial muscles with facial structure. The current focus is on the solely facial muscles but it could be extended to other muscles, but this is not planned yet.
We currently support the two following schematics for acquiring the EMG data:
- Fridlund and Cappacio () []
- Kuramoto et al. () []
Installation
Currently the package is not available on PyPI. Thus, you have to install it from the source code. If you want to use the package in a virtual environment, you have to activate it first. Clone this repository and install it with pip:
git clone <link to this repository>
cd electromyogram
pip install .
It is then available in your python environment, and you can import it with:
import electromyogram
Usage
We predefined the two schematics (Fridlund and Cappacio and Kuramoto et al.) on a 2D canvas. This canvas is based on the canonical face model used by Google in several of their projects (dominantly in mediapipe). All EMG sensor coordinates are given relatively to this canvas thus arbitrary canvas scaling is possible. We default to a canvas size of 4096x4096 pixels.
The current process for electromyogram visualization is based on a 2 step method. First, we create the interpolation of the given EMG values on a 2D canvas for the chosen schematic. Second, we allow the application of different color maps to the interpolation to create the final plot.
Example 1: Fridlund and Cappacio
Our first example is based on the Fridlund and Cappacio schematic. We assume that the data is given in a dictionary and the keys are the sensor locations. Note: We only support a subset of the sensors in the Fridlund and Cappacio schematic. (TODO add list of supported sensors)
The following locations are expected and then interpolated:
import electromyogram as emg
# we assume that the data is given in a dictionary and the keys are the sensor locations
data_values = dict(...)
# create the interpolation
interpo = emg.interpolate(emg.Fridlund, data_values)
myogram = emg.colorize(interpo, cmap='viridis')
Example 2: Kuramoto et al.
Our second example is based on the Kuramoto et al. schematic. We assume that the data is given in a dictionary and the keys are the sensor locations. Note: We only support a subset of the sensors in the Kuramoto et al. schematic. (TODO add list of supported sensors)
The following locations are expected and then interpolated:
import electromyogram as emg
# we assume that the data is given in a dictionary and the keys are the sensor locations
data_values = dict(...)
# create the interpolation
interpo = emg.interpolate(emg.Kuramoto, data_values)
myogram = emg.colorize(interpo, cmap='viridis')
Todos
- Handle if not all values are given for a schematic better
- Add result images
License
References
Acknowledgements
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file electromyogram-1.0.3.tar.gz.
File metadata
- Download URL: electromyogram-1.0.3.tar.gz
- Upload date:
- Size: 42.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.8.15
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
aa64ed9ec17a1637b9ddf84903a9a716c9257705e39f36efa9047da85239036f
|
|
| MD5 |
c5cca6175c91d42fc1592b795201d970
|
|
| BLAKE2b-256 |
8a45ef1ba3c977e21f3fb7ec86bb8e48586f243d8fb673c2617ba295c67fed8f
|
File details
Details for the file electromyogram-1.0.3-py3-none-any.whl.
File metadata
- Download URL: electromyogram-1.0.3-py3-none-any.whl
- Upload date:
- Size: 14.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.8.15
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
1480b18fc2f1276e3cd6fae457341c787e6b0b16723f6142de6506ae47640660
|
|
| MD5 |
af5cc9471fd4998ece522ddd196602c8
|
|
| BLAKE2b-256 |
0e85db6a69081a32752e5b5536f097d0a40eb9f296a98391778ee6cd46cf6a2f
|