https://github.com/cvjena/electromyogram

This is a small python package to create a Electromyogram (EMG) plots for facial muscles.

https://github.com/cvjena/electromyogram

Science Score: 23.0%

This score indicates how likely this project is to be science-related based on various indicators:

  • CITATION.cff file
  • codemeta.json file
  • .zenodo.json file
  • DOI references
    Found 4 DOI reference(s) in README
  • Academic publication links
    Links to: pubmed.ncbi, ncbi.nlm.nih.gov, wiley.com
  • Academic email domains
  • Institutional organization owner
  • JOSS paper metadata
  • Scientific vocabulary similarity
    Low similarity (14.6%) to scientific vocabulary
Last synced: 9 months ago · JSON representation

Repository

This is a small python package to create a Electromyogram (EMG) plots for facial muscles.

Basic Info
  • Host: GitHub
  • Owner: cvjena
  • License: mit
  • Language: Python
  • Default Branch: main
  • Size: 14.9 MB
Statistics
  • Stars: 3
  • Watchers: 2
  • Forks: 1
  • Open Issues: 0
  • Releases: 5
Created almost 3 years ago · Last pushed over 2 years ago
Metadata Files
Readme Changelog Contributing License Authors

README.md

electromyogram

Teaser

This Python package provides a convenient way to create an Electromyogram (EMG) Intensity plot specifically designed for facial muscles with facial structure. With this tool, you can visualize and analyze the intensity of EMG data collected from various facial muscles.

A small demo is hosted here, together with the tool face-projection for a projection onto the face.

Why use sEMG Intensity Plot?

  • Easy to use: The package provides a straightforward interface, making it accessible for users of all levels of expertise.
  • Visualize muscle activity: The EMG Intensity plot allows you to visualize the intensity of muscle activity over the face, providing insights into patterns and variations.
  • Designed explicitly for facial muscles: The tool focuses on facial muscles, enabling you to study and understand muscle activity in the face, which can be particularly useful in fields like facial expression analysis, neuroscience, and rehabilitation.
  • FACS: Visualize the Facial Action Coding System at the correct anatomical locations for a more intuitive understanding of the data.
  • Blend Shapes: Many existing blend shape models base their movements on the FACS. We provide a location mapping for commonly used blend shapes models and where they are located on the face to the AU muscle.
  • Potential for extension: While the current focus is on facial muscles, this tool could potentially be extended to analyze other muscle groups.
  • Beyond muscles: The tool can also be used to plot additional facial information, such as oxygen saturation, but this is not officially supported yet.

Installation

The package is available on PyPI and can be installed with pip:

bash pip install electromyogram

If you want to install it locally to add changes, please close the repository and install it with pip in development mode. We assume you already created a virtual environment and activated it :)

bash git clone <link to this repository> cd electromyogram pip install -e .

Quickstart

This tool is intended to simplify the creation of only the spatial intensity map for surface EMG data. All the required preprocessing of the data is not part of this package and is likely project-specific. We assume that the data is given in a dictionary (or pandas table) and the keys are the sensor locations.

Then, the correct physical interpolation between the sensors is done, and the result is a 2D array of the interpolated values on the canonical face model. You can then apply different color maps to the interpolation to create the final plot. We provide detailed examples in examples/.

```python import electromyogram as emg

we assume that the data is given in a dictionary and the keys are the sensor locations

data_values = dict(...)

scheme = emg.Fridlund() # or emg.Kuramoto()

create the interpolation

powermap = emg.interpolate(scheme, data_values, shape=(1024, 1024)) powermap = emg.colorize(powermap, cmap='viridis') ```

For the colorization, the users can use any color map from matplotlib or pallettable (e.g., pallettable.scientific.sequential.Imola_20) Colors

Surface EMG Schematics

We currently support the two following schematics for acquiring the EMG data. If you want to have your own, please open an issue or create a pull request, and we will be happy to add it.

| Fridlund and Cappacio, 1986 | Kuramoto et al., 2019| | :---: | :---: | | Locations | Locations | | Ekman and Friesen - FACS| Mediapipe Blendshapes| | Locations | Locations |

If you want to define your custom scheme, create a new class inherited from emg.Schematic and implement the locations member. If you support the mirroring of the face, implement the pairs_L and pairs_R members. Then, use it in the interpolate function, and you are good to go.

Todos

  • [X] Handle if not all values are given for a better schematic
  • [X] Add result images
  • [X] Add a function to draw triangulation onto the 2D canvas
  • [X] Add a function to draw sensor locations onto the 2D canvas
  • [X] Add the option to remove the area outside the canonical face model
  • [X] Make a better interface for the channel names (mapping to defined terms)
  • [ ] Add function to create the according colorbar for matplotlib in the correct size

License

MIT License

Citation

If you use our work, please cite us:

Büchner, T., Sickert, S., Graßme, R., Anders, C., Guntinas-Lichius, O., Denzler, J. (2023). Using 2D and 3D Face Representations to Generate Comprehensive Facial Electromyography Intensity Maps. In: Bebis, G., et al. Advances in Visual Computing. ISVC 2023. Lecture Notes in Computer Science, vol 14362. Springer, Cham. https://doi.org/10.1007/978-3-031-47966-3_11

or as bib entry ```bibtex @InProceedings{10.1007/978-3-031-47966-3_11, author="B{\"u}chner, Tim and Sickert, Sven and Gra{\ss}me, Roland and Anders, Christoph and Guntinas-Lichius, Orlando and Denzler, Joachim", title="Using 2D and 3D Face Representations to Generate Comprehensive Facial Electromyography Intensity Maps", booktitle="Advances in Visual Computing", year="2023", publisher="Springer Nature Switzerland", address="Cham", pages="136--147", isbn="978-3-031-47966-3" }

```

Owner

  • Name: Computer Vision Group Jena
  • Login: cvjena
  • Kind: organization
  • Location: Jena

GitHub Events

Total
  • Watch event: 2
  • Fork event: 1
Last Year
  • Watch event: 2
  • Fork event: 1

Packages

  • Total packages: 1
  • Total downloads:
    • pypi 11 last-month
  • Total dependent packages: 0
  • Total dependent repositories: 0
  • Total versions: 5
  • Total maintainers: 1
pypi.org: electromyogram

This is a small python package to create a Electromyogram (EMG) Intensity plots for facial muscles with facial structure.

  • Versions: 5
  • Dependent Packages: 0
  • Dependent Repositories: 0
  • Downloads: 11 Last month
Rankings
Dependent packages count: 7.4%
Average: 38.0%
Dependent repos count: 68.7%
Maintainers (1)
Last synced: 10 months ago

Dependencies

docs/requirements.txt pypi
  • recommonmark *
  • sphinx >=3.2.1
pyproject.toml pypi
requirements-dev.txt pypi
  • gradio * development
  • jupyter * development
  • matplotlib * development
requirements.txt pypi
  • matplotlib >=3.5,<4
  • numpy >=1.23,<2
  • opencv-python-headless >=4.5,<5
  • palettable >3.3
  • scipy >=1.8,<2
setup.py pypi
.github/workflows/python-publish.yml actions
  • actions/checkout v3 composite
  • actions/setup-python v3 composite
  • pypa/gh-action-pypi-publish 27b31702a0e7fc50959f5ad993c78deac1bdfc29 composite