Skip to main content

WSI radiomics feature extraction from cell polygons (GeoJSON) and WSI slides

Project description

WSIRadiomics

English | 中文

WSIRadiomics is a cell-level → WSI-level radiomics feature extraction toolkit for Whole Slide Images (WSI).

It supports starting from cell instance segmentation results (GeoJSON) to compute cell-level features and further aggregate them into WSI-level features, making it suitable for computational pathology, digital pathology, and multimodal research.

✨ Features

  • 🧬 Cell-level → WSI-level feature computation pipeline
  • 🧠 Supports basic radiomics features such as first-order and shape
  • 🧩 Flexible YAML-based parameter configuration
  • 🏷 Supports aggregation by cell type (cell_type)
  • 📦 Modular design, easy to extend and customize
  • 📝 Uses Python logging, no print statements
  • 🚫 Core APIs do not write files, output is fully controlled by the user

📦 Installation

Method 1: Install via PyPI (Recommended)

pip install wsiradiomics

Suitable for direct usage, server environments, and virtual environments.

Method 2: Install via Conda / Mamba Environment (Recommended for research)

The project provides a complete environment file:

conda env create -f environment.yaml
conda activate wsiradiomics

Or using mamba (faster):

mamba env create -f environment.yaml
mamba activate wsiradiomics

This method is especially suitable for WSI / OpenSlide / Linux server environments.

🚀 Quick Start

It is recommended to first refer to the example code and configuration files in the examples/ directory.

Example files overview

examples/
├── example_file.csv    # CSV example for batch processing
├── extract_from_pandas.py # Batch feature extraction example
└── params.yaml       # Parameter configuration example

1️⃣ Single WSI feature extraction (API usage)

from wsiradiomics.extractor import extract

res = extract(
    svs_path="example.svs",
    geojson_path="cells.geojson",
    params_path="params.yaml",
)

wsi_features = res["wsi_features"]

2️⃣ Batch processing (CSV-driven, recommended)

CSV example (see examples/example_file.csv):

wsi_path,mask_path
/path/to/wsi_001.svs,/path/to/wsi_001_cells.geojson
/path/to/wsi_002.svs,/path/to/wsi_002_cells.geojson

Run the example script:

python examples/extract_from_pandas.py \
  --input_csv examples/example_file.csv \
  --params examples/params.yaml \
  --out_dir result/

Output results:

result/
├── wsi_features.csv
└── run_wsi_feature_extract.log

📄 License

MIT License

📬 Contact

Feel free to submit issues or suggestions via GitHub Issues

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

wsiradiomics-0.1.3.tar.gz (27.5 kB view details)

Uploaded Source

Built Distribution

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

wsiradiomics-0.1.3-py3-none-any.whl (33.2 kB view details)

Uploaded Python 3

File details

Details for the file wsiradiomics-0.1.3.tar.gz.

File metadata

  • Download URL: wsiradiomics-0.1.3.tar.gz
  • Upload date:
  • Size: 27.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.10

File hashes

Hashes for wsiradiomics-0.1.3.tar.gz
Algorithm Hash digest
SHA256 bc4bc4d3164b7cdb84db32daab9f5be75789d605cd48be3a0eace57d6675a585
MD5 c6f398528f589f34ff6815637884b7db
BLAKE2b-256 b314a96653f3c3af5db39c5af5ac68bc4625fa5320d3b17c42258eb1ce28a8be

See more details on using hashes here.

File details

Details for the file wsiradiomics-0.1.3-py3-none-any.whl.

File metadata

  • Download URL: wsiradiomics-0.1.3-py3-none-any.whl
  • Upload date:
  • Size: 33.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.10

File hashes

Hashes for wsiradiomics-0.1.3-py3-none-any.whl
Algorithm Hash digest
SHA256 6d78c727fa17f91d18562204ddfc86b951e590a00cde676942fe9a1f3745a4cf
MD5 6b25df40f6e610b0aafc02e08dab92ae
BLAKE2b-256 e104391c674d18b29e13a9a03269123743bbe1059169dd1dbf23ac35182541af

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