Embedding of whole slide images with Foundation Models
Project description
Histopathology Slide Pre-processing Pipeline
HS2P is an open-source project largely based on CLAM tissue segmentation and patching code.
🛠️ Installation
System requirements: Linux-based OS (e.g., Ubuntu 22.04) with Python 3.11+ and Docker installed.
We recommend running the script inside a container using the latest hs2p image from Docker Hub:
docker pull waticlems/hs2p:latest
docker run --rm -it \
-v /path/to/your/data:/data \
waticlems/hs2p:latest
Replace /path/to/your/data with your local data directory.
Alternatively, you can install hs2p via pip:
pip install hs2p
Patch Extraction: Step-by-step guide
-
Create a
.csvfile containing paths to the desired slides. Optionally, you can provide paths to pre-computed tissue masks under the 'mask_path' columnwsi_path,mask_path /path/to/slide1.tif,/path/to/mask1.tif /path/to/slide2.tif,/path/to/mask2.tif ...
-
Create a configuration file
A good starting point is to look at the default configuration file under
hs2p/configs/default.yamlwhere parameters are documented. -
Kick off slide tiling
python3 -m hs2p.tiling --config-file </path/to/config.yaml>
Patch Sampling: Step-by-step guide
-
Create a
.csvfile containing paths to the desired slides & associated annotation masks:wsi_path,mask_path /path/to/slide1.tif,/path/to/mask1.tif /path/to/slide2.tif,/path/to/mask2.tif ...
-
Create a configuration file
A good starting point is to look at the default configuration file under
hs2p/configs/default.yamlwhere parameters are documented. -
Kick off tile sampling
python3 -m hs2p.sampling --config-file </path/to/config.yaml>
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file hs2p-1.0.0.tar.gz.
File metadata
- Download URL: hs2p-1.0.0.tar.gz
- Upload date:
- Size: 25.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.11.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
ff7e8a1c08a42e532764b0b395a05e897ae41e91ad7576d89b45396eb43d9308
|
|
| MD5 |
af9a031c8070572415e651cc42f38911
|
|
| BLAKE2b-256 |
cabb75026b074a58ce37b01b7d3d5b9f59d46617facae18996c36408c2faa9c9
|
File details
Details for the file hs2p-1.0.0-py3-none-any.whl.
File metadata
- Download URL: hs2p-1.0.0-py3-none-any.whl
- Upload date:
- Size: 27.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.11.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
0f4e507e808458cc3afcb9b8c2fdd04f7a2062658d372d3894c24e1025f5d56f
|
|
| MD5 |
ffa0cfca500428e9aedaacd6c64a597b
|
|
| BLAKE2b-256 |
68b29d5fdbc036a318d468165f5c8bec099323bbba8ba43ec9dbcfe5e10cbe50
|