Skip to main content

Embedding of whole slide images with Foundation Models

Project description

slide2vec

PyPI version Docker Version

🛠️ Installation

System requirements: Linux-based OS (e.g., Ubuntu 22.04) with Python 3.10+ and Docker installed.

We recommend running the script inside a container using the latest slide2vec image from Docker Hub:

docker pull waticlems/slide2vec:latest
docker run --rm -it \
    -v /path/to/your/data:/data \
    -e HF_TOKEN=<your-huggingface-api-token> \
    waticlems/slide2vec:latest

Replace /path/to/your/data with your local data directory.

Alternatively, you can install slide2vec via pip:

pip install slide2vec

🚀 Extract features

  1. Create a .csv file with slide paths. Optionally, you can provide paths to pre-computed tissue masks.

    wsi_path,mask_path
    /path/to/slide1.tif,/path/to/mask1.tif
    /path/to/slide2.tif,/path/to/mask2.tif
    ...
    
  2. Create a configuration file

    A good starting point is the default configuration file slide2vec/configs/default.yaml where parameters are documented.
    We've also added default configuration files for each of the foundation models currently supported:

    • tile-level: uni, uni2, virchow, virchow2, prov-gigapath, h-optimus-0, h-optimus-1, h0-mini, conch, musk, phikonv2, hibou-b, hibou-L, kaiko
    • slide-level: prov-gigapath, titan, prism
  3. Kick off distributed feature extraction

    python3 -m slide2vec.main --config-file </path/to/config.yaml>
    

Project details


Download files

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

Source Distribution

slide2vec-1.4.0.tar.gz (52.9 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

slide2vec-1.4.0-py3-none-any.whl (61.0 kB view details)

Uploaded Python 3

File details

Details for the file slide2vec-1.4.0.tar.gz.

File metadata

  • Download URL: slide2vec-1.4.0.tar.gz
  • Upload date:
  • Size: 52.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.14

File hashes

Hashes for slide2vec-1.4.0.tar.gz
Algorithm Hash digest
SHA256 fdd0c7ac68a9baa6488bd1ad32e023c168dfe55d850c52899673009b7bec336c
MD5 b6e13bbc5f0f465d8acbe7afe0a6fbdf
BLAKE2b-256 a8a1b044725050b63c5bb343e76be626154395b7e9c999659dfeab81bffff2e5

See more details on using hashes here.

File details

Details for the file slide2vec-1.4.0-py3-none-any.whl.

File metadata

  • Download URL: slide2vec-1.4.0-py3-none-any.whl
  • Upload date:
  • Size: 61.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.14

File hashes

Hashes for slide2vec-1.4.0-py3-none-any.whl
Algorithm Hash digest
SHA256 eadc06d8f2029b94609e3e4a5da0af7cedc037995cca1fd8def11af387bf7e9a
MD5 f33092e62705a209e96cf9334844f10a
BLAKE2b-256 357f57079ea3ee6204478c073543b8f26b2f48dbb261e44d0fb6481d48b03705

See more details on using hashes here.

Supported by

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