본문으로 건너뛰기
Skillpedia
분석 및 스프레드시트51k · #3476

histolab

하는 일

Histolab은 현미경 슬라이드 이미지를 준비하는 도구입니다. 분석을 위해 이미지의 특정 부분(타일)을 선택하고, 일관성을 위해 색을 정규화하며, 향후 연구를 위해 데이터를 정리하도록 돕습니다.

사용하는 경우

  • ✓분석을 위해 슬라이드 이미지에서 특정 부분을 골라내야 할 때.
  • ✓여러 슬라이드 이미지의 색 표현을 표준화하고 싶을 때.
  • ✓인공지능 모델 학습을 위해 슬라이드 이미지 묶음을 정리할 때.

스킬 링크

https://github.com/K-Dense-AI/scientific-agent-skills/blob/main/skills/histolab/SKILL.md

복사해서 AI(Claude, ChatGPT, Cursor)에 붙여넣고 지침을 따르도록 요청하세요.

사용 방법

가장 쉬운 방법입니다. 메시지를 복사해 AI에 붙여넣으세요. AI가 스킬을 읽고 지침을 따릅니다.

바로 붙여넣을 수 있는 메시지

Use this skill to help me: https://github.com/K-Dense-AI/scientific-agent-skills/blob/main/skills/histolab/SKILL.md Read the SKILL.md file at that link and follow its instructions for my task.
AI가 이런 스킬을 알아서 찾아 쓰길 원하시나요?무료 Skillpedia MCP를 설치하세요. 한 줄이면 작업마다 스킬 15,000+개 중에서 검색합니다.1분 만에 설치 →

AI에게 요청하는 예시

“‘example.svs’ 슬라이드에서 조직이 최소 80%인 영역을 중심으로 512x512 픽셀 타일 100개를 무작위로 선택해 주세요.”

매주 새 스킬 5개. 읽는 데 1분.

작동 방식

Histolab은 먼저 슬라이드에서 조직 영역을 찾습니다. 그다음 무작위, 격자, 점수 기반 등 다양한 방법으로 추출할 이미지 조각을 고릅니다. 모든 이미지가 비슷해 보이도록 색을 조정할 수도 있습니다.

기술 내용 (원본 SKILL.md)

작성자의 영어 원문을 GitHub에서 그대로 가져왔습니다.

Histolab

When to use

Use Histolab to inspect WSI metadata, identify tissue, extract image tiles, and standardize H&E staining. Its masks and scores are image-processing heuristics; they do not diagnose cancer, count individual cells, or establish image quality.

Installation

Histolab 0.7.0 remains the latest published release as of the review date. Its release constraints require Python <3.12, NumPy <=1.24.4, scikit-image <0.19.4, SciPy <1.10.1, Pillow <11, and openslide-python 1.3.1. Keep this stack isolated from modern scientific environments. Windows is not supported by this Histolab release.

Install native OpenSlide for your system, then create a dedicated environment (Python 3.10 was tested):

uv venv --python 3.10 .venv-histolab
uv pip install --python .venv-histolab/bin/python 'histolab==0.7.0' pooch matplotlib
.venv-histolab/bin/python -c 'import openslide; print(openslide.__library_version__)'

On macOS with Homebrew, brew install openslide installs the native library. If the older Python binding cannot find it, launch Python with the library path set immediately before Python starts:

env DYLD_FALLBACK_LIBRARY_PATH="$(brew --prefix openslide)/lib" .venv-histolab/bin/python -c 'import openslide; print(openslide.__library_version__)'

pooch is optional for remote examples. Start with a local slide or the tiny bundled cmu_small_region sample; other sample functions may download hundreds of megabytes. Exact mpp extraction also needs large-image and a matching source plugin; see slide management.

Workflow

  1. Inspect slide.dimensions, slide.levels (a list), and slide.level_dimensions(level) (a method). Check both MPP axes in metadata.
  2. Select physical field of view and pixel resolution; level numbers are not interchangeable across scanners. Preserve level-0 coordinate bounds.
  3. Choose TissueMask for all tissue sections or BiggestTissueBoxMask for the largest section's bounding box. Inspect the mask at its actual resolution.
  4. Configure a tiler and preview with the same mask passed to extraction. Preview methods return a Pillow image; save or display that return value.
  5. Extract into a distinct per-slide/per-strategy directory. Count saved files, inspect representative tiles, and retain parameters, source IDs and QC flags.
  6. Split datasets by patient before training/validation/test tile assignment. Fit stain normalization targets on training data only and validate on held-out scanners. A seed reproduces sampling; it does not prevent patient leakage.

Quick start

Illustrative for a user-provided slide; the same API path is tested with small local fixtures. n_tiles is an upper bound, not a promise of 100 valid tiles.

from pathlib import Path
from histolab.slide import Slide
from histolab.masks import TissueMask
from histolab.tiler import RandomTiler

output = Path("output/random_tiles")
output.mkdir(parents=True, exist_ok=True)
slide = Slide("slide.svs", processed_path=output)
mask = TissueMask()
slide.locate_mask(mask).save(output / "mask_preview.png")

tiler = RandomTiler(
    tile_size=(512, 512), n_tiles=100, level=0, seed=42,
    check_tissue=True, tissue_percent=80.0, prefix="random_",
)
tiler.locate_tiles(slide, extraction_mask=mask).save(output / "tile_preview.png")
tiler.extract(slide, extraction_mask=mask)
print("[OK] Saved tiles:", len(list(output.glob("random_tile_*.png"))))

extraction_mask belongs to extract() and locate_tiles(), not to the tiler constructor. locate_tiles() has no n_tiles argument. Previewing runs tile selection again, so it may be expensive; use a separate small tiler for initial exploration, then preview the final configuration before committing a large run.

Choose a strategy

Tiler Selection Important limitation
RandomTiler Seeded sampling, at most n_tiles, up to max_iter attempts May overlap, repeat, or miss rare structures
GridTiler Grid within the extraction mask Boundary tiles and tissue checks can leave gaps
ScoreTiler Scores all eligible grid candidates; saves top n_tiles Lower output count does not avoid scoring all candidates

For grids, stride in each axis is tile size minus pixel_overlap; positive

…

자주 묻는 질문

Histolab이 질병을 진단할 수 있나요?

아닙니다. Histolab은 질병을 진단하지 않습니다. 이미지를 준비하고 분석하는 도구이며, 의학적 진단을 내리는 용도가 아닙니다.

어느 컴퓨터에서나 Histolab을 쓸 수 있나요?

최신 버전(0.7.0)은 Windows와 호환되지 않으며, 다른 Python 라이브러리의 특정 버전이 필요합니다. 별도의 환경을 만들어 사용하는 것을 권장합니다.

‘타일’이란 무엇인가요?

‘타일’은 더 큰 이미지에서 잘라낸 작은 조각이나 사각형입니다. Histolab에서는 분석을 위해 추출한 현미경 슬라이드 이미지의 부분을 말합니다.

상세 정보

작성자의 원본 설명

Extracts and preprocesses whole-slide histology image tiles with Histolab. Use for WSI inspection, tissue masks, random/grid/score-based tile extraction, H&E stain normalization, and tile dataset preparation. For multiplexed imaging or deep learning inference pipelines, use pathml.

repo: K-Dense-AI/scientific-agent-skills

인기도

GitHub 스타
51k
순위
#3476
라이선스
MIT
업데이트
2026. 10. 15.

이 스킬이 유용한가요?

0

로그인 투표하려면 로그인하세요.

댓글

  • …

이 저장소의 다른 스킬

비슷한 스킬