Python implementation of the Light Beads Microscopy (LBM) computational pipeline. The documentation has examples of the rendered notebooks.
For the MATLAB implementation, see here
- Image Assembly
- Extract raw
tiffsto planar timeseries
- Extract raw
- Motion Correction
- Rigid/Non-rigid registration
- Segmentation
- Iterative CNMF segmentation
- Deconvolution
- Refine neuron selection
- Collation
- Collate images and metadata into a single volume
- Lateral offset correction (between z-planes. WIP)
- caiman
- numpy
- scipy
- fastplotlib
❗ 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.
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-caimanThis 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__)"❗ 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.
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.
if conda is behaving slow, clean the conda installation and update conda-forge:
conda clean -a
conda update -c conda-forge --all
If you encounter errors during the installation of CaImAn, install the necessary development tools:
sudo apt-get install python3-devDon't forget to press enter a few times if conda is taking a long time.
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).shOr download the installer for your operating system here.
If you are attempting to use fastplotlib and receive errors about graphics drivers, see the fastplotlib driver documentation.