Skip to main content

volkcell

Python client and command line for the VolkCell cell image analysis API. Images are uploaded to VolkCell and analysed there.

Install

Python 3.9 or later:

pip install volkcell
pip install "volkcell[pandas]"   # for result.objects_dataframe()

API key

You need a VolkCell team workspace. Its owner or an admin creates a key at https://www.volkcell.com/w/<workspace>/api-keys. The key starts with vcw_ and is shown once.

export VOLKCELL_API_KEY="your key"

Keep the key out of scripts and notebooks you share. Runs made with it are billed to the workspace.

Command line

volkcell count image.tif
volkcell count image.tif --analysis adherent --objects cells.csv
volkcell count image.tif --json
volkcell result JOB_ID

--analysis is auto (default), suspension or adherent. Warnings are printed to standard error. The exit status is 0 when there is a result (with or without warnings) and 1 on an error.

Each count starts a new analysis and uses your allowance. If waiting stops early, use volkcell result JOB_ID to read the same run. If the upload itself fails with a connection or server error, check your runs in VolkCell before sending the image again: it may have been accepted.

Python

import volkcell

result = volkcell.count("image.tif", analysis="auto")
print(result.count)
for warning in result.warnings:
    print("WARNING:", warning)

table = result.objects_dataframe()   # or result.objects, a list of dicts

count also takes a numpy array: uint8 greyscale or colour, or uint16 greyscale. It is sent as a lossless PNG with the pixel values unchanged. For a stack or multichannel array, pass one 2-D plane.

Field Meaning
count Cell count. None if there is none, or if one file produced several images
warnings Everything VolkCell and the client flagged. Read these before using a number
objects One row per outlined object: area, equivalent diameter, centroid and bounding box, in pixels
labels Label image as a numpy array (0 is background), for single-image results
outlines_match_input False if the label image is a different size from your image; None if not compared
confluency_percent Confluency, when the analysis reports it
images Count and confluency per image
job_id Use with volkcell.get_result(job_id)
raw The API's results response

Object measurements are calculated by this client from the label image. They are in pixels.

Errors

All errors are subclasses of volkcell.VolkCellError and carry job_id once a job exists.

Error When
AuthenticationError No key, or the key was refused
InputError The file or array cannot be sent
RequestRejected The server refused the request, for example because Auto could not tell what the image is. Choose suspension or adherent
LimitError Rate, running-job or image allowance limit
AnalysisFailed The run produced no result; see warnings
AnalysisTimeout Waiting stopped (default 900 s); the run may still finish
ServiceError VolkCell could not be reached or had a temporary problem

Limits: one image per call, up to 100 MB. TIFF, PNG, JPEG, BMP, CZI, ND2, LIF, OIB, OIF.

Settings

VOLKCELL_BASE_URL or Client(base_url=...) selects another VolkCell server. The key is sent only to that address, over HTTPS (plain HTTP is accepted for localhost), and redirects are not followed.

Tests

pip install ".[test]"
pytest

The tests use a local mock server.

Licence

MIT. See LICENSE.

Metadata

Release files for volkcell 0.1.0

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

Source distribution (sdist)

Source distribution for volkcell 0.1.0
File Size Uploaded Provenance Actions
volkcell-0.1.0.tar.gz 14.3 kB Without provenance Details for volkcell-0.1.0.tar.gz

Built distribution (wheel)

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

Total release size: 28.8 kB

Release files / volkcell-0.1.0.tar.gz

Download URL volkcell-0.1.0.tar.gz
Size 14.3 kB
Tags Source
SHA-256 checksum
How to use checksums
b7d5362c994e6aa8b89f14c97be841ca0bcc6f4102d04703df7db7db2030fd2c
BLAKE2b-256 checksum
How to use checksums
1f4b11f822a856264e51069782e80aae3ec2833020daf28801e7af60c6e13700
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.16

Release files / volkcell-0.1.0-py3-none-any.whl

Download URL volkcell-0.1.0-py3-none-any.whl
Size 14.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
82ed6ee8067113d346764d2978925ac9b303b6496b9f11fbe52370cea30f976c
BLAKE2b-256 checksum
How to use checksums
9254a9c18d794eaa6e808b7d9408ad338f5fd8245026794d8a45914672f5d2da
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.16

Security for volkcell 0.1.0

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.

No provenance found

None of the files in this release were uploaded with provenance metadata.

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.

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