histolab

A Python library for processing whole-slide images, which are very large digital scans used in pathology. It finds tissue, cuts slides into smaller image tiles, and prepares them for analysis or machine-learning datasets.

In plain words
What is it for?
Use it to load common slide formats, inspect slide details, create previews, detect tissue, extract tiles, and prepare pathology images for model training.
Why use it?
It avoids manually locating useful tissue regions and extracting thousands of manageable image pieces from gigapixel slides. It also supports basic preparation such as stain normalization for H&E slides.

Skill for Claude CodeCodex

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add skills/synthetic-sciences/openscience/histolab
Any agent
npx skills add synthetic-sciences/openscience --skill histolab
Clone the repo
git clone --depth 1 https://github.com/synthetic-sciences/openscience

Made for: Claude Code, Codex.

Per session 62 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 4,498 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5 $0.00062 $0.04498
Opus 5 $0.00031 $0.02249
Sonnet 5 $0.00012 $0.00900
Haiku 4.5 $0.00006 $0.00450

Measured 3d ago against content hash 4721a7cf35db, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

histolab scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 3d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

Origin

Copies of this mod

6 near-identical copies found in the catalogue:

  • histolab — 98% identical, 3 lines differ
  • histolab — 98% identical, 3 lines differ
  • histolab — 95% identical, 58 lines differ
  • histolab — 95% identical, 58 lines differ
  • histolab — 95% identical, 6 lines differ
  • histolab — 94% identical, 7 lines differ
backend/cli/skills/biology/histolab/SKILL.md · 678 lines

How it starts

The opening of the file, as written. The whole thing — 678 lines — stays where its author put it; the contents beside it link to each section on GitHub.

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

uv pip install histolab

Quick Start

Basic workflow for extracting tiles from a whole slide image:

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

1. Slide Management

Load, inspect, and work with whole slide images in various formats.

Common operations:

  • Loading WSI files (SVS, TIFF, NDPI, etc.)
  • Accessing slide metadata (dimensions, magnification, properties)
  • Generating thumbnails for visualization
  • Working with pyramidal image structures
  • Extracting regions at specific coordinates

Key classes: Slide

Reference: references/slide_management.md contains comprehensive documentation on:

  • Slide initialization and configuration
  • Built-in sample datasets (prostate, ovarian, breast, heart, kidney tissues)
  • Accessing slide properties and metadata
  • Thumbnail generation and visualization
  • Working with pyramid levels
  • Multi-slide processing workflows

Example workflow:

from histolab.slide import Slide
from histolab.data import prostate_tissue

# Load sample data
prostate_svs, prostate_path = prostate_tissue()

# Initialize slide
slide = Slide(prostate_path, processed_path="output/")

# Inspect properties
print(f"Dimensions: {slide.dimensions}")
print(f"Levels: {slide.levels}")
print(f"Magnification: {slide.properties.get('openslide.objective-power')}")

# Save thumbnail
slide.save_thumbnail()

Read the full file on GitHub · 678 lines

Files

What ships with it

5 files beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 3d ago First seen · 678 lines · 62 tokens per session scan A 4721a7cf35db

Subscribe to this mod's changes

histolab is a skill published in the GitHub repository synthetic-sciences/openscience (3,385 stars, last pushed yesterday), licensed Apache-2.0. It adds 62 tokens to every session and 4,498 once invoked, about $0.0003 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.

Related

Other skills, from other repositories

Gene Panel Selection Workflow

End-to-end workflow for gene panel design in scRNA-seq and spatial transcriptomics, that should be STRICTLY followed: dataset understanding + smart downsampling + train/test splits, algorithmic selection (HVG/DE/RF/scGeneFit/SpaPROS), optimal sub-panel discovery (ARI vs size), biological completion with a stability…

aristoteleo/PantheonOS · 110 tokens

bioprobench

Score an LLM's biological-protocol reasoning on the BioProBench benchmark: protocol QA, step ordering, error detection, protocol generation, and LLM-judged error reasoning; or generate the responses.

PKU-YuanGroup/OpenAI4S · 46 tokens

cerna-analysis

Use when building a ceRNA regulatory network from a key gene list by combining bundled miRNA-mRNA and miRNA-lncRNA database files, with flat-file CSV exports and PDF visualization in a single output directory. NOT for: differential expression, single-cell analysis, enrichment analysis, or workflows without a key gene…

aipoch/medical-research-skills · 68 tokens

elastic-net-feature-selection

Use when selecting predictive genes or other molecular features from bulk expression matrices for binary case-vs-control classification with elastic net logistic regression, including coefficient path and cross-validation plots. Trigger keywords: elastic net, glmnet, feature selection, binary classification…

aipoch/medical-research-skills · 83 tokens

byted-ark-trainer

基于arksdk的大模型训练任务自动化工具。帮助用户通过自然语言创建并提交方舟模型训练任务,支持用户自备数据的SFT训练、RFT+GRPO和直接GRPO策略,并引导用户完成训练、状态跟踪与评估闭环。使用场景:当用户需要进行大模型SFT监督微调、RLHF训练、GRPO训练、RFT训练,或需要自动化训练流程时触发。.

bytedance/agentkit-samples · 107 tokens

SC Best Practices Skills Index

Skills derived from the Single-cell Best Practices book (sc-best-practices.org). Comprehensive workflows and guidelines for single-cell and spatial omics analysis.

aristoteleo/PantheonOS · 37 tokens