Skip to main content

Light Beads Microscopy Pipeline using CaImAn

Project description

LBM-CaImAn-Python

Installation | Notebooks

Documentation

Python implementation of the Light Beads Microscopy (LBM) computational pipeline. The documentation has examples of the rendered notebooks.

For the MATLAB implementation, see here

Pipeline Steps:

  1. Image Assembly
    • Extract raw tiffs to planar timeseries
  2. Motion Correction
    • Rigid/Non-rigid registration
  3. Segmentation
    • Iterative CNMF segmentation
    • Deconvolution
    • Refine neuron selection
  4. Collation
    • Collate images and metadata into a single volume
    • Lateral offset correction (between z-planes. WIP)

Requirements

  • caiman
  • numpy
  • scipy
  • fastplotlib

:exclamation: Note: This package makes heavy use of fastplotlib for visualizations.

fastplotlib runs on Jupyter Lab, but is not guarenteed to work with Jupyter Notebook or Visual Studio Code notebook environments.

Installation

Install pixi (pip install pixi or see https://pixi.sh for other methods), then:

git clone https://github.com/MillerBrainObservatory/LBM-CaImAn-Python.git
cd LBM-CaImAn-Python
pixi install
pixi run setup-caiman

This installs CaImAn from conda-forge along with all dependencies and the project itself in editable mode.

To verify:

pixi run python -c "import lbm_caiman_python as lcp; print(lcp.__version__)"

:exclamation: Hardware requirements The large CNMF visualizations with contours etc. usually require either a dedicated GPU or integrated GPU with access to at least 1GB of VRAM.


Troubleshooting

Error during pip install: OSError: [Errno 2] No such file or directory

If you recieve an error during pip installation with the hint:

HINT: This error might have occurred since this system does not have Windows Long Path support enabled. You can find
 information on how to enable this at https://pip.pypa.io/warnings/enable-long-paths

In Windows Powershell, as Administrator:

New-ItemProperty -Path "HKLM:\SYSTEM\CurrentControlSet\Control\FileSystem" -Name "LongPathsEnabled" -Value 1 -PropertyType DWORD -Force

Or:

  • Open Group Policy Editor (Press Windows Key and type gpedit.msc and hit Enter key.

  • Navigate to the following directory:

Local Computer Policy > Computer Configuration > Administrative Templates > System > Filesystem > NTFS.

  • Click Enable NTFS long paths option and enable it.

Conda Slow / Stalling

if conda is behaving slow, clean the conda installation and update conda-forge:

conda clean -a

conda update -c conda-forge --all

virtualenv Troubleshooting

Error During pip install . (CaImAn) on Linux

If you encounter errors during the installation of CaImAn, install the necessary development tools:

sudo apt-get install python3-dev

Don't forget to press enter a few times if conda is taking a long time.

Recommended Conda Distribution

The recommended conda installer is

This is a community-driven conda/mamba installer with pre-configured packages specific to conda-forge.

This helps avoid conda-channel conflicts and avoids any issues with the Anaconda TOS.

You can install the installer from a unix command line:

curl -L -O "https://github.com/conda-forge/miniforge/releases/latest/download/Miniforge3-$(uname)-$(uname -m).sh"
bash Miniforge3-$(uname)-$(uname -m).sh

Or download the installer for your operating system here.

Graphics Driver Issues

If you are attempting to use fastplotlib and receive errors about graphics drivers, see the fastplotlib driver 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_caiman_python-1.2.1.tar.gz (48.2 kB view details)

Uploaded Source

Built Distribution

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

lbm_caiman_python-1.2.1-py3-none-any.whl (50.9 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: lbm_caiman_python-1.2.1.tar.gz
  • Upload date:
  • Size: 48.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.9.2

File hashes

Hashes for lbm_caiman_python-1.2.1.tar.gz
Algorithm Hash digest
SHA256 8fab1c1f525b108340d5e535d1cdb03c83cce3bdeb8a0e5c7ab86b196af34f26
MD5 cdbae999fa5010e67286c3ca22fb5e65
BLAKE2b-256 ee5467717de107cfe9d34ec1757384177640a6ff4ec1ee77604d8ffd252047c3

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for lbm_caiman_python-1.2.1-py3-none-any.whl
Algorithm Hash digest
SHA256 008e7b524fe3e060dca10f1b6761138639070773e88b79ceb8104b6cac6ba0fc
MD5 44b63480a281fdf732a8ade65470e42c
BLAKE2b-256 e7522850ecbc587a89330732e495f4a2c64992b082864c7ad1f80163388bcd76

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