Metadata-Version: 2.4
Name: mbo_utilities
Version: 2.0.0
Summary: Various utilities for the Miller Brain Observatory
License-Expression: BSD-3-Clause
Project-URL: Homepage, https://github.com/millerbrainobservatory/mbo_utilities
Project-URL: Documentation, https://millerbrainobservatory.github.io/mbo_utilities/index.html
Project-URL: Repository, https://github.com/millerbrainobservatory/mbo_utilities
Project-URL: Issues, https://github.com/MillerBrainObservatory/mbo_utilities/issues
Keywords: Microscopy,ScanImage,multiROI,Tiff
Requires-Python: <3.12.10,>=3.12.7
Description-Content-Type: text/markdown
License-File: LICENSE.md
Requires-Dist: numpy<2.0.0
Requires-Dist: tifffile>=2025.3.30
Requires-Dist: scikit-image
Requires-Dist: zarr>=3.1.3
Requires-Dist: dask>=2025.3.0
Requires-Dist: imageio[ffmpeg]
Requires-Dist: ffmpeg-python
Requires-Dist: matplotlib>=3.10.1
Requires-Dist: h5py
Requires-Dist: tqdm
Requires-Dist: jupyterlab==4.2.6
Requires-Dist: ipykernel
Requires-Dist: ipywidgets<9,>=8.0.0
Requires-Dist: icecream>=2.1.4
Requires-Dist: suite2p_mbo>=1.0.6
Requires-Dist: llvmlite==0.43.0
Requires-Dist: numba==0.60.0
Requires-Dist: cupy-cuda12x
Requires-Dist: torch
Requires-Dist: torchvision
Provides-Extra: gui
Requires-Dist: fastplotlib>=0.5.0; extra == "gui"
Requires-Dist: glfw; extra == "gui"
Requires-Dist: imgui-bundle==1.6.3; extra == "gui"
Requires-Dist: jupyter_rfb>=0.5.1; extra == "gui"
Provides-Extra: suite3d
Requires-Dist: mbo-suite3d>=0.0.4; extra == "suite3d"
Provides-Extra: cuda13
Requires-Dist: cupy-cuda13x; extra == "cuda13"
Provides-Extra: cuda11
Requires-Dist: cupy-cuda11x; extra == "cuda11"
Provides-Extra: all
Requires-Dist: fastplotlib>=0.5.0; extra == "all"
Requires-Dist: glfw; extra == "all"
Requires-Dist: imgui-bundle==1.6.3; extra == "all"
Requires-Dist: jupyter_rfb>=0.5.1; extra == "all"
Requires-Dist: mbo-suite3d>=0.0.4; extra == "all"
Provides-Extra: docs
Requires-Dist: sphinx>=6.1.3; extra == "docs"
Requires-Dist: docutils>=0.19; extra == "docs"
Requires-Dist: nbsphinx; extra == "docs"
Requires-Dist: numpydoc; extra == "docs"
Requires-Dist: ipykernel; extra == "docs"
Requires-Dist: sphinx-autodoc2; extra == "docs"
Requires-Dist: sphinx_tippy; extra == "docs"
Requires-Dist: sphinx_gallery; extra == "docs"
Requires-Dist: sphinx-togglebutton; extra == "docs"
Requires-Dist: sphinx-copybutton; extra == "docs"
Requires-Dist: sphinx_book_theme; extra == "docs"
Requires-Dist: sphinx_design; extra == "docs"
Requires-Dist: sphinxcontrib-images; extra == "docs"
Requires-Dist: sphinxcontrib-video; extra == "docs"
Requires-Dist: sphinxcontrib-bibtex; extra == "docs"
Requires-Dist: jupytext; extra == "docs"
Requires-Dist: myst_nb; extra == "docs"
Requires-Dist: scipy; extra == "docs"
Requires-Dist: scikit-image; extra == "docs"
Requires-Dist: suite2p_mbo; extra == "docs"
Requires-Dist: cellpose; extra == "docs"
Dynamic: license-file

# MBO Utilities

General Python and shell utilities developed for the Miller Brain Observatory (MBO) workflows.

[![Documentation](https://img.shields.io/badge/Documentation-black?style=for-the-badge&logo=readthedocs&logoColor=white)](https://millerbrainobservatory.github.io/mbo_utilities/)

Most functions have examples in docstrings.

Converting scanimage tiffs into intermediate filetypes for preprocessing or to use with Suite2p is covered [here](https://millerbrainobservatory.github.io/mbo_utilities/assembly.html).

Function examples [here](https://millerbrainobservatory.github.io/mbo_utilities/api/usage.html) are a work in progress.

---

## Installation

This package is fully installable with `pip`.

`conda` can still be used for the virtual environment, but be mindful to only install packages with `conda install` when absolutely necessary.

``` bash
# make sure your environment is activated, be that conda, venv, uv (recommended)
pip install mbo_utilities
```

To get the latest version:

```bash
pip install git+https://github.com/MillerBrainObservatory/mbo_utilities.git@master
```

To utilize the GPU, you will need CUDA and an appropriate [cupy](https://docs.cupy.dev/en/stable/install.html) installation.

Check which version of CUDA you have with `nvcc --version`.

```bash
nvcc --version
PS C:\Users\MBO-User\code> nvcc --version
nvcc: NVIDIA (R) Cuda compiler driver
Copyright (c) 2005-2025 NVIDIA Corporation
Built on Wed_Jul_16_20:06:48_Pacific_Daylight_Time_2025
Cuda compilation tools, release 13.0, V13.0.48
Build cuda_13.0.r13.0/compiler.36260728_0
```

For CUDA 13.x: `pip install mbo_utilities[cuda13]`

### RuntimeError with `cupy`

If you install the wrong version of cupy, you will see an error like:

`RuntimeError: CuPy failed to load nvrtc64_120_0.dll: FileNotFoundError: Could not find module 'nvrtc64_120_0.dll' (or one of its dependencies). Try using the full path with constructor syntax.`

You will need to uninstall cupy and reinstall the correct version.

```bash
pip uninstall cupy-cuda12x  # or cupy-cuda12x
pip install cupy-cuda11x  # or cupy-cuda12x
```

---

## Acknowledgements

This pipeline makes use of several open-source libraries:

- [Suite3D](https://github.com/alihaydaroglu/suite3d)
- [suite2p](https://github.com/MouseLand/suite2p)
- [rastermap](https://github.com/MouseLand/rastermap)
- [scanreader](https://github.com/atlab/scanreader)
