histolab

Automate tissue detection, mask generation, and tile extraction from whole slide images.

2|Updated Jun 4, 2026
One-click install
npx skills add https://github.com/Lord1Egypt/scientific-agent-toolkit --skill histolab-lord1egypt
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: histolab
Source: https://github.com/Lord1Egypt/scientific-agent-toolkit/tree/main/scientific-skills/histolab
Command: npx skills add https://github.com/Lord1Egypt/scientific-agent-toolkit --skill histolab-lord1egypt

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires histolab, openslide, numpy, matplotlib, pillow, opencv-python, and includes references (resource) components.

What problem does it solve?

This Skill addresses the complexity of processing gigapixel whole slide images (WSI) by automating tissue detection, tile extraction, and image preprocessing, which are essential for digital pathology and deep learning pipelines.

Core Features & Use Cases

  • Intelligent Tile Extraction: Supports random, grid-based, and score-based extraction strategies to optimize dataset quality.
  • Advanced Preprocessing: Includes a robust suite of image and morphological filters for stain normalization, artifact removal, and nuclei enhancement.
  • Use Case: Researchers can use this to automatically extract thousands of high-quality, tissue-rich tiles from a collection of H&E stained slides, ensuring consistent input for training deep learning models.

Quick Start

Use the histolab skill to extract 100 random tiles of size 512 by 512 from the slide file named sample.svs and save them to the output directory.

Frequently Asked Questions about histolab

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I extract tiles from whole slide images for deep learning?

Tile extraction from whole slide images is automated through tissue detection, mask generation, and morphological filters to yield tissue-rich, high-fidelity tiles for deep learning pipelines. It supports random, grid-based, and score-based extraction strategies to optimize dataset quality.

What is the best way to preprocess histopathology slides for dataset curation?

The best way to preprocess histopathology slides is using morphological and intensity-based filters for stain normalization, artifact removal, and nuclei enhancement. This ensures consistent input and high-fidelity data preparation for training deep learning models.

Can I use OpenSlide to process gigapixel WSI files for spatial analysis?

Yes, you can use OpenSlide to process gigapixel WSI files for spatial analysis by integrating it with automated tissue detection and mask generation. This handles complex image processing pipelines required for large-scale digital pathology workflows.

Does automated tissue detection work with random and grid-based tile extraction?

Automated tissue detection works seamlessly with random, grid-based, and score-based tile extraction strategies by applying morphological and intensity-based filters to generate accurate tissue masks, ensuring only tissue-rich tiles are collected from whole slide images.

Why do I need morphological filters for whole slide image processing?

Morphological filters are needed for whole slide image processing to perform stain normalization, artifact removal, and nuclei enhancement. They ensure high-fidelity data preparation by isolating valid tissue regions before applying tile extraction strategies.

How do I extract 512 by 512 random tiles from an SVS slide file?

To extract 512 by 512 random tiles from an SVS slide file, you apply automated tissue detection to generate masks, then configure the tile extraction strategy to randomly sample and save tissue-rich tiles to your specified output directory.