Skip to main content
Pre-release

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] an NVIDIA driver supporting CUDA 12 or 13, CuPy, cuCIM
  • [optional] Cellpose for segmentation

Installation

Install from PyPI:

pip install cubic

For GPU support on Linux, install one of the CUDA extras:

pip install 'cubic[cuda13]'  # driver with CUDA 13.x and a Turing or newer GPU
pip install 'cubic[cuda12]'  # driver with CUDA 12.x, or a Maxwell, Pascal or Volta GPU

nvidia-smi shows the driver's CUDA Version. These extras install CuPy and cuCIM together with the CUDA runtime libraries from PyPI, so only the NVIDIA driver is needed, not a CUDA Toolkit. cuCIM publishes Linux wheels only. Install one extra into an environment that has no other cupy-cuda* package: uv refuses to combine the two extras, but pip does not. pip and uv cannot yet detect the CUDA version themselves; conda can, so conda install -c rapidsai -c conda-forge cupy cucim followed by pip install cubic is an alternative.

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]'
# GPU support (pick one, see above)
pip install -e '.[cuda12]'
# install every extra except the GPU ones
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.0a5

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for cubic 0.9.0a5
File Size Uploaded Provenance Actions
cubic-0.9.0a5.tar.gz 305.9 kB With provenance Details for cubic-0.9.0a5.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for cubic 0.9.0a5
File Interpreter ABI Platform Actions
cubic-0.9.0a5-py3-none-any.whl Python 3 none any Details for cubic-0.9.0a5-py3-none-any.whl

Total release size: 654.1 kB

Release files / cubic-0.9.0a5.tar.gz

Download URL cubic-0.9.0a5.tar.gz
Size 305.9 kB
Tags Source
SHA-256 checksum
How to use checksums
28fd48e636ff2318e503fb30f517540510602e64bf03ed544371ec5a380f0415
BLAKE2b-256 checksum
How to use checksums
6a0dcb230028c46a7e2bf301b1bbe3c0cfb9581f3fec81886d4e0b7aa0523aef
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 Oct 7, 2026.

Transparency log

Release files / cubic-0.9.0a5-py3-none-any.whl

Download URL cubic-0.9.0a5-py3-none-any.whl
Size 348.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
83d05a87504751a232b2bf93b7dacd2d98e2bb1bc47b20f29fdb8770a1ba9731
BLAKE2b-256 checksum
How to use checksums
c7ec6636cbaa527b068b6f390afcff183053d51ef1e255e726fc8d80507225bd
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 Oct 7, 2026.

Transparency log

Security for cubic 0.9.0a5

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.

Full provenance

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for cubic-0.9.0a5.tar.gz

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 Oct 7, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release
Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page