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] 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}
}

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

cubic-0.9.0a1.tar.gz (261.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

cubic-0.9.0a1-py3-none-any.whl (302.5 kB view details)

Uploaded Python 3

File details

Details for the file cubic-0.9.0a1.tar.gz.

File metadata

  • Download URL: cubic-0.9.0a1.tar.gz
  • Upload date:
  • Size: 261.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for cubic-0.9.0a1.tar.gz
Algorithm Hash digest
SHA256 47e1af3d27e2fcde141de478d7fca4096c97f0ce8c511e45fb5037371af8b0a7
MD5 dd5aa5ed8d69fdfa15e020b78d84b328
BLAKE2b-256 c4378a4941eb865ebb1ae22d5ed46f9340fd00083ff613166cb591e018ccc3ee

See more details on using hashes here.

Provenance

The following attestation bundles were made for cubic-0.9.0a1.tar.gz:

Publisher: release.yml on alxndrkalinin/cubic

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file cubic-0.9.0a1-py3-none-any.whl.

File metadata

  • Download URL: cubic-0.9.0a1-py3-none-any.whl
  • Upload date:
  • Size: 302.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for cubic-0.9.0a1-py3-none-any.whl
Algorithm Hash digest
SHA256 c644435af4266df31e950b24dc7404104d22874f5dbb3a448fe479811ca97aba
MD5 d612a3fd0827f36d49d2236867b21341
BLAKE2b-256 2fa4a9ed5c874d58e1fa509e2169da4ac9ead329848fc110e72f0aa96bb90db6

See more details on using hashes here.

Provenance

The following attestation bundles were made for cubic-0.9.0a1-py3-none-any.whl:

Publisher: release.yml on alxndrkalinin/cubic

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Release history Release notifications | RSS feed

This release

0.9.0a1 This release

2 files

0.8.0

2 files

0.7.0

2 files

0.6.0

2 files

0.5.0

1 file

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page