技能创建器
skill-creator
创建、改进和评估自定义技能,把专业流程转化为可重复使用的 AI 能力。
wsi-io【数据与研究】Use TIAToolbox for whole-slide image reading, metadata, resolutions, thumbnails, tiles, region reads, multichannel inputs, and registration setup.
独立 GitHub 快照 · 自动分类 · 以原作者文档为准
Use this sub-skill when a task needs to open pathology whole-slide images or image-like arrays, inspect WSI metadata, select a reader, choose resolution units, read crops, create thumbnails or tiles, diagnose multichannel reads, or prepare image pairs for registration.
WSIReader.open, OpenSlideWSIReader, or VirtualWSIReader.WSIMeta, wsi.info, slide-info, and resolution conversion helpers.mpp, power, level, and baseline units for safe crop dimensions.read_rect, read_bounds, read_region, slide_thumbnail, slide-thumbnail, save_tiles, and read-bounds.post_proc=None versus RGB conversion.DFBRegister registration and diagnosing transform ordering.image-preprocessing for tissue masks, stain normalization, stain augmentation, patch extraction, and preprocessing validation.model-inference for patch predictors, semantic segmentors, nucleus detectors, feature extractors, and inference engine batching.annotation-visualization for overlays, annotation stores, tile server visualization, and rendered review views.cli-and-configuration for exhaustive CLI option tables, shared command flags, config conventions, and command orchestration.references/api-reference.md summarizes reader selection, metadata fields, read APIs, resolution semantics, CLI entry points, and registration APIs.references/workflows.md gives copyable recipes for metadata inspection, safe crops, thumbnails, tiles, multichannel reads, and registration setup.references/troubleshooting.md maps common WSI I/O failures to concrete checks and fixes.scripts/wsi_io_smoke.py runs a tiny in-memory VirtualWSIReader smoke check without network access or WSI downloads.import numpy as np
from tiatoolbox.wsicore.wsireader import WSIReader
wsi = WSIReader.open("slide.svs")
print(wsi.info.as_dict())
# Fixed output size; field of view changes with resolution.
patch = wsi.read_rect((10_000, 20_000), (512, 512), resolution=0.5, units="mpp")
# Fixed baseline field of view; output size changes with resolution.
region = wsi.read_bounds((10_000, 20_000, 12_000, 22_000), resolution=1, units="level")
# For arrays, masks, thumbnails, and small fixtures, use the virtual reader path.
array_reader = WSIReader.open(np.zeros((128, 192, 3), dtype=np.uint8), mpp=(0.5, 0.5))
thumbnail = array_reader.slide_thumbnail(resolution=1.0, units="baseline")
Before a large read, confirm wsi.info.slide_dimensions, available level_downsamples, whether mpp or objective_power exists, and whether the requested output is bounded enough to fit memory.