Skip to main content

Tools for computational pathology

Project description

A toolkit for computational pathology and machine learning.

tests Code style: black

Installing

Note: these instructions are for Linux. Commands may be different for other platforms.

  1. Requirements

    • Set up Conda environment
      • Download Miniconda here
      • Create conda environment
        conda create --name pathml python=3.8 numpy=1.8.15
        conda activate pathml
        
    • Install external dependencies
      sudo apt-get install openslide-tools g++ gcc libblas-dev liblapack-dev
      
    • Install conda dependencies OpenJDK
      conda install openjdk==8.0.152
      
    • [Optional]: Install CUDA. This step only applies if you want to use GPU acceleration for model training or other tasks. This guide should work, but for the most up-to-date instructions, refer to the official PyTorch installation instructions.
      • Check the version of CUDA:
        nvidia-smi
        
      • Install correct version of cudatoolkit:
        # update this command with your CUDA version number
        conda install cudatoolkit=11.0
        
  2. Install PathML:

    pip install pathml
    
  3. Optionally verify PyTorch installation with GPU support:

    python -c "import torch; print(torch.cuda.is_available())"
    

Generate Documentation

This repo is not yet open to the public. Once we open source it, we will host documentation online. Until then, you must build a local copy of the documentation yourself.

# first install packages for generating docs
pip install ipython sphinx nbsphinx nbsphinx-link sphinx-rtd-theme  
cd docs         # enter docs directory
make html       # build docs in html format

Then use your favorite web browser to open pathml/docs/build/html/index.html

Tests and Code Coverage

You may optionally run the test suite to verify installation.

To run tests:

conda install pytest    # first install pytest package
python -m pytest        # run test suite

Note that because the testing suite tests all parts of the code base, this may require installing additional packages as well. (e.g. installation of java is required for some functionality).

You may also optionally measure code coverage, i.e. what percentage of code is covered in the testing suite.

To run tests and check code coverage, install all dependencies (including dependencies for multiparametric images), then:

conda install coverage  # install coverage package for code coverage
coverage run            # run tests and calculate code coverage
coverage report         # view coverage report
coverage html           # optionally generate HTML coverage report

Getting Started

The example notebooks are a good place start with PathML.

Contributing

PathML is an open source project. Consider contributing to benefit the entire community!

There are many ways to contribute to PathML, including:

  • Submitting bug reports
  • Submitting feature requests
  • Writing documentation and examples
  • Fixing bugs
  • Writing code for new features
  • Sharing workflows
  • Sharing trained model parameters
  • Sharing PathML with colleagues, students, etc.

See contributing for more details.

Contact

Questions? Comments? Suggestions? Get in touch!

PathML@dfci.harvard.edu

Download files

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

Source Distribution

pathml-1.0.0.tar.gz (71.3 kB view hashes)

Uploaded Source

Built Distribution

pathml-1.0.0-py3-none-any.whl (80.0 kB view hashes)

Uploaded Python 3

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