Metadata-Version: 2.4
Name: pml_utilities
Version: 4.0.0
Summary: Readers, pipelines and viewers for imaging data; the beta channel of mbo_utilities
License-Expression: BSD-3-Clause
Project-URL: Homepage, https://github.com/FlynnOConnell/pml_utilities
Project-URL: Documentation, https://millerbrainobservatory.github.io/mbo_utilities/
Project-URL: Repository, https://github.com/FlynnOConnell/pml_utilities
Project-URL: Upstream, https://github.com/MillerBrainObservatory/mbo_utilities
Keywords: Microscopy,ScanImage,multiROI,Tiff
Requires-Python: <3.14,>=3.12.7
Description-Content-Type: text/markdown
License-File: LICENSE.md
Requires-Dist: click
Requires-Dist: numpy>=2.2.5
Requires-Dist: scipy
Requires-Dist: h5py
Requires-Dist: tifffile>=2025.3.30
Requires-Dist: zarr>=3.1.3
Requires-Dist: numcodecs>=0.16
Requires-Dist: tqdm
Requires-Dist: packaging
Provides-Extra: gui
Requires-Dist: fastplotlib[imgui]<0.8,>=0.7.0; extra == "gui"
Requires-Dist: imgui-bundle<1.92.900,>=1.92.801; extra == "gui"
Requires-Dist: rendercanvas>=2.7.2; extra == "gui"
Requires-Dist: wgpu>=0.30.1; extra == "gui"
Requires-Dist: glfw; extra == "gui"
Requires-Dist: cmap>=0.7.2; extra == "gui"
Requires-Dist: matplotlib>=3.10.1; extra == "gui"
Requires-Dist: opencv-contrib-python-headless; extra == "gui"
Requires-Dist: scikit-image; extra == "gui"
Requires-Dist: imageio; extra == "gui"
Requires-Dist: psutil>=7.0; extra == "gui"
Provides-Extra: qt
Requires-Dist: pyqt6>=6.7; extra == "qt"
Provides-Extra: video
Requires-Dist: imageio[ffmpeg]; extra == "video"
Provides-Extra: codecs
Requires-Dist: imagecodecs>=2026.6.6; extra == "codecs"
Provides-Extra: pyramid
Requires-Dist: numba>=0.60.0; extra == "pyramid"
Provides-Extra: dask
Requires-Dist: dask>=2025.3.0; extra == "dask"
Provides-Extra: hpc
Requires-Dist: submitit>=1.5.0; extra == "hpc"
Provides-Extra: server
Requires-Dist: pml_utilities[gui]; extra == "server"
Requires-Dist: uvicorn>=0.30; extra == "server"
Requires-Dist: websockets>=13; extra == "server"
Requires-Dist: simplejpeg>=1.8; extra == "server"
Requires-Dist: av>=14; extra == "server"
Provides-Extra: suite2p
Requires-Dist: pml_utilities[gui]; extra == "suite2p"
Requires-Dist: suite2p>=1.1.0; extra == "suite2p"
Requires-Dist: rastermap>=0.9; extra == "suite2p"
Provides-Extra: napari
Requires-Dist: napari; extra == "napari"
Requires-Dist: napari-ome-zarr; extra == "napari"
Requires-Dist: napari-animation; extra == "napari"
Requires-Dist: pyqt6>=6.7; extra == "napari"
Requires-Dist: qtpy; extra == "napari"
Provides-Extra: notebooks
Requires-Dist: jupyterlab>=4.2.6; extra == "notebooks"
Requires-Dist: ipykernel; extra == "notebooks"
Requires-Dist: ipywidgets<9,>=8.0.0; extra == "notebooks"
Requires-Dist: jupyter_rfb>=0.5.1; extra == "notebooks"
Requires-Dist: seaborn>=0.13.2; extra == "notebooks"
Provides-Extra: all
Requires-Dist: pml_utilities[codecs,dask,gui,hpc,napari,notebooks,pyramid,qt,server,suite2p,video]; extra == "all"
Dynamic: license-file

