Skip to main content

Fully automated tracking of single rows of whiskers in high-speed video.

Project description

Janelia Whisker Tracking

Fully automated tracking of single rows of whiskers in high-speed video.

The original source code repository is https://github.com/nclack/whisk/. The original website for this program is now accessible here. A copy of the instructions and the tutorial are available here.

This package has been modernized with updated build systems, Python packaging standards (PEP 517/518), and improved compatibility.

Installation

From PyPI (Recommended)

This package can be installed from PyPI with:

pip install whisk-janelia

For the latest features with FFmpeg support:

pip install whisk-janelia[ffmpeg]

It is recommended to use a virtual environment:

Using venv:

python -m venv venv
source venv/bin/activate  # On Windows: venv\Scripts\activate
pip install whisk-janelia

Using uv (faster):

uv venv
source .venv/bin/activate  # On Windows: .venv\Scripts\activate
uv pip install whisk-janelia

From Source

To install from source, clone the repository and run the following commands:

git clone https://github.com/vncntprvst/whisk.git
cd whisk

# Create and activate virtual environment
uv venv  # or: python -m venv venv
source .venv/bin/activate  # On Windows: .venv\Scripts\activate

# Install in development mode
uv pip install -e .  # or: pip install -e .

Post-Installation

After installation, the whisk executables will be available as command-line tools:

  • trace - Main whisker tracing executable
  • classify - Whisker classification
  • measure - Whisker measurements
  • whisker_convert - Convert between whisker file formats
  • And more...

The Python package automatically handles binary permissions and PATH setup. You can verify the installation by running:

trace --help

The executables are also accessible through the whisk Python module for programmatic use.

Building from Source

For development or custom builds, you can build from source using modern Python packaging tools.

Prerequisites

  • CMake 2.8+
  • C++ compiler (gcc 12.2+ recommended)
  • FFmpeg libraries
  • Python 3.7+

Quick Build

# Clone and navigate to the repository
git clone https://github.com/vncntprvst/whisk.git
cd whisk

# Build using modern Python tools
uv build  # or: python -m build

# Install the built wheel
pip install dist/*.whl

Development Build

For development, you can build and install in editable mode:

# Create virtual environment
uv venv  # or: python -m venv venv
source .venv/bin/activate

# Install in development mode
uv pip install -e .  # or: pip install -e .

Manual CMake Build

The package uses a CMake-based build system for the underlying C/C++ libraries:

For Unix-like systems (Linux/macOS):

  1. Install build dependencies:
sudo apt update
sudo apt install cmake pkg-config bison gawk
sudo apt install g++ gdb make ninja-build rsync zip
  1. Install FFmpeg development libraries:
sudo apt install libavdevice-dev libavfilter-dev libavformat-dev libavcodec-dev libswresample-dev libswscale-dev libavutil-dev
  1. Build the project:
mkdir build
cd build
cmake ..
make

For WSL systems, see: Build and debug C++ with WSL 2

FFmpeg Troubleshooting

If CMake cannot find FFmpeg libraries, you may need to:

  1. Set the PKG_CONFIG_PATH: export PKG_CONFIG_PATH=/usr/local/lib/pkgconfig:$PKG_CONFIG_PATH
  2. Update library path: export LD_LIBRARY_PATH=/usr/local/lib:$LD_LIBRARY_PATH
  3. Run sudo ldconfig to update the dynamic linker cache

Windows Build Instructions:

For Windows systems using MSYS2/MinGW:

  1. Install MSYS2 and set up the development environment
  2. Install required packages in MSYS2 terminal:
pacman -S mingw-w64-ucrt-x86_64-gcc
pacman -S --needed base-devel mingw-w64-x86_64-toolchain
pacman -S mingw-w64-x86_64-cmake mingw-w64-x86_64-ffmpeg
  1. Build the project:
mkdir build
cd build
cmake ..
ninja

For detailed Windows setup instructions, see the full documentation.

File formats

Whiskers

Whiskers can be stored in either a text or binary format. There is a command line utility, whisker_convert, provided to convert between different supported formats. batch.py can be used to speed up the process of converting many files.

The most detailed description of each format can be found in the corresponding whisker_io_*.c files implimenting the readers/writers for each format.

In general, each whisker segment in a file is comprised of a unique id and a number of data points describing the shape as output from the tracing program.

Measurements

The measurements file stores the features of traced curves used for classification, such as follicle position, angle and whisker length. Additionally, after classification, this file records the determined identity of each traced curve.

Graphical interface

See ui/README for instructions on how to use the graphical user interface.

  ui2.py --help

Community

Chat

Issue Tracker

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

whisk_janelia-1.2.1.tar.gz (21.3 MB view details)

Uploaded Source

Built Distribution

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

whisk_janelia-1.2.1-py3-none-any.whl (21.6 MB view details)

Uploaded Python 3

File details

Details for the file whisk_janelia-1.2.1.tar.gz.

File metadata

  • Download URL: whisk_janelia-1.2.1.tar.gz
  • Upload date:
  • Size: 21.3 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.10.12

File hashes

Hashes for whisk_janelia-1.2.1.tar.gz
Algorithm Hash digest
SHA256 e5844aefb6f68e264d73a8d089ab02d22f32fd788d0d2e5c8834e229a71b85d1
MD5 c00c060ae42916e0ae83ada2a81a64e0
BLAKE2b-256 847e2df36d8becf919d69ff951aca01fc1f72c34906b813b97392f3d17ff217e

See more details on using hashes here.

File details

Details for the file whisk_janelia-1.2.1-py3-none-any.whl.

File metadata

  • Download URL: whisk_janelia-1.2.1-py3-none-any.whl
  • Upload date:
  • Size: 21.6 MB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.10.12

File hashes

Hashes for whisk_janelia-1.2.1-py3-none-any.whl
Algorithm Hash digest
SHA256 6b7ee1d51c6f9c13f6aaf335e088244508b38872982080aa7833ea29be522e20
MD5 a2b343f9e5573047d256941c2e8a5c71
BLAKE2b-256 007cb85fadeaa4a88e6a79d6c75086216ef20abe6648e19d2c6a2afe4e9436db

See more details on using hashes here.

Supported by

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