vampire-analysis#
VAMPIRE (Visually Aided Morpho-Phenotyping Image Recognition) quantifies the heterogeneity of cell and nucleus shapes in segmented microscopy images (Phillip et al., Nat Protoc 2021; see References and citation). It traces the outline of every object, normalizes away position, size, and rotation, and groups the outlines into a small number of shape modes. Comparing how often each shape mode occurs between experimental groups (for example control vs. oxygen-glucose deprivation) turns “the cells look different” into numbers.
vampire-analysis is a Python package with a
scikit-learn-style API: fit, predict,
transform, pipelines, and grid search all work as you would expect.
Install#
pip install vampire-analysis # or: uv add vampire-analysis
Requires Python 3.13 or newer. See Installation for details.
Ten-line quickstart#
import vampire as vp images, filenames = vp.datasets.load_example_images() # two 512x512 label images props = vp.extract_properties(images, filenames) # one row per object model = vp.Vampire(n_clusters=5, random_state=0).fit(props) props["shape_mode"] = model.predict(props) # shape modes 1..5 fig, axes = vp.plotting.plot_summary(model, props["shape_mode"]) fig.savefig("shape_modes.png", dpi=200)
Replace load_example_images() with
vp.read_images("path/to/segmented_images") to analyze your own data. The
Quickstart runs this code and shows its output.
User Guide
Installation, how VAMPIRE works, data conventions, differences from the GUI, and how to cite.
Tutorials
From segmented images to shape modes and figures, then the same for your own folders and groups.
Examples
Plotting gallery, applying a model to a new condition, choosing the number of shape modes, custom pipelines.
API Reference
Every public function and class with array shapes and runnable examples, plus a summary for coding agents (also as llms.txt).
Releases
What's new in 1.0 and a migration table from the pre-1.0 API.