Skip to main content

LabGrymace

LabGrymace (LabGym + grimace) is an open-source tool for quantifying pain-related facial expressions in freely moving mice.

  • Objective and reproducible — Facial grimace is a widely used indicator of pain in mice, but manual scoring is labor-intensive and subjective. LabGrymace automatically quantifies pain-related facial movements from the tracking output generated by LabGym.
  • A biologically calibrated pain score — Ear, eye, and nose movements are integrated into a single pain score that is continuous over time and calibrated to biological reference points, which enables quantitative comparisons across animals and experiments.
  • Easy to use — A point-and-click GUI generates summary spreadsheets, computes pain scores, and produces annotated videos with the score displayed on every frame. No programming required.

This repository contains two parts:

  • LabGrymace, the graphical application for pain-score computation and visualization.
  • LabGym_LabGrymace, a modified version of LabGym 2.9.0, which performs facial region tracking and generates the input files used by LabGrymace.

LabGrymace Outputs:

1. Annotated video

An .mp4 copy of the original recording with the continuously updated pain score overlaid on each frame, allowing direct comparison between the quantified pain score and the animal's behavior.

Below is an example comparing a recording with a high pain score and one with a low pain score:

Chemically induced pain Baseline
High-CNO overlay Baseline overlay

2. Summary spreadsheets

Three Excel files (ear_summary.xlsx, eye_summary.xlsx, nose_summary.xlsx) containing frame-by-frame measurements for each facial region. Frames removed by the mirror-reflection filter are highlighted in orange, and the merged measurements used for pain-score calculation are highlighted in yellow.

Summary spreadsheet

3. Pain score analysis

The analysis includes:

  • pain_scores.xlsx — one row per 100 s window, plus a Summary sheet with each recording's overall score.
  • pain_scores_per_frame.xlsx — a pain score for every frame.
  • pain_score_chart.png — a dot plot of the batch, one point per recording.

Pain score


Usage

LabGrymace GUI

The LabGrymace workflow consists of two steps:

  1. Generate summary files — Select the folder containing the LabGym output. LabGrymace generates ear_summary.xlsx, eye_summary.xlsx, and nose_summary.xlsx files for each recording.
  2. Compute pain scores — Select the folders containing the summary files. LabGrymace generates pain_scores.xlsx, pain_scores_per_frame.xlsx, pain_score_chart.png, and (optionally) an annotated video with pain score overlaid on each frame.

The reflection filter is disabled by default and can be enabled with a checkbox during step 2. The figures in the accompanying manuscript were generated with this filter enabled, and the reproduction scripts set it automatically.


Documentation


Licensing

LabGrymace is available under a dual-licensing model.

Open-source license

This repository is licensed under the GNU General Public License v3.0 (GPL-3.0). See LICENSE for details.

This repository includes a modified version of LabGym (Ye Lab, University of Michigan), which is licensed under GPL-3.0. The original attribution and license are preserved in LabGym_LabGrymace/LICENSE.txt.

Commercial licensing

Commercial licenses are available from Behaviora LLC for organizations that wish to use LabGrymace under terms different from the GPL-3.0 license, including proprietary commercial applications, redistribution, enterprise deployment, and commercial support.

For commercial licensing or support inquiries, please contact: contact@labgym.org


Citing LabGrymace

If you use LabGrymace in publications, please cite LabGrymace, LabGym1, and LabGym2.

Installation

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

labgrymace-1.0.0.tar.gz (77.9 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

labgrymace-1.0.0-py3-none-any.whl (77.8 kB view details)

Uploaded Python 3

File details

Details for the file labgrymace-1.0.0.tar.gz.

File metadata

  • Download URL: labgrymace-1.0.0.tar.gz
  • Upload date:
  • Size: 77.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/7.0.0 CPython/3.10.20

File hashes

Hashes for labgrymace-1.0.0.tar.gz
Algorithm Hash digest
SHA256 fd0912a2cd955dd0f70e85eeeb9cc5e6e919723f16fb3449869d962d7da80d15
MD5 49a5ce760773dea2fd5d940464d829fd
BLAKE2b-256 da94bad259a0e785d8ba0d14e436687e3400a42e331c0d0b544c768ea7fb6b48

See more details on using hashes here.

File details

Details for the file labgrymace-1.0.0-py3-none-any.whl.

File metadata

  • Download URL: labgrymace-1.0.0-py3-none-any.whl
  • Upload date:
  • Size: 77.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/7.0.0 CPython/3.10.20

File hashes

Hashes for labgrymace-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 26a8f5f452cc9dc4b5967a938531a6be10c1d3d49afdf11ea39a263c4a4275da
MD5 dbfdb33297841a80f347b87c64e9dc32
BLAKE2b-256 a90ef5de7e202162bbe7083f91e8f4391ba51a469dba37d623f6aa26a3bfb765

See more details on using hashes here.

Release history Release notifications | RSS feed

This release

1.0.0 This release

2 files

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page