histolablisted
Install: claude install-skill userInner/SKILLS
# Histolab
## Overview
Histolab is a Python library for processing whole slide images (WSI) in digital pathology. It automates tissue detection, extracts informative tiles from gigapixel images, and prepares datasets for deep learning pipelines. The library handles multiple WSI formats, implements sophisticated tissue segmentation, and provides flexible tile extraction strategies.
## Installation
Install OpenSlide system libraries first ([OpenSlide download](https://openslide.org/download/)), then install histolab:
```bash
uv pip install histolab
```
For built-in TCGA sample slides via `histolab.data`, also install pooch:
```bash
uv pip install pooch
```
Histolab 0.7.0 (latest stable) supports Python 3.8–3.11 on Linux and macOS. Windows is not supported as of 0.7.0.
## Quick Start
Basic workflow for extracting tiles from a whole slide image:
```python
from histolab.slide import Slide
from histolab.tiler import RandomTiler
# Load slide
slide = Slide("slide.svs", processed_path="output/")
# Configure tiler
tiler = RandomTiler(
tile_size=(512, 512),
n_tiles=100,
level=0,
seed=42
)
# Preview tile locations
tiler.locate_tiles(slide, n_tiles=20)
# Extract tiles
tiler.extract(slide)
```
## Core Capabilities
Six capability areas, each with worked code, are documented in
[references/core_capabilities.md](references/core_capabilities.md):
1. **Slide management** — opening slides, properties, levels, thumbnails, and scaled images.
2. **Tissue detection