> [!NOTE]
> Install `pml_utilities` in a virtual environment with [uv](https://docs.astral.sh/uv/):
>
> ```bash
> uv venv --python 3.12.9
> .venv\Scripts\activate.ps1        # Windows PowerShell
> source .venv/bin/activate         # Linux, macOS
> uv pip install "pml_utilities[gui]"
> ```

<p align="center">
<img src="https://raw.githubusercontent.com/FlynnOConnell/pml_utilities/main/mbo_utilities/assets/static/logo_utilities.png" height="110" alt="MBO Utilities logo">
</p>

# pml_utilities

Readers, pipelines and viewers for imaging data, for the Program in Memory Longevity
(PML). It installs the `mbo_utilities` Python package and the `mbo` command.

> **Beta channel.** `pml_utilities` is
> [mbo_utilities](https://github.com/MillerBrainObservatory/mbo_utilities) plus
> features that are still in beta. A feature lands here first and moves into the core
> `mbo_utilities` once it settles, so expect changes between releases. The
> documentation is [mbo_utilities'](https://millerbrainobservatory.github.io/mbo_utilities/).

- **Lazy reading and writing** of ScanImage and other TIFFs, Femtonics MESc, Bruker
  and lab4 HDF5, Zarr, suite2p folders, NumPy and IsoView trees, each as one
  `(T, C, Z, Y, X)` array
- **The Studio**, a GPU viewer built on [fastplotlib](https://fastplotlib.org):
  hand-drawn ROIs, traces, motion correction and behavior on one time axis
- **Pipelines** from the Studio or the command line: suite2p and, installed
  separately, MaskNMF and the voltage imaging pipelines, each writing one results zarr
- **MESc line-scan tools**: named ROIs, trace figures (`mbo dashboard`) and event
  curation (`mbo curate`)

## Extras

Python 3.12.7 to 3.13. The base install reads and writes every format and has no
window. `pml_utilities` and the PyPI `mbo_utilities` install the same package, so they
cannot share an environment.

```bash
uv pip install "pml_utilities[gui]"    # The Studio
uv pip install "pml_utilities[all]"    # every extra
```

| Extra | Adds |
|-------|------|
| `gui` | The Studio and the ROI, trace and curation tools; the ROI tool also needs masknmf, installed separately |
| `suite2p` | suite2p and rastermap; then `uv pip install --no-deps lbm-suite2p-python` |
| `server` | `mbo serve`, The Studio in a browser |
| `hpc` | submitit, to run suite2p on SLURM |
| `napari` | the napari viewer mode |
| `notebooks` | JupyterLab, for the notebooks `mbo init` writes |
| `video` | ffmpeg, for mp4 export |
| `codecs` | imagecodecs, for compressed TIFFs |
| `pyramid` | numba, for mode-downsampled zarr pyramids |
| `dask` | `files_to_dask` |
| `qt` | PyQt6 window backend; glfw is the default |

`mbo --check-install` lists every package, the GPU, and the install command for
anything missing, including Qt's system libraries on a minimal Linux install.

## Use

```bash
mbo                        # open The Studio
mbo /path/to/data          # open a file or folder
mbo info /path/to/data     # shape and metadata
mbo convert IN OUT         # convert between formats
mbo dashboard scan.mesc    # trace figures of a .mesc unit's ROIs
mbo curate scan.mesc       # event curation of a line scan
mbo --help                 # every command
```

```python
import mbo_utilities as mbo

arr = mbo.imread("scan.mesc", unit="MUnit_3")   # lazy, (T, C, Z, Y, X)
mbo.imwrite(arr, "out", ext=".zarr")
```

## Uninstall

```bash
uv pip uninstall pml_utilities
rm -rf ~/.mbo          # settings, logs and caches
```

## Issues

Report problems on [GitLab](https://gitlab.com/losonczylab/pml_utilities/-/issues).
