This release is a pre-release and may not be stable for production use.
cubic
cubic is a Python library that accelerates processing and analysis of
multidimensional (2D/3D+) bioimages using CUDA.
By leveraging GPU-enabled operations where possible, it offers substantial
speed ups over purely CPU-based approaches.
cubic's device-agnostic API wraps scipy/scikit-image and cupy/cuCIM,
allowing users to add GPU acceleration to existing codebases by simply replacing import
statements and transferring input arrays to the target device.
It also provides custom GPU-accelerated implementations of additional
features, including Fourier Ring and Shell Correlation for image resolution,
faster Richardson-Lucy deconvolution, average precision (AP) for segmentation
quality assessment, image-quality metrics (PSNR, SSIM, MicroSSIM, MS-SSIM),
and other features.
Getting started
Dependencies
- Python >=3.10
- numpy/scipy/scikit-image
- [optional] CUDA>=11.x, CuPy, cuCIM
- [optional] Cellpose for segmentation
Installation
Install optional CUDA dependencies if GPU support is needed.
Install from PyPI:
pip install cubic
Or install from source:
git clone https://github.com/alxndrkalinin/cubic.git
cd cubic
pip install .
Optional extras from pyproject.toml enable additional functionality:
# mesh feature extraction
pip install '.[mesh]'
# segmentation via Cellpose (SAM models: cpsam, cpsam_v2)
pip install '.[cellpose]'
# the Cellpose DINO models (cpdino, cpdino-vitb) additionally require dinov3,
# which is only published on GitHub:
pip install 'git+https://github.com/facebookresearch/dinov3'
# plotting helpers (matplotlib)
pip install '.[plot]'
# run the example notebooks (jupyter, pooch)
pip install '.[examples]'
# developer tools (pre-commit, pytest)
pip install -e '.[dev]'
# install everything
pip install -e '.[all]'
Testing
Run style checks and tests using pre-commit and pytest:
pre-commit run --all-files
pytest
Contributing
Contributions and bug reports are welcome. Install development dependencies and set up pre-commit hooks:
pip install -e '.[dev]'
pre-commit install
Pre-commit will then run style checks automatically. Please open an issue or pull request on GitHub.
Usage
Example Notebooks
| Notebook | Description |
|---|---|
| Resolution Estimation (2D) | FRC and DCR on STED microscopy data |
| Resolution Estimation (3D) | FSC and DCR on 3D confocal pollen data |
| Split Comparison (FRC/FSC) | Checkerboard vs binomial splitting for single-image FRC/FSC |
| Deconvolution Iterations (3D) | RL deconvolution stopping criteria via PSNR, SSIM, FSC, DCR |
| Wiener-Butterworth Deconvolution (3D) | Unmatched WB back projector for ~1-2 iteration RL deconvolution |
| 3D Monolayer Segmentation | 3D nuclei and cell segmentation of hiPSC monolayer |
| 3D Feature Extraction | Device-agnostic regionprops: identical CPU (scikit-image) vs GPU (cuCIM) features, ~8x speedup |
Citation
If you use cubic in your research, please cite it:
@inproceedings{kalinin2025cubic,
title={cubic: CUDA-accelerated 3D BioImage Computing},
author={Kalinin, Alexandr A and Carpenter, Anne E and Singh, Shantanu and O’Meara, Matthew J},
booktitle={International Conference on Computer Vision Workshops (ICCVW)},
year={2025},
organization={IEEE}
}
Metadata
Release files for cubic 0.9.0a2
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| cubic-0.9.0a2.tar.gz | 264.3 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| cubic-0.9.0a2-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 569.8 kB
Release files / cubic-0.9.0a2.tar.gz
| Download URL | cubic-0.9.0a2.tar.gz |
|---|---|
| Size | 264.3 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
a30e2cad7a6ead80063ecbb2e0af1d3fa3dffd60ae877a7aba7bbd5ad0150aeb
|
|
BLAKE2b-256 checksum How to use checksums |
14cd08a12f3bf55abcde733c0127354fd12cca760194f2f53bf6d0f8b7af68fc
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Sep 29, 2026.
Transparency logRelease files / cubic-0.9.0a2-py3-none-any.whl
| Download URL | cubic-0.9.0a2-py3-none-any.whl |
|---|---|
| Size | 305.5 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
72a6ba70ea51988f48dd9b1fe4abf706f5933a768423871fc3ed0f250e8d18de
|
|
BLAKE2b-256 checksum How to use checksums |
a29e7427ead5bd6b4369b5c05c19a659197fe72336e58ab35d4236b84518109c
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Sep 29, 2026.
Transparency log