histolab (WSI Tile Extraction)
Guides Claude through tissue detection, tile extraction and stain normalization on gigapixel whole slide images using the histolab Python library.
Data & AnalyticsIntermediate★ 33,030⑂ 3,248AI score 7/10Last updated: Aug 9, 2026
What it does
Provides working recipes for the histolab library so Claude can build digital-pathology preprocessing pipelines:
- Load slides, inspect properties and pyramid levels, save thumbnails
- Detect tissue with
TissueMask,BiggestTissueBoxMask, or custom masks - Pick a tiling strategy: RandomTiler (sampling), GridTiler (full coverage), ScoreTiler (quality-driven, e.g. NucleiScorer)
- Chain image and morphological filters; apply Macenko/Reinhard stain normalization
- Preview tile placement with
locate_tiles()and visualize masks - Troubleshoot no-tiles, background-heavy output, slow extraction, and cross-slide inconsistency
Who it's for
- Researchers building deep-learning datasets from H&E slides
- ML engineers standardizing the preprocessing stage of a pathology pipeline
- Students new to WSIs who need sensible tiler and parameter defaults
Examples
- "Extract 200 random 512x512 tiles from this .svs at 80% tissue threshold" → seeded RandomTiler script plus a preview step.
- "Stain color varies across my cohort" → shows how to insert MacenkoStainNormalizer into the tile pipeline.
- "GridTiler extraction takes hours" → recommends lower pyramid levels, BiggestTissueBoxMask, and tissue_percent tuning.
· · · Install guide · · ·
Install in the Claude app (no terminal)
- Download the ZIP with the button below.
- In Claude, open Settings → Capabilities and turn on 'Code execution and file creation'. (one time)
- Go to Customize → Skills → + → 'Upload a skill' and upload the ZIP.
Install in Claude Code
Let Claude do it — paste this into Claude Code
Install the skill I found on Claude Skill Mart. Copy the skills/histolab folder from the GitHub repo K-Dense-AI/scientific-agent-skills into my ~/.claude/skills/histolab/. When it's done, tell me in one line what this skill can do.
Install with a command instead
git clone https://github.com/K-Dense-AI/scientific-agent-skills.git /tmp/scientific-agent-skills && mkdir -p ~/.claude/skills && cp -r /tmp/scientific-agent-skills/skills/histolab ~/.claude/skills/⚠ This is a third-party skill. Check the source repository before installing.
- Install the OpenSlide system libraries first (macOS:
brew install openslide, Ubuntu:sudo apt install openslide-tools). Windows is not supported by histolab 0.7.0. - In a Python 3.8–3.11 environment run
pip install histolab(addpip install poochfor the bundled TCGA sample slides). - Clone the skill repository:
git clone https://github.com/K-Dense-AI/scientific-agent-skills.git - Copy the skill folder into Claude:
mkdir -p ~/.claude/skills && cp -r scientific-agent-skills/skills/histolab ~/.claude/skills/ - Restart Claude Code and ask something like "use histolab to extract tiles from this slide" to trigger the skill.
- Verify the
references/directory came along — the detailed per-topic examples live there.
View source on GitHub ↗License: MIT