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.0.tar.gz (83.1 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.0-py3-none-any.whl (79.3 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for lbm_suite2p_python-2.3.0.tar.gz
Algorithm Hash digest
SHA256 e5970f4464ffb448257b4bd2c4217aac3432e9399ef225a04163ff3f06bc0378
MD5 5792ac7226c1f090857c2b4c8fa7e6b7
BLAKE2b-256 c3cc27c20906d24ba102f58b42444f726d862fd4b3023d953da774318c00525d

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for lbm_suite2p_python-2.3.0-py3-none-any.whl
Algorithm Hash digest
SHA256 ee4fe854d4c929b569bae7a4e7a738c0c4338e1b7aa40b87debd7ae66ea30cac
MD5 0da39a4be50ce78264e0d374e3229346
BLAKE2b-256 bd2d4415b2cb7a1c66b5a7badd0257fbcddd0451a4cc7fe231e758656b27d7cc

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