alterlab-histolab — independently scanned and version-tracked by SaferSkills.
SaferSkills independently audited alterlab-histolab (Agent Skill) and scored it 100/100 (green). The audit ran 55 deterministic rules across Security, Supply Chain, Maintenance, Transparency, and Community; it found 0 high-severity and 0 lower-severity findings. The full rule-by-rule trace and per-finding evidence are below. Free, methodology-open.
Findings & checks · 0 flagged
Every scanned point with the score it earned and what moved between them.
First recorded scan — no prior version to compare against.
The primary manifest — the file an agent reads to learn what this artifact does.
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.
Use histolab for lightweight WSI tile pipelines: tissue detection, building tile datasets for ML training, H&E stain handling, and quick tile-based analysis of histopathology slides. For advanced spatial proteomics, multiplexed imaging, or full deep-learning pathology pipelines, use pathml instead.
uv pip install "histolab==0.7.0"histolab wraps the OpenSlide C library, which is not bundled with the pip package. On macOS install it with brew install openslide; without it, any import histolab.slide fails with Couldn't locate OpenSlide dylib. The examples below are pinned to histolab 0.7.0; the API differs in older releases.
Slide(path, processed_path=...) and inspect dimensions/levels.TissueMask or BiggestTissueBoxMask).tiler.locate_tiles(slide) before committing.Minimal example:
from histolab.slide import Slide
from histolab.tiler import RandomTiler
slide = Slide("slide.svs", processed_path="output/")
# n_tiles, level, seed are CONSTRUCTOR args — not args to locate_tiles/extract.
tiler = RandomTiler(tile_size=(512, 512), n_tiles=100, level=0, seed=42)
tiler.locate_tiles(slide) # preview locations on the thumbnail first
tiler.extract(slide) # writes PNGs into processed_pathAPI gotcha (histolab 0.7.0): locate_tiles() and extract() take only slide, an optional extraction_mask, and logging/styling kwargs — they do not accept n_tiles. Set n_tiles (and seed, level, tile_size, check_tissue, tissue_percent) on the tiler constructor. The extraction_mask is passed to extract()/locate_tiles(), never to the constructor.
Full copy-pasteable pipelines (quick start, 5 end-to-end workflows, and per-capability examples) live in references/workflows.md.
Load, inspect, and work with WSI files (SVS, TIFF, NDPI, etc.): access metadata (dimensions, magnification, properties), generate thumbnails, and work with pyramidal/multi-level structures. Key class: Slide.
See references/slide_management.md for slide initialization, built-in sample datasets (prostate_tissue, ovarian_tissue, breast_tissue, heart_tissue, aorta_tissue, plus pen-marked and IHC samples), pyramid levels, and multi-slide processing.
Automatically identify tissue regions and filter background/artifacts. Key classes: TissueMask (all tissue regions), BiggestTissueBoxMask (bounding box of largest region — the default), and BinaryMask (base class for custom masks).
Choosing a mask:
TissueMask: multiple tissue sections, comprehensive analysisBiggestTissueBoxMask: single main section, exclude artifacts (default)BinaryMask: specific ROI, exclude annotations, custom segmentationSee references/tissue_masks.md for how detection filters work, visualizing masks with locate_mask(), and custom rectangular / annotation-exclusion masks.
Extract smaller regions from large WSI using one of three strategies:
diverse regions, exploration, training data. Key params: n_tiles, seed.
spatial analysis, reconstruction. Key param: pixel_overlap.
regions, quality-driven selection. Key param: scorer (NucleiScorer, CellularityScorer, custom).
Common parameters: tile_size, level (0 = highest res), check_tissue, tissue_percent (default 80%), extraction_mask. Always preview with `locate_tiles()` before extracting.
See references/tile_extraction.md for scorers, reporting, and advanced (multi-level, hierarchical) extraction patterns.
Apply image-processing filters for tissue detection, QC, and preprocessing:
RgbToGrayscale, RgbToHsv, RgbToHed, OtsuThreshold,Invert, StretchContrast, HistogramEqualization, Lambda.
BinaryDilation, BinaryErosion, BinaryOpening,BinaryClosing, RemoveSmallObjects, RemoveSmallHoles.
Compose (in histolab.filters.image_filters) chainsfilters into pipelines. Pass custom filters to a mask as positional varargs: TissueMask(RgbToGrayscale(), OtsuThreshold(), ...).
See references/filters_preprocessing.md for filter chaining, common pipelines (tissue detection, pen removal, nuclei enhancement), and QC filters.
Display slides, masks, tile locations, and extraction quality: thumbnails, mask overlays via locate_mask(), tile-location previews via locate_tiles(), tile mosaics, and score distributions.
See references/visualization.md for mosaics, quality-assessment plots, multi-slide comparison, and exporting high-resolution figures / PDF reports.
references/workflows.md — quick start, per-capability examples, and 5end-to-end worked workflows (exploratory, grid, score-driven, multi-slide, custom tissue detection).
references/slide_management.md — loading/inspecting slides, sample datasets,pyramid levels, multi-slide processing.
references/tissue_masks.md — TissueMask/BiggestTissueBoxMask/BinaryMask,custom masks, mask visualization and integration.
references/tile_extraction.md — Random/Grid/Score tiler comparison, scorers,CSV reporting, advanced extraction patterns.
references/filters_preprocessing.md — image + morphological filters, filtercomposition, preprocessing pipelines, QC filters.
references/visualization.md — thumbnails, mask/tile previews, mosaics,quality plots, figure export.
references/best_practices.md — best practices, common use cases, andtroubleshooting (no tiles, background tiles, slow extraction, artifacts).
Load the specific reference file you need for detailed implementation guidance, troubleshooting, or advanced features.
~30 seconds. Free. No account. Every finding cites a rule and a line of evidence.