Skip to main content

Deep learning tools for digital histology

Project description

slideflow logo

Python application pypi package

Slideflow is a computational pathology Python package which aims to provide an easy and intuitive way of building and testing deep learning models for use in histology image analysis. It is built with both Tensorflow/Keras and PyTorch backends, supporting standard and custom architectures, as well as CLAM. The overarching goal of the package is to provide tools to train and test models on histology slides, apply these models to new slides, and assess performance using analytical tools including predictive heatmaps, mosaic maps, ROCs, and more.

Slideflow requires Python 3.7+ and libvips.

To get started, ensure you have the latest version of pip, setuptools, and wheel installed:

pip3 install --upgrade setuptools pip wheel

Install package requirements from source/requirements.txt:

pip3 install -r requirements.txt

Import the module in python and initialize a new project:

import slideflow as sf
P = sf.Project.from_prompt("/path/to/project/directory")

You will be taken through a set of questions to configure your new project. Slideflow projects require an annotations file (CSV) associating patient names to outcome categories and slide names. If desired, a blank file will be created for you when you first setup a new project. Once the project is created, add rows to the annotations file with patient names and outcome categories.

Next, you will be taken through a set of questions to configure your first dataset source. Alternatively, you may manually add a source by calling:

P.add_source(name="NAME",
             slides="/slides/directory",
             roi="/roi/directory",
             tiles="/tiles/directory",
             tfrecords="/tfrecords/directory")

Once your annotations file has been set up and you have a dataset to work with, begin extracting tiles at specified pixel and micron size:

P.extract_tiles(tile_px=299, tile_um=302)

Following tile extraction, configure a set of model parameters:

params = sf.model.ModelParams(tile_px=299,
                              tile_um=302,
                              batch_size=32,
                              model='xception')

...and begin training:

P.train('category1', params=params)

Please see the documentation at slideflow.dev.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distribution

slideflow-1.0.0-py3-none-any.whl (434.9 kB view details)

Uploaded Python 3

File details

Details for the file slideflow-1.0.0-py3-none-any.whl.

File metadata

  • Download URL: slideflow-1.0.0-py3-none-any.whl
  • Upload date:
  • Size: 434.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.6.0 importlib_metadata/4.8.2 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.8

File hashes

Hashes for slideflow-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 df6a913a069174340effd0b724fa1faebbdb18df2e1409f7afe1153f57ed721d
MD5 5d11dcb0e24a936679ec1a15f612a971
BLAKE2b-256 bc1bf6ac8340c6a51cb43bc58282d948b049f3c3cc22c31f81d2b3b78c129c2f

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page