Catalog PyPI
PACKAGE EXPLORERView in registry

ahcore

PyPI

Core building blocks for whole-slide-image deep learning pipelines

Versions collected1
Direct dependencies30From release 0.4.0
Last observed21 Oct, 09:36 UTC

README

Version 0.4.0 documentation

ahcore

ahcore is the AI for Oncology core toolkit for computational-pathology pipelines: the reusable building blocks that sit between whole-slide images and a training run. It is a pure-Python library, meant to be composed inside a larger pipeline rather than run on its own.

This repository is automatically synced from the AI for Oncology monorepo.

What ahcore offers

ahcore is a toolkit of composable building blocks for whole-slide-image deep learning, not an end-to-end application. A consumer pipeline assembles these pieces and owns the experiment logic. It decides how data is split, whether to cross-validate, and how runs are orchestrated. ahcore provides the parts.

  • A data catalog. A SQLAlchemy-backed manifest of patients, slides, masks, labels, and named splits, queried through a DataManager. ahcore stores and serves splits (e.g. fit/validate/test membership, or membership supplied in memory). How you draw them is up to you.
  • Views and adapters. Lazy per-slide and per-tile accessors over the catalog, plus an adapter seam (view → AdapterBundle) that turns them into named, model-ready tensors. Ships adapters for foundation-model tile features, patient labels, bulk RNA expression, and image+mask pairs. Adapters are the main extension point.
  • Feature extraction and caching. Run a packaged foundation-model encoder over a slide's tiles and persist the per-slide features to HDF5, keyed deterministically. This is a distinct precompute step: at training time the feature adapters read from that cache, they do not extract on the fly (doing so would be too slow for a realistic training run).
  • Datamodules and models. PyTorch Lightning datamodules that assemble batches from adapters (single- or multi-modal), plus model heads: attention-based MIL (ABMIL), mean-pool MIL (MeanMIL), encoders, a concatenation fusion head, and segmentation wrappers.
  • Task and training scaffolding. A Task protocol (choose inputs and targets, compute loss and metrics) and a thin MultiModalLightningModule that runs training/validation/test by delegating to the task. You supply the concrete tasks.
  • Slide-sized raster I/O. Stream model outputs (segmentation masks, attention or probability maps) tile-by-tile into a chunked Zarr store, then read arbitrary regions back like a slide, to stitch, overlay, or export to a pyramidal TIFF.
  • Transforms and augmentations. Tile transforms (including polygon-to-mask) and feature-space augmentations.

ahcore ships no end-to-end command-line application; it is a library.

Installation

pip install ahcore

Requires Python ≥ 3.11. The training stack (PyTorch Lightning) is a core dependency. ahcore is a training-scaffolding library, not an optional add-on.

Manifests that read slides with OpenSlide (reader OPENSLIDE) need dlup's OpenSlide backend:

pip install "ahcore[openslide]"

Development

ahcore is developed in the AI for Oncology monorepo and synced to this repository. To work on it here, standalone:

pip install -e ".[dev]"
pytest

