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 account (free). Make a key on your API keys page. The key starts with vcw_ and is shown once. Runs use your account's image allowance; a free monthly allowance is included. A team workspace's owner or admin can instead make a key at https://www.volkcell.com/w/<workspace>/api-keys, billed to that workspace.

export VOLKCELL_API_KEY="your key"

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

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.

Support

Email support@volkcell.com.

Metadata

Release files for volkcell 0.1.2

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.2
File Size Uploaded Provenance Actions
volkcell-0.1.2.tar.gz 14.6 kB Without provenance Details for volkcell-0.1.2.tar.gz

Built distribution (wheel)

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

Total release size: 29.2 kB

Release files / volkcell-0.1.2.tar.gz

Download URL volkcell-0.1.2.tar.gz
Size 14.6 kB
Tags Source
SHA-256 checksum
How to use checksums
01b15e98801dc1b558323ce62e6e7e09ea262115ab3db0d607918a261672f286
BLAKE2b-256 checksum
How to use checksums
0897d7e3e6f32539b39e29e848c9ff77c69d704edd0a910a16baef3e898261c9
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.2-py3-none-any.whl

Download URL volkcell-0.1.2-py3-none-any.whl
Size 14.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
399428010a8177b2c04e5499bc89335bce6035baac9733890c8506a09027ad72
BLAKE2b-256 checksum
How to use checksums
26a7a15e7153f02deae0e873826d87c92b9cb0c0e32da6ee3083c1e1d1574f6e
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.2

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