Fully automated (rodent) limb motion analysis toolbox for behavioral analysis with bodypart coordinate data, building upon markerless pose estimation.
Automated Limb Motion Analysis (ALMA) v2.0
What is new in ALMA v2.0?
- Modern UI/UX: Redesigned interface with card-based layouts, step-by-step wizards, and improved visual feedback
- Interactive timeline: Pyqtgraph-based interactive timeline for footfall detection, with zoom, pan, and click-to-jump functionality
- Configurable drag detection: Adjustable sensitivity for drag detection via consecutive frame threshold
- Auto-load FPS from video: Instantly load FPS from video files via both GUI and CLI—no manual entry required
- Camera-independent spatial calibration: Uses body segments for robust analysis, insensitive to camera distance
- Robust bodypart alias detection: Automatically resolves aliases (e.g., toe/toeR/toeL, crest/iliac crest)
- Automatic walking direction detection: Walk direction detected automatically; treadmill correction applied as needed
- Improved variability metric: Removed FastDTW dependency—now faster and more compatible
- Demo data included: Try ALMA quickly with a provided demo video and matching DLC CSV file
Check out our paper:
Aljovic, A., Zhao, S. et al. A deep learning-based toolbox for Automated Limb Motion Analysis (ALMA) in murine models of neurological disorders. Commun Biol 5, 131 (2022). https://doi.org/10.1038/s42003-022-03077-6
A behavioral data analysis toolbox for motor research in rodents.
To get started
The program has been tested on Windows, Mac, and Linux systems with Python 3.10, and should function even on low-end laptops. However, at least 8 GB RAM is recommended. Performance will vary depending on your data size and hardware.
- Installation prerequisites:
- Download / clone this repository to your computer.
- Open a terminal and navigate to the folder.
cd Downloads/alma
- Create and activate the Conda environment (Python 3.10):
conda env create -f condaenvpython310.yml
conda activate venvpython3_10
- Launch ALMA:
python ./alma.py
Demo data
We provide a demo kinematic video and the corresponding DLC CSV in the repository so you can quickly try the full pipeline end‑to‑end.
Important: Data quality requirements
DeepLabCut labeling and recording setup
For accurate kinematic analysis, ensure:
- Side-view recording: Position your camera to capture a clear lateral (side) view of the animal, similar to the demo video. The recording should show:
- DeepLabCut labeling quality: ALMA's accuracy depends on DLC tracking quality:
- Supported bodypart naming: ALMA automatically detects common aliases:
toe, toeR, toeL, toer, toel
- Iliac crest: iliac crest, crest, crestR, iliacR
- Other bodyparts follow similar patterns (see paper for full list)
Understanding kinematic settings
ALMA v2.0 provides extensive control over analysis parameters. Here's what each setting does and why it matters:
Experimental setup
- Treadmill vs. Spontaneous: Choose based on your recording setup
Speed & calibration (Treadmill)
- Treadmill speed (cm/s): Belt speed of your treadmill
- Frame rate (fps): Video recording frame rate
Spatial calibration method
- Reference body segment (Recommended):
- Manual pixel-to-CM ratio:
Movement analysis settings
- Walking direction:
- Drag clearance threshold (cm):
- Drag detection sensitivity (frames):
- Lowpass filter cutoff (Hz):
Stride filtering (Optional)
- Step height range (cm): Filter out strides outside this range
- Stride length range (cm): Filter out strides outside this range
Why these parameters matter:
- They directly affect quantitative outputs (stride length, drag percentage, joint angles)
- Consistent settings are essential for comparing across animals/conditions
- Document all parameter values in your methods section for reproducibility
- The default values work well for adult mice on treadmills, but may need adjustment for:
Troubleshoot
PySide6 installation issues: If you encounter issues with PySide6 installation, try:
pip install --upgrade pip pip install pyside6
For Linux systems, you may need additional dependencies:
sudo apt-get install libxcb-xinerama0
In some cases (particularly some Linux distributions), you might need to install some libraries such as libsdl or libpng12. This problem can be identified by errors when starting the app, such as
: libSDL2-2.0.so.0: cannot open shared object file: No such file or directory). Try to solve the accordingly, e.g., sudo apt-get install libsdl2-2.0 and, sudo add-apt-repository ppa:linuxuprising/libpng12 sudo apt update sudo apt install libpng12-0
If you run into problem installing, please open an issue with the details (error traces) and your system specs (operating system, python version, ...) on Github, and we will get back to you.
For more information or support, please visit our wiki page or contact us.