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.
npx skills add majiayu000/claude-skill-registry --skill histolab-k-dense-ai-scientific-agent-ski-2 --agent claude-code
Same command for any agent — swap --agent for codex, cursor, copilot.
Weekly change comes from our own snapshots, not the repository page — it measures attention, not adoption.
What it does
Provides a Python-based workflow for loading whole slide images, detecting tissue regions, extracting tiles with various tiling strategies (RandomTiler, GridTiler, ScoreTiler), applying preprocessing filters, and performing stain normalization. It includes utilities for visualization and basic workflow examples, aimed at preparing datasets and quick tile-based analyses.
How it works
- Loads WSIs using a Slide class and supports multiple formats.
- Detects tissue regions via TissueMask variants and can select the largest region by default.
- Extracts tiles using three strategies: RandomTiler, GridTiler, and ScoreTiler, with common parameters like tile_size, level, check_tissue, and tissue_percent. Shows how to preview with locate_tiles() and perform extraction with extract(), optionally saving a report.
- Applies preprocessing via a pipeline of image and morphological filters (RgbToGrayscale, OtsuThreshold, BinaryDilation, RemoveSmallHoles, RemoveSmallObjects, etc.) and supports composing filters with Compose.
- Performs stain normalization through MacenkoStainNormalizer or ReinhardStainNormalizer, fit on a target image, then transform a source image.
- Visualizes slides, masks, and tiles, with examples for thumbnails and mask localization (locate_mask, locate_tiles).
When to use it
Use when you need lightweight WSI tile extraction and basic preprocessing for simple pipelines, dataset preparation, or quick tile-based analysis. For advanced spatial proteomics, multiplexed imaging, or deep learning pipelines, consider alternative tools (e.g., pathml).
What it can touch
- Tools mentioned: Slide, TissueMask, Bigg estTissueBoxMask, BinaryMask, RandomTiler, GridTiler, ScoreTiler, NucleiScorer, TissueMask, MacenkoStainNormalizer, ReinhardStainNormalizer, and visualization utilities.
- Files and names quoted exactly as in the skill: OpenSlide libraries, pooch for sample data, and specific class names and methods like Slide, RandomTiler, GridTiler, ScoreTiler, TissueMask, locate_mask, locate_tiles, extract, and thumbnail handling.
Caveats
- Requires Python 3.8–3.11 and histolab 0.7.0, OpenSlide libraries, Linux or macOS; Windows not supported as of 0.7.0.
- Sample data via histolab.data requires pooch.
- Windows compatibility and runtime limitations not stated beyond the above.
# 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) ``` #
- Overview
- Installation
- Quick Start
- Core Capabilities
- 1. Slide Management
- 2. Tissue Detection and Masks
- 3. Tile Extraction
- 4. Filters and Preprocessing
- 5. Stain Normalization
- 6. Visualization
- Typical Workflows
- Workflow 1: Exploratory Tile Extraction
- Workflow 2: Comprehensive Grid Extraction
- Workflow 3: Quality-Driven Tile Selection
uv pip install histolab uv pip install pooch
What does the histolab skill do?
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.
How do I install it?
Run `npx skills add majiayu000/claude-skill-registry --skill histolab-k-dense-ai-scientific-agent-ski-2 --agent claude-code` — it drops the skill into your project so the agent can pick it up. Swap the --agent value for codex, cursor or copilot if you use one of those.
Where does this skill come from?
From majiayu000/claude-skill-registry, a repository with 534 stars. We read it straight from the repository tree rather than a submitted listing, so what you see here is what is actually published.
Is a popular skill a good skill?
Not necessarily. Stars measure attention, not adoption — a repository can trend for a week and be abandoned. That is why we show the weekly change from our own snapshots next to the total, instead of a single flattering number.
