Skip to main content

Light Beads Microscopy Pipeline using Suite2p

Project description

LBM-Suite2p-Python

Status: Late-beta stage of development

Documentation

PyPI - Version DOI

A volumetric 2-photon calcium imaging processing pipeline for Light Beads Microscopy (LBM) datasets, built on Suite2p.

A GUI is available via mbo_utilities (GUI functionality will lag behind this pipeline).

Installation

LBM-Suite2p-Python is a pure pip install. You can use venv, uv (recommended), or conda. Just remove the uv prefix.

# create a new project folder
mkdir my_project
cd my_project

# (uv only) create environment and install
uv venv --python 3.12.9
uv pip install lbm_suite2p_python

Optional Dependencies

# With rastermap for activity clustering visualization
uv pip install "lbm_suite2p_python[rastermap]"

# With cellpose for anatomical cell detection (includes PyTorch)
uv pip install "lbm_suite2p_python[cellpose]"

# All optional dependencies
uv pip install "lbm_suite2p_python[all]"

Development Installation

While this pipeline is in active development, you can keep a local copy to quickly pull changes:

git clone https://github.com/MillerBrainObservatory/LBM-Suite2p-Python.git
cd LBM-Suite2p-Python
uv pip install .

GUI Dependencies

Linux / macOS:

sudo apt install libxcursor-dev libgl1-mesa-dev libglu1-mesa-dev freeglut3-dev

Windows: Install Microsoft Visual C++ Redistributable

Troubleshooting

When installing from github, you may get:

Git LFS Error: If you see smudge filter lfs failed:

GIT_LFS_SKIP_SMUDGE=1 uv sync --all-extras --active

Quick Start

import lbm_suite2p_python as lsp

results = lsp.pipeline(
    input_data="D:/data/raw",   # path to file, directory, or list of files
    save_path=None,             # default: save next to input
    ops=None,                   # default: use MBO-optimized parameters
    planes=None,                # default: process all planes
    roi=None,                   # default: stitch multi-ROI data
    keep_reg=True,              # default: keep data.bin (registered binary)
    keep_raw=False,             # default: delete data_raw.bin after processing
    force_reg=False,            # default: skip if already registered
    force_detect=False,         # default: skip if stat.npy exists
    dff_window_size=None,       # default: auto-calculate from tau and framerate
    dff_percentile=20,          # default: 20th percentile for baseline
    dff_smooth_window=None,     # default: auto-calculate from tau and framerate
)

Planar Results

Each z-plane produces diagnostic images automatically saved during processing.

Segmentation Summary
Segmentation overlays on reference images

Quality Diagnostics
ROI quality metrics: size, SNR, compactness

ΔF/F Traces
ΔF/F traces sorted by quality

Volumetric Results

Volume-level visualizations combine data across all z-planes.

All Planes Masks
ROI masks across all z-planes

3D ROI Map
3D ROI centroids colored by SNR

Rastermap
Activity sorted by similarity (Rastermap)

Built With

This pipeline integrates several open-source tools:

Issues & Support

Contributing

Contributions are welcome! This project follows Suite2p's conventions and uses:

  • Ruff for linting and formatting (line length: 88, numpy docstring style)
  • pytest for testing
  • Sphinx for documentation

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

lbm_suite2p_python-2.3.1.tar.gz (92.4 kB view details)

Uploaded Source

Built Distribution

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

lbm_suite2p_python-2.3.1-py3-none-any.whl (88.6 kB view details)

Uploaded Python 3

File details

Details for the file lbm_suite2p_python-2.3.1.tar.gz.

File metadata

  • Download URL: lbm_suite2p_python-2.3.1.tar.gz
  • Upload date:
  • Size: 92.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.9.5

File hashes

Hashes for lbm_suite2p_python-2.3.1.tar.gz
Algorithm Hash digest
SHA256 0e7430e54a57fb435375b4b9052ecf04ccdf0f92624c535a2f0e346be70a2b0e
MD5 a94b02f853eced18ccef5ab332d468ba
BLAKE2b-256 24eaa2c18a6294ac8d42cfd56f560e06a33706e3ff5c5233993548096dfedc53

See more details on using hashes here.

File details

Details for the file lbm_suite2p_python-2.3.1-py3-none-any.whl.

File metadata

File hashes

Hashes for lbm_suite2p_python-2.3.1-py3-none-any.whl
Algorithm Hash digest
SHA256 cef3a690b246f7f08b3eab80cc2b179c6860a109589608be7de0d7fe642a137f
MD5 93da365faab33187d572d978834a972c
BLAKE2b-256 4cb61c52471a8898e12980297121625b4368fe8230f0f9df6544cd314d3e6a33

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