Model or dataset
Dana-Farber-AIOS/pathml avatar
Dana-Farber-AIOS/pathml

PathML: A Computational Pathology Toolkit With OpenSlide and OpenJDK Underneath

Tools for computational pathology

462 stars87 forksPythonGPL-2.0

At a glance

What is it?
PathML is a Dana-Farber research toolkit for loading, tiling and modelling whole-slide pathology images. Its value is the standardised slide-handling layer; its cost is a conda environment with OpenJDK pinned below 18 and platform-specific OpenSlide binaries.
Who is it for?
Adopt PathML if your work starts from whole-slide images in proprietary formats and you want tiling, preprocessing and dataset objects handled by one library rather than rewritten per project. Do not adopt it if you only need to read pyramidal TIFFs, or if your pipeline already has a slide reader you trust.
Can I use it commercially?
Yes, with conditions. GPL-2.0 is a copyleft licence: if you distribute software that includes it, you must release that software's source code under the same licence. Running it internally without distributing it does not trigger that obligation.
Is it still maintained?
Yes. The repository last received commits 33 days ago.
What is it written in?
Mainly Python, according to GitHub's language statistics.

Answers come from the project's GitHub data, last synced on September 15, 2026, and from our analysis. They are not legal advice.

DEEP OPEN-SOURCE ANALYSIS

The problem PathML targets: slide files that do not behave like images

A whole-slide image is a pyramidal, tiled, often proprietary file that can be several gigabytes. Reading it as a normal image is the wrong move, and the README frames the motivation in terms of scale: imaging datasets in cancer research are described as growing exponentially in both quantity and information density. PathML's stated objective is to lower the barrier to entry to digital pathology, and the repository topics list the ground it covers: histopathology, fluorescence microscopy imaging, spatial transcriptomics, deep learning and PyTorch. The intended user is a research group or a computational biology team that has slides in hand and wants to move from raw files to model-ready tensors without writing slide-format plumbing for every study. That is a narrower audience than "anyone doing image analysis", and the installation steps make the narrowing explicit.

What sits between a slide file and a model

The architecture visible in the material is a layered one. At the bottom, OpenSlide handles reading vendor slide formats; the README requires openslide-tools on Linux, openslide via Brew on macOS, and either vcpkg or pre-built OpenSlide binaries on Windows. Above that, PathML provides the preprocessing and dataset abstractions that turn a slide into tiles a network can consume. Above that, PyTorch is the modelling target, and CUDA is only needed if you want GPU acceleration for training: the README states that the default CUDA version in the source environment file is 11.6. So the data flow is slide file to OpenSlide to PathML's tiling and preprocessing to a PyTorch dataset. The interesting design decision is the Java dependency. The recommended environment creates the conda environment with openjdk<=18.0 from conda-forge, which suggests some component in the stack is JVM-based rather than pure Python. The README does not explain which part, and that omission matters for anyone deploying into a constrained container.

Getting it running: three documented paths

The README gives a Docker one-liner as the fastest route: docker pull pathml/pathml followed by docker run -it -p 8888:8888 pathml/pathml, which drops you into a Jupyter environment on port 8888. For a local install, the recommended user path uses Micromamba: micromamba create -n pathml 'openjdk<=18.0' -c conda-forge python=3.9, then micromamba activate pathml, then pip install pathml. The Anaconda equivalent creates the environment with python=3.9, installs openjdk<=18.0 from conda-forge, and then pip install pathml. Developers clone the repository and use conda env create -f environment.yml on Linux and Windows, or requirements/environment_mac.yml on macOS. Note the Python version: every documented path pins 3.9. If your project is on 3.12, you are outside what the README describes. The external dependencies are not optional and not installed by pip: on Linux, sudo apt-get install openslide-tools g++ gcc libblas-dev liblapack-dev; on macOS, brew install openslide. The g++ and gcc entries imply compilation of extension code during install, which is worth knowing before you try this on a slim base image.

The Java pin and the platform split are the real friction

