Skip to main content

Light Beads Microscopy 2P Calcium Imaging Pipeline.

Project description

LBM-CaImAn-Python

Installation | Notebooks

Python implementation of the Light Beads Microscopy (LBM) computational pipeline.

For the MATLAB implementation, see here

Installation

Installation requires an active conda installation.

Note: Sometimes conda or mamba will get stuck at a step, such as creating an environment or installing a package. Pressing Enter on your keyboard can sometimes help it continue when it pauses.

  1. Install mamba into your base environment:

:exclamation: This step may take 10 minutes and display several messages like "Solving environment: failed with..." but it should eventually install mamba.

conda activate base 
conda install -c conda-forge mamba
  1. Create a new environment and install mesmerize-core
  • Here, we use the -n flag to name the environment lbm , but you can name it whatever you'd like.
  • This step will install Python, mesmerize-core, CaImAn, and all required dependencies for those packages.
conda create -n lbm -c conda-forge mesmerize-core

If you already have CaImAn installed:

conda install -n name-of-env-with-caiman mesmerize-core

Activate the environment and install caimanmanager:

  • if you used a name other than lbm, be sure to match the name you use here.
conda activate lbm
caimanmanager install
  1. Install LBM-CaImAn-Python from pip:

Install the minimal lbm_caiman_python:

pip install lbm_caiman_python
  1. Install scanreader:
pip install git+https://github.com/atlab/scanreader.git
  1. (Optional) Install mesmerize-viz:

Several notebooks make use of mesmerize-viz for visualizing registration/segmentation results.

pip install https://github.com/kushalkolar/mesmerize-viz.git

:exclamation: Harware 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.

https://www.youtube.com/watch?v=GWvaEeqA1hw

For Developers

To get the newest version of this package:

git clone https://github.com/MillerBrainObservatory/LBM-CaImAn-Python.git

cd LBM-CaImAn-Python

pip install ".[docs]"

Troubleshooting

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

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

Recommended Conda Distribution

The recommended conda installer is miniforge.

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.

Pipeline Steps:

  1. Motion Correction
    • Template creation
    • Rigid registration
    • Piecewise-rigid registration
  2. Segmentation
    • Iterative CNMF segmentation
    • Deconvolution
    • Refinement
  3. Collation
    • Lateral offset correction (between z-planes)
    • Collate images and metadata into a single volume

Requirements

  • caiman
  • mesmerize-core
  • numpy
  • scipy

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.0.1.tar.gz (14.3 MB view details)

Uploaded Source

Built Distribution

lbm_caiman_python-1.0.1-py3-none-any.whl (27.3 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: lbm_caiman_python-1.0.1.tar.gz
  • Upload date:
  • Size: 14.3 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.10.15

File hashes

Hashes for lbm_caiman_python-1.0.1.tar.gz
Algorithm Hash digest
SHA256 114c08c752a944fd155c5ad022f18e41cf469522c66b9a0a3880e6af783feb35
MD5 2f28ef90f8e7e682473b89803e989c8c
BLAKE2b-256 ac140ae390b4be8ffd772be3e7e8c14dfabe786d07ec1ff444819c1dc9eb4a0e

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for lbm_caiman_python-1.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 893fe607ca1c70a3cd8ce9c4f26e904edf30d6d666dc4fa7fde8fab5d7b60c8d
MD5 961f86a7522263b7660241c9fa281ae8
BLAKE2b-256 bf75078636c17e1cc98410dc045202840f86d5991a646fb8ec79afdb48fcbbb2

See more details on using hashes here.

Supported by

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