Inside the monorepo it is built and tested with Bazel (bazelisk test //aifo/ahcore/tests/...).

License

Apache 2.0 — see LICENSE.

Downloads & popularity

8downloads
1-day window · source-reported counts20 Oct 2026
112560
2026-08-24: 112 · observed 2026-10-21T12:12:53.0159334Z · period 2026-08-24–2026-08-242026-08-25: 7 · observed 2026-10-21T12:12:53.0159334Z · period 2026-08-25–2026-08-252026-08-26: 7 · observed 2026-10-21T12:12:53.0159334Z · period 2026-08-26–2026-08-262026-08-27: 5 · observed 2026-10-21T12:12:53.0159334Z · period 2026-08-27–2026-08-272026-08-28: 78 · observed 2026-10-21T12:12:53.0159334Z · period 2026-08-28–2026-08-282026-08-29: 9 · observed 2026-10-21T12:12:53.0159334Z · period 2026-08-29–2026-08-292026-08-30: 4 · observed 2026-10-21T12:12:53.0159334Z · period 2026-08-30–2026-08-302026-08-31: 15 · observed 2026-10-21T12:12:53.0159334Z · period 2026-08-31–2026-08-312026-09-01: 9 · observed 2026-10-21T12:12:53.0159334Z · period 2026-09-01–2026-09-012026-09-02: 2 · observed 2026-10-21T12:12:53.0159334Z · period 2026-09-02–2026-09-022026-09-03: 4 · observed 2026-10-21T12:12:53.0159334Z · period 2026-09-03–2026-09-032026-09-04: 6 · observed 2026-10-21T12:12:53.0159334Z · period 2026-09-04–2026-09-042026-09-07: 4 · observed 2026-10-21T12:12:53.0159334Z · period 2026-09-07–2026-09-072026-09-09: 4 · observed 2026-10-21T12:12:53.0159334Z · period 2026-09-09–2026-09-092026-09-11: 1 · observed 2026-10-21T12:12:53.0159334Z · period 2026-09-11–2026-09-112026-09-13: 5 · observed 2026-10-21T12:12:53.0159334Z · period 2026-09-13–2026-09-132026-09-14: 3 · observed 2026-10-21T12:12:53.0159334Z · period 2026-09-14–2026-09-142026-09-15: 6 · observed 2026-10-21T12:12:53.0159334Z · period 2026-09-15–2026-09-152026-09-16: 98 · observed 2026-10-21T12:12:53.0159334Z · period 2026-09-16–2026-09-162026-09-18: 100 · observed 2026-10-21T12:12:53.0159334Z · period 2026-09-18–2026-09-182026-09-19: 6 · observed 2026-10-21T12:12:53.0159334Z · period 2026-09-19–2026-09-192026-09-20: 10 · observed 2026-10-21T12:12:53.0159334Z · period 2026-09-20–2026-09-202026-09-21: 12 · observed 2026-10-21T12:12:53.0159334Z · period 2026-09-21–2026-09-212026-09-22: 1 · observed 2026-10-21T12:12:53.0159334Z · period 2026-09-22–2026-09-222026-09-23: 2 · observed 2026-10-21T12:12:53.0159334Z · period 2026-09-23–2026-09-232026-09-24: 5 · observed 2026-10-21T12:12:53.0159334Z · period 2026-09-24–2026-09-242026-09-26: 1 · observed 2026-10-21T12:12:53.0159334Z · period 2026-09-26–2026-09-262026-09-27: 1 · observed 2026-10-21T12:12:53.0159334Z · period 2026-09-27–2026-09-272026-09-28: 2 · observed 2026-10-21T12:12:53.0159334Z · period 2026-09-28–2026-09-282026-09-30: 4 · observed 2026-10-21T12:12:53.0159334Z · period 2026-09-30–2026-09-302026-10-02: 2 · observed 2026-10-21T12:12:53.0159334Z · period 2026-10-02–2026-10-022026-10-03: 1 · observed 2026-10-21T12:12:53.0159334Z · period 2026-10-03–2026-10-032026-10-05: 4 · observed 2026-10-21T12:12:53.0159334Z · period 2026-10-05–2026-10-052026-10-06: 1 · observed 2026-10-21T12:12:53.0159334Z · period 2026-10-06–2026-10-062026-10-09: 1 · observed 2026-10-21T12:12:53.0159334Z · period 2026-10-09–2026-10-092026-10-10: 4 · observed 2026-10-21T12:12:53.0159334Z · period 2026-10-10–2026-10-102026-10-11: 3 · observed 2026-10-21T12:12:53.0159334Z · period 2026-10-11–2026-10-112026-10-13: 2 · observed 2026-10-21T12:12:53.0159334Z · period 2026-10-13–2026-10-132026-10-14: 2 · observed 2026-10-21T12:12:53.0159334Z · period 2026-10-14–2026-10-142026-10-15: 10 · observed 2026-10-21T12:12:53.0159334Z · period 2026-10-15–2026-10-152026-10-16: 84 · observed 2026-10-21T12:12:53.0159334Z · period 2026-10-16–2026-10-162026-10-17: 14 · observed 2026-10-21T12:12:53.0159334Z · period 2026-10-17–2026-10-172026-10-18: 5 · observed 2026-10-21T12:12:53.0159334Z · period 2026-10-18–2026-10-182026-10-19: 9 · observed 2026-10-21T12:12:53.0159334Z · period 2026-10-19–2026-10-192026-10-20: 8 · observed 2026-10-21T12:12:53.0159334Z · period 2026-10-20–2026-10-20
24 Aug20 Oct

pypistats · 45 observations shown. Missing days are unknown. Source category: overall: without mirrors.

View observed values
Date / source periodValueObserved at
2026-10-20 – 2026-10-2082026-10-21T12:12:53.0159334Z
2026-10-19 – 2026-10-1992026-10-21T12:12:53.0159334Z
2026-10-18 – 2026-10-1852026-10-21T12:12:53.0159334Z
2026-10-17 – 2026-10-17142026-10-21T12:12:53.0159334Z
2026-10-16 – 2026-10-16842026-10-21T12:12:53.0159334Z
2026-10-15 – 2026-10-15102026-10-21T12:12:53.0159334Z
2026-10-14 – 2026-10-1422026-10-21T12:12:53.0159334Z
2026-10-13 – 2026-10-1322026-10-21T12:12:53.0159334Z
2026-10-11 – 2026-10-1132026-10-21T12:12:53.0159334Z
2026-10-10 – 2026-10-1042026-10-21T12:12:53.0159334Z
2026-10-09 – 2026-10-0912026-10-21T12:12:53.0159334Z
2026-10-06 – 2026-10-0612026-10-21T12:12:53.0159334Z
2026-10-05 – 2026-10-0542026-10-21T12:12:53.0159334Z
2026-10-03 – 2026-10-0312026-10-21T12:12:53.0159334Z
2026-10-02 – 2026-10-0222026-10-21T12:12:53.0159334Z
2026-09-30 – 2026-09-3042026-10-21T12:12:53.0159334Z
2026-09-28 – 2026-09-2822026-10-21T12:12:53.0159334Z
2026-09-27 – 2026-09-2712026-10-21T12:12:53.0159334Z
2026-09-26 – 2026-09-2612026-10-21T12:12:53.0159334Z
2026-09-24 – 2026-09-2452026-10-21T12:12:53.0159334Z
2026-09-23 – 2026-09-2322026-10-21T12:12:53.0159334Z
2026-09-22 – 2026-09-2212026-10-21T12:12:53.0159334Z
2026-09-21 – 2026-09-21122026-10-21T12:12:53.0159334Z
2026-09-20 – 2026-09-20102026-10-21T12:12:53.0159334Z
2026-09-19 – 2026-09-1962026-10-21T12:12:53.0159334Z
2026-09-18 – 2026-09-181002026-10-21T12:12:53.0159334Z
2026-09-16 – 2026-09-16982026-10-21T12:12:53.0159334Z
2026-09-15 – 2026-09-1562026-10-21T12:12:53.0159334Z
2026-09-14 – 2026-09-1432026-10-21T12:12:53.0159334Z
2026-09-13 – 2026-09-1352026-10-21T12:12:53.0159334Z
2026-09-11 – 2026-09-1112026-10-21T12:12:53.0159334Z
2026-09-09 – 2026-09-0942026-10-21T12:12:53.0159334Z
2026-09-07 – 2026-09-0742026-10-21T12:12:53.0159334Z
2026-09-04 – 2026-09-0462026-10-21T12:12:53.0159334Z
2026-09-03 – 2026-09-0342026-10-21T12:12:53.0159334Z
2026-09-02 – 2026-09-0222026-10-21T12:12:53.0159334Z
2026-09-01 – 2026-09-0192026-10-21T12:12:53.0159334Z
2026-08-31 – 2026-08-31152026-10-21T12:12:53.0159334Z
2026-08-30 – 2026-08-3042026-10-21T12:12:53.0159334Z
2026-08-29 – 2026-08-2992026-10-21T12:12:53.0159334Z
2026-08-28 – 2026-08-28782026-10-21T12:12:53.0159334Z
2026-08-27 – 2026-08-2752026-10-21T12:12:53.0159334Z
2026-08-26 – 2026-08-2672026-10-21T12:12:53.0159334Z
2026-08-25 – 2026-08-2572026-10-21T12:12:53.0159334Z
2026-08-24 – 2026-08-241122026-10-21T12:12:53.0159334Z

Versions 1

Collected releases
VersionPublishedDirect dependenciesOpen version
0.4.016 Oct 202630

Package advisories

0
No matching advisories collected

This describes our collected data; it is not a security assessment.

Repository

PENDING
nki-ai/ahcore

Shared repository data · GitHub

License detected in repository
Not collected

Metadata history

Meaningful changes
Current collected state Current

Observed since 21 Oct, 09:36 UTC

No superseded metadata states collected. Unchanged observations do not create new revisions.

Record identity

package:292d58e5fa9e607d137f90e2832794d6937c00d4ef7782e885700c20db626a20