OpenJDK is capped at version 18.0 in the documented environments. A cap rather than a floor usually means an incompatibility somewhere upstream, and the README does not say where. If you already run a JVM-based service on a newer JDK, or if your base image ships one, you now have a version conflict to resolve. The second friction point is Windows. Linux and macOS each get a single package-manager command, while Windows gets two options, vcpkg or manually downloaded pre-built OpenSlide binaries extracted to a path such as C:\OpenSlide\. That is a documented workaround, not a first-class install, and it shifts the burden of getting OpenSlide discoverable onto you. The third constraint is the combination of Python 3.9 and compiled dependencies. Pinning an older Python is defensible for a research toolkit that must keep numerical and imaging libraries in agreement, but it means PathML will lag your other dependencies rather than lead them. Treat the environment as something you isolate, not something you merge into an existing application environment.

When PathML is the wrong tool

If your only requirement is to read a pyramidal TIFF and pull out a region, PathML is more machinery than the task needs. You would be installing a conda environment, OpenSlide and a pinned JDK to do what a slide-reading library alone does. Similarly, if your slides are already converted to a flat tiled format such as a directory of PNG patches, the slide-handling layer that justifies PathML's dependency weight is doing nothing for you, and a plain PyTorch Dataset plus torchvision transforms covers the same ground. There is also a scale question the material does not answer. The README describes the motivation in terms of massive datasets, but it does not state how PathML handles distributed preprocessing, and nothing in the supplied material describes a cluster execution mode. If your workflow needs to tile tens of thousands of slides across many nodes, verify that story yourself before assuming PathML provides it. Finally, the repository's own framing is research-oriented: it is described as a general-purpose research toolkit. That is a statement about intended use, and it should shape how much you rely on it inside a clinical or regulated pipeline.

The alternative: OpenSlide directly, or a tile-first pipeline

The obvious alternative is OpenSlide on its own. The difference in approach is one of scope. OpenSlide reads slides; PathML adds the layer above, meaning tile extraction, preprocessing and dataset construction that you would otherwise write yourself, and it adds that layer in a form shared across studies. Choosing OpenSlide alone means you own the tiling logic, the coordinate bookkeeping and the dataset class, which is more code but no Java pin, no Python 3.9 constraint and no opinionated preprocessing defaults. A second alternative is to skip slide-level tooling entirely by converting slides to patches once, with a dedicated converter, and then training on the patch store. That approach trades storage for simplicity and removes the imaging stack from your training environment altogether. The honest comparison is not about capability but about where you want the boundary: PathML draws it above OpenSlide and below PyTorch, and if that boundary matches your project, the dependency cost is buying you real work.

Licence, releases and the cost of staying current

PathML is GPL-2.0. For research use inside a lab that is usually unremarkable, but GPL-2.0 is a copyleft licence, and if you intend to redistribute a product that links against or incorporates PathML, the terms of that distribution are a question for your own legal review. This article is not legal advice. On maintenance, the release cadence visible in the material is steady rather than rapid: v3.0.5 in March 2026, v3.0.6 in April 2026, v3.0.7 in July 2026, with the last push to the repository in August 2026. The version numbering suggests a mature 3.x line receiving incremental updates rather than a project in flux. The upgrade cost is dominated by the environment, not the API: each release must still be reconciled with the openjdk<=18.0 pin, the Python 3.9 pin and the platform-specific OpenSlide install. Budget for rebuilding the environment rather than for code changes, and keep the environment file from the repository as your source of truth instead of reconstructing the pip install by hand.

Editorial conclusion

Adopt PathML if your work starts from whole-slide images in proprietary formats and you want tiling, preprocessing and dataset objects handled by one library rather than rewritten per project. Do not adopt it if you only need to read pyramidal TIFFs, or if your pipeline already has a slide reader you trust. Before committing, verify that your own slide formats load through the documented OpenSlide path, confirm the Java dependency resolves in your environment, and read the GPL-2.0 terms against how you intend to distribute your code.

Official sources

  1. Dana-Farber-AIOS/pathml on GitHub
  2. License: GPL-2.0
  3. Project website
  4. README
  5. Releases
Community notes

Community notes