Agent skill · research science · k-dense-ai

histolab

Lightweight WSI tile extraction and preprocessing. Use for basic slide processing, tissue detection, tile extraction, and stain normalization for H&E images. Best for simple pipelines, dataset preparation, and quick tile-based analysis. For advanced spatial proteomics, multiplexed imaging, or deep learning pipelines use pathml.

Why this skill is useful

Provides domain-specific commands and workflows for processing whole slide images that the AI wouldn't reliably generate on its own.

What it needs

Requires openslide, pooch installed locally. About 5k tokens when loaded. Last updated 2026-08-03. 32,849 stars on the source repository.

What this skill does

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), then install histolab: For built-in TCGA sample slides via histolab.data, also 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: Core Capabilities Six capability areas, each with worked code, are documented in references/corecapabilities.md: 1. Slide management — opening slides, properties, levels, thumbnails, and scaled images. 2. Tissue detection and masks — TissueMask and BiggestTissueBoxMask, and custom masks. 3. Tile extraction — random, grid, and score-based tilers with size, level, and tissue-fraction control. 4. Filters and preprocessing — image and morphological filters, and composing them. 5. Stain normalization — Reinhard and Macenko normalization against a target image. 6. Visualization — locating tiles on the slide and inspecting masks and extractions. Five end-to-end workflows are in references/typicalworkflows.md. Per-topic detail lives in references/slidemanagement.md, references/tissuemasks.md, references/tileextraction.md, references/filterspreprocessing.md, and references/visualization.md. Best Practices Slide Loading and Inspection 1. Always inspect slide properties before processing 2. Save thumbnails with slide.thumbnail.save() for quick visual review 3. Check pyramid levels and dimensions 4. Verify tissue is present using thumbnails Tissue Detection 1. Preview masks with locatemask() before extraction 2. …

How to use it

Reference it in AdaL, Claude Code, Cursor or any coding agent — nothing to install:

@skills k-dense-ai/histolab

View the source on GitHub

Browse the @skills marketplace