Skip to main content

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

pip install wsiradiomics

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

⚠️ Important notice (WSI dependency)
The OpenSlide system library must be installed manually:

# Windows / Linux (conda)
conda install -c conda-forge openslide openslide-python

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"]

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

Metadata

Release files for wsiradiomics 0.2.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for wsiradiomics 0.2.0
File Size Uploaded Provenance Actions
wsiradiomics-0.2.0.tar.gz 27.5 kB Without provenance Details for wsiradiomics-0.2.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for wsiradiomics 0.2.0
File Interpreter ABI Platform Actions
wsiradiomics-0.2.0-py3-none-any.whl Python 3 none any Details for wsiradiomics-0.2.0-py3-none-any.whl

Total release size: 60.8 kB

Release files / wsiradiomics-0.2.0.tar.gz

Download URL wsiradiomics-0.2.0.tar.gz
Size 27.5 kB
Tags Source
SHA-256 checksum
How to use checksums
d4b876289230507f80bacf5d2bb57b717c540a6c4853278e73e4a75bbd334c4f
BLAKE2b-256 checksum
How to use checksums
a2d9b0bf620ac8963a86dd31626fc46d0a3385e7645e7144c02d2a140ba4eea2
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.11.7

Release files / wsiradiomics-0.2.0-py3-none-any.whl

Download URL wsiradiomics-0.2.0-py3-none-any.whl
Size 33.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
72b2883208062746d7dd804aa9ac0ac5a4ea853947d3cdba53edbf6cad5ffc9f
BLAKE2b-256 checksum
How to use checksums
e56f6a7f5544625c81f139efda71ca881e1988d89b78940628652ad262a5bb95
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.11.7

Security for wsiradiomics 0.2.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page