histolab
하는 일
이 스킬은 에이전트에게 전체 슬라이드 병리 이미지를 위한 Python 라이브러리 histolab을 제공합니다. 조직 영역을 찾고 큰 이미지를 작은 타일로 자릅니다. 병리 연구자와 머신러닝 팀을 위한 스킬입니다.
사용하는 경우
- ✓큰 전체 슬라이드 이미지에서 타일을 추출해야 할 때.
- ✓슬라이드의 조직 영역을 감지하고 마스크로 표시하고 싶을 때.
- ✓딥러닝 파이프라인을 위해 병리 이미지 데이터셋을 준비하고 있을 때.
스킬 링크
https://github.com/davila7/claude-code-templates/blob/main/cli-tool/components/skills/scientific/histolab/SKILL.md복사해서 AI(Claude, ChatGPT, Cursor)에 붙여넣고 지침을 따르도록 요청하세요.
사용 방법
가장 쉬운 방법입니다. 메시지를 복사해 AI에 붙여넣으세요. AI가 스킬을 읽고 지침을 따릅니다.
바로 붙여넣을 수 있는 메시지
Claude Code, Codex, Cursor용입니다. 프로젝트 폴더에서 실행하면 스킬이 설치됩니다.
SKILL.md를 다운로드해 에이전트의 스킬 폴더에 넣으세요.
AI에게 요청하는 예시
“이 SVS 슬라이드에서 빈 배경 영역은 건너뛰고, 512×512 타일 100개를 무작위로 뽑아 주세요.”
매주 새 스킬 5개. 읽는 데 1분.
작동 방식
에이전트는 슬라이드를 열고 조직 영역을 찾은 뒤, 선택한 전략으로 타일 위치를 고릅니다. 그다음 추출한 타일을 저장합니다.
기술 내용 (원본 SKILL.md)
작성자의 영어 원문을 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()
2. Tissue Detection and Masks
Automatically identify tissue regions and filter background/artifacts.
Common operations:
- Creating binary tissue masks
- Detecting largest tissue region
- Excluding background and artifacts
- Custom tissue segmentation
- Removing pen annotations
Key classes: TissueMask, BiggestTissueBoxMask, BinaryMask
Reference: references/tissue_masks.md contains comprehensive documentation on:
- TissueMask: Segments all tissue regions using automated filters
- BiggestTissueBoxMask: Returns bounding box of largest tissue region (default)
- BinaryMask: Base class for custom mask implementations
- Visualizing masks with
locate_mask() - Creating custom rectangular and annotation-exclusion masks
- Mask integration with tile extraction
- Best practices and troubleshooting
Example workflow:
from histolab.masks import TissueMask, BiggestTissueBoxMask
# Create tissue mask for all tissue regions
tissue_mask = TissueMask()
# Visualize mask on slide
slide.locate_mask(tissue_mask)
# Get mask array
mask_array = tissue_mask(slide)
# Use largest tissue region (default for most extractors)
biggest_mask = BiggestTissueBoxMask()
When to use each mask:
TissueMask: Multiple tissue sections, comprehensive analysisBiggestTissueBoxMask: Single main tissue section, exclude artifacts (default)- Custom
BinaryMask: Specific ROI, exclude annotations, custom segmentation
3. Tile Extraction
Extract smaller regions from large WSI using different strategies.
Three extraction strategies:
RandomTiler: Extract fixed number of randomly positioned tiles
- Best for: Sampling diverse regions, exploratory analysis, training data
- Key parameters:
n_tiles,seedfor reproducibility
GridTiler: Systematically extract tiles across tissue in grid pattern
- Best for: Complete coverage, spatial analysis, reconstruction
- Key parameters:
pixel_overlapfor sliding windows
ScoreTiler: Extract top-ranked tiles based on scoring functions
- Best for: Most informative regions, quality-driven selection
- Key parameters:
scorer(NucleiScorer, CellularityScorer, custom)
Common parameters:
tile_size: Tile dimensions (e.g., (512, 512))level: Pyramid level for extraction (0 = highest resolution)check_tissue: Filter tiles by tissue contenttissue_percent: Mini
자주 묻는 질문
어떤 슬라이드 형식을 지원하나요?
스킬은 SVS, TIFF, NDPI 등을 언급합니다.
타일 위치를 미리 볼 수 있나요?
네. 스킬은 타일이 추출될 위치를 미리 보여 주는 locate 단계를 포함합니다.
어떤 염색을 다루나요?
스킬은 H&E와 IHC로 염색된 조직 이미지를 언급합니다.
상세 정보
작성자의 원본 설명
Digital pathology image processing toolkit for whole slide images (WSI). Use this skill when working with histopathology slides, processing H&E or IHC stained tissue images, extracting tiles from gigapixel pathology images, detecting tissue regions, segmenting tissue masks, or preparing datasets for computational pathology deep learning pipelines. Applies to WSI formats (SVS, TIFF, NDPI), tile-based analysis, and histological image preprocessing workflows.
인기도
- GitHub 스타
- 33k
- 순위
- #8965
- 라이선스
- MIT
- 업데이트
- 2026. 11. 2.
댓글
- …
이 저장소의 다른 스킬
owasp-security
33k웹 앱, API, 모바일, 컨테이너, AI 에이전트를 위한 OWASP 보안 지침을 따르도록 해서, 흔한 약점을 찾고 수정안을 제안하게 합니다.
agent-management
33k에이전트가 AI Maestro 명령줄을 사용해 AI 에이전트를 만들고, 나열하고, 일시 정지하고, 깨우고, 이름을 바꾸고, 삭제하도록 돕습니다.
agent-messaging
33k에이전트가 Agent Messaging Protocol로 AI 에이전트 사이에 서명된 메시지를 보내고, 받고, 답하도록 돕습니다. 대부분 내 컴퓨터에서 작동합니다.
docs-search
33k에이전트가 자동 생성된 코드 문서에서 함수 시그니처, 클래스 정의, 주석을 검색하도록 해서, 코드를 바꾸기 전에 실제 API를 확인하게 합니다.
비슷한 스킬
gitcrawl
394k에이전트가 저장된 GitHub 이슈와 풀 리퀘스트 보관본을 검색하고, 중복 항목을 묶고, GitHub에서 현재 상태를 확인하도록 돕습니다.
slacrawl
394k에이전트가 로컬 Slack 보관본에서 메시지를 검색하고 개수를 세며, 보관본이 얼마나 최신인지 확인하고 필요할 때 새로 고치도록 돕습니다.
goplaces
394k에이전트가 Google Places로 장소를 검색하고, 세부 정보와 리뷰를 가져오고, 장소 이름을 확인하며, 스크립트용 JSON을 출력하도록 돕습니다.