[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill-aws-labs-digital-pathology":3,"mdc-b72r5y-key":49,"related-repo-aws-labs-digital-pathology":2764,"related-org-aws-labs-digital-pathology":2863},{"slug":4,"name":4,"fn":5,"description":6,"org":7,"tags":12,"stars":26,"repoUrl":27,"updatedAt":28,"license":29,"forks":30,"topics":31,"repo":44,"sourceUrl":47,"mdContent":48},"digital-pathology","analyze whole-slide images with foundation models","Generate correct code for whole-slide image (WSI) analysis using TIAToolbox and foundation models (H-optimus-0, UNI, Prov-GigaPath). Triggers on requests involving whole-slide images, WSI, digital pathology, histopathology, SVS\u002FNDPI\u002Fpyramidal TIFF, tissue segmentation, patch extraction, stain normalization, H-optimus-0, TIAToolbox, CAMELYON16\u002F17, SlideGraph, MIL aggregation, HoVer-Net, PanNuke, or SageMaker deployment of pathology models. Produces deterministic commands and Python snippets for slide-info inspection, tissue masking, tile extraction at specified mpp, foundation-model feature embedding, slide-level aggregation, and regulated cloud inference.",{"slug":8,"name":9,"logoUrl":10,"githubOrg":11},"aws-labs","AWS Labs","https:\u002F\u002Fpexgzepcugksgbtrxkhf.supabase.co\u002Fstorage\u002Fv1\u002Fobject\u002Fpublic\u002Forg-logos\u002Faws-labs.png","awslabs",[13,17,20,23],{"name":14,"slug":15,"type":16},"Research","research","tag",{"name":18,"slug":19,"type":16},"Healthcare","healthcare",{"name":21,"slug":22,"type":16},"Life Sciences","life-sciences",{"name":24,"slug":25,"type":16},"Computer Vision","computer-vision",4,"https:\u002F\u002Fgithub.com\u002Fawslabs\u002Fhcls-agent-skills","2026-07-12T08:37:40.246467",null,0,[32,33,34,35,36,37,38,39,40,22,41,42,43],"agent-skills","agentcore","ai-agents","amazon-quick-desktop","claims-processing","drug-discovery","genomics","healthcare-ai","kiro","medical-imaging","risk-adjustment","strands-agents",{"repoUrl":27,"stars":26,"forks":30,"topics":45,"description":46},[32,33,34,35,36,37,38,39,40,22,41,42,43],"Agent skills for healthcare and life sciences: genomics, imaging, claims, drug discovery, and more. Works with Amazon Quick, Kiro, Amazon AgentCore, AWS Strands SDK, Claude Code, Codex, and any Agent Skills-compatible platform.","https:\u002F\u002Fgithub.com\u002Fawslabs\u002Fhcls-agent-skills\u002Ftree\u002FHEAD\u002Fskills\u002Fdigital-pathology","---\nname: digital-pathology\ndescription: Generate correct code for whole-slide image (WSI) analysis using TIAToolbox and foundation models (H-optimus-0, UNI, Prov-GigaPath). Triggers on requests involving whole-slide images, WSI, digital pathology, histopathology, SVS\u002FNDPI\u002Fpyramidal TIFF, tissue segmentation, patch extraction, stain normalization, H-optimus-0, TIAToolbox, CAMELYON16\u002F17, SlideGraph, MIL aggregation, HoVer-Net, PanNuke, or SageMaker deployment of pathology models. Produces deterministic commands and Python snippets for slide-info inspection, tissue masking, tile extraction at specified mpp, foundation-model feature embedding, slide-level aggregation, and regulated cloud inference.\nusage: Invoke when analyzing whole-slide images, extracting tiles, running foundation-model embeddings, or deploying pathology models on SageMaker.\nversion: 1.0.0\nvalidated_against:\n  date: 2025-01-15\n  packages: {tiatoolbox: \"1.5\", openslide: \"4.0\"}\ntags: [skill, category:pipeline, digital-pathology, tiatoolbox, h-optimus-0, whole-slide-image, hcls]\n---\n\n# Digital Pathology\n\n## Overview\n\nThis skill teaches the agent to generate correct, runnable code for whole-slide image (WSI) pipelines. It covers TIAToolbox CLI and Python API, the H-optimus-0 foundation model, the standard tissue→tiles→features→aggregate→predict pattern, the CAMELYON datasets, and SageMaker deployment patterns for regulated workloads.\n\nDefault to TIAToolbox primitives (`WSIReader`, `PatchPredictor`, `DeepFeatureExtractor`) rather than reimplementing slide I\u002FO. Default to H-optimus-0 at 0.5 mpp \u002F 224×224 unless the task specifies otherwise.\n\n## Usage\n\nInvoke this skill when the user asks to:\n\n- Inspect, tile, or stain-normalize a WSI (SVS, NDPI, MRXS, pyramidal TIFF).\n- Extract features with a pathology foundation model.\n- Build a slide-level classifier on CAMELYON or similar cohorts.\n- Deploy a WSI model to AWS SageMaker.\n\nAsk for clarification only if the resolution, model, or output artifact is ambiguous. Otherwise apply the defaults in the Resolution Rules section.\n\n\n## Response Format\n\n- Lead with the command or code the user needs — explain after\n- Structure as: confirm inputs → working code → key parameters explained → gotchas\n- One complete working example per task; do not show every alternative\n- Keep code comments minimal and functional (what, not why-it-exists)\n- Target: 50-100 lines of code with brief surrounding explanation\n\n## Core Concepts\n\n- **Pyramidal WSI**: multi-resolution image (levels). `baseline` = level 0 (native, finest). Addressing uses `resolution` + `units ∈ {mpp, power, level, baseline}`.\n- **mpp**: microns per pixel. `0.5 mpp ≈ 20×`, `0.25 mpp ≈ 40×`. Downsample = `baseline_mpp \u002F target_mpp`.\n- **Tissue mask**: binary foreground mask computed at low resolution (e.g., Otsu at 1.25× or 4 mpp) to skip background tiles.\n- **Patch \u002F tile**: fixed-size crop (e.g., 224×224) read at a target mpp, used as model input.\n- **Foundation model embedding**: per-tile feature vector from a pretrained ViT (H-optimus-0 → 1536-d).\n- **Aggregation**: slide-level prediction from tile features (ABMIL, CLAM, TransMIL, SlideGraph).\n\n## Quick Reference — Standard Pipeline\n\nCopy-adapt this end-to-end pattern for any WSI classification task:\n\n```python\nimport torch\nfrom tiatoolbox.wsicore.wsireader import WSIReader\nfrom tiatoolbox.models.architecture.vanilla import TimmBackbone\nfrom tiatoolbox.models.engine.semantic_segmentor import IOSegmentorConfig\nfrom tiatoolbox.models.engine.patch_predictor import IOPatchPredictorConfig\nfrom tiatoolbox.models import DeepFeatureExtractor\n\nSLIDE = \"slide.svs\"\nOUT = \".\u002Fout\"\nDEVICE = \"cuda\" if torch.cuda.is_available() else \"cpu\"\n\n# 1. Inspect\nreader = WSIReader.open(SLIDE)\ninfo = reader.info.as_dict()\nprint(info[\"mpp\"], info[\"level_dimensions\"])\n\n# 2. Tissue mask (Otsu at low res — do NOT pass as external mask)\nmask_reader = reader.tissue_mask(method=\"otsu\", resolution=4, units=\"mpp\")\n\n# 3. Tile + extract H-optimus-0 features @ 0.5 mpp, 224x224\nioconfig = IOPatchPredictorConfig(\n    input_resolutions=[{\"units\": \"mpp\", \"resolution\": 0.5}],\n    patch_input_shape=[224, 224],\n    stride_shape=[224, 224],\n)\nextractor = DeepFeatureExtractor(\n    model=TimmBackbone(\"H-optimus-0\", pretrained=True),\n    batch_size=16,\n    num_loader_workers=4,\n)\noutput = extractor.run(\n    images=[SLIDE],\n    masks=[mask_reader],\n    patch_mode=False,\n    ioconfig=ioconfig,\n    save_dir=OUT,\n    device=DEVICE,\n)\n# output[0] -> (positions.npy, features.npy)\n```\n\nThen aggregate (ABMIL \u002F SlideGraph \u002F mean-pool) on `features.npy` for a slide-level prediction.\n\n## TIAToolbox CLI\n\nAll CLI commands accept `--img-input` (file or dir), `--output-path`, `--resolution`, `--units`, `--batch-size`, `--device cuda`.\n\n```bash\n# Slide metadata\ntiatoolbox slide-info --img-input slide.svs --mode show\n\n# Tissue mask (binary PNG)\ntiatoolbox tissue-mask --img-input slide.svs --output-path .\u002Fmask --method otsu \\\n  --resolution 1.25 --units power\n\n# Tile classification with built-in ResNet18 on Kather100k\ntiatoolbox patch-predictor --img-input slide.svs \\\n  --pretrained-model resnet18-kather100k \\\n  --output-path .\u002Fpred --batch-size 32 --device cuda \\\n  --resolution 0.5 --units mpp\n\n# Stain normalization (Reinhard \u002F Macenko \u002F Vahadane)\ntiatoolbox stain-norm --img-input tiles\u002F --method reinhard --output-path .\u002Fnorm\n```\n\nUse `--units baseline` when inputs are pre-extracted PNG tiles to avoid an \"unknown scale\" warning.\n\n## TIAToolbox Python API\n\n### WSIReader\n\n```python\nfrom tiatoolbox.wsicore.wsireader import WSIReader\n\nreader = WSIReader.open(\"slide.svs\")\nreader.info.as_dict()                              # mpp, levels, vendor\nreader.slide_dimensions(resolution=0.5, units=\"mpp\")\n\ntile = reader.read_rect(\n    location=(10000, 10000),    # baseline coords\n    size=(224, 224),\n    resolution=0.5, units=\"mpp\",\n)\nregion = reader.read_bounds(\n    bounds=(0, 0, 4096, 4096),\n    resolution=2.0, units=\"mpp\",\n)\nmask = reader.tissue_mask(method=\"otsu\", resolution=4, units=\"mpp\")\n```\n\n### PatchPredictor\n\n```python\nfrom tiatoolbox.models import PatchPredictor\nfrom tiatoolbox.models.engine.patch_predictor import IOPatchPredictorConfig\n\nioconfig = IOPatchPredictorConfig(\n    input_resolutions=[{\"units\": \"mpp\", \"resolution\": 0.5}],\n    patch_input_shape=[224, 224],\n    stride_shape=[224, 224],\n)\npredictor = PatchPredictor(pretrained_model=\"resnet18-kather100k\", batch_size=32)\nout = predictor.run(\n    images=[\"slide.svs\"], masks=[mask],\n    patch_mode=False, ioconfig=ioconfig,\n    save_dir=\".\u002Fpred\", device=\"cuda\",\n)\n```\n\n### DeepFeatureExtractor + TimmBackbone\n\n```python\nfrom tiatoolbox.models import DeepFeatureExtractor\nfrom tiatoolbox.models.architecture.vanilla import TimmBackbone\n\nextractor = DeepFeatureExtractor(\n    model=TimmBackbone(\"H-optimus-0\", pretrained=True),\n    batch_size=16, num_loader_workers=4,\n)\n```\n\n### SlideGraph construction\n\n```python\nimport numpy as np\nfrom tiatoolbox.tools.graph import SlideGraphConstructor\n\npositions = np.load(\"out\u002F0.position.npy\")   # (N, 4) x1,y1,x2,y2\nfeatures  = np.load(\"out\u002F0.features.npy\")   # (N, D)\ngraph = SlideGraphConstructor.build(\n    positions=positions[:, :2], features=features,\n)\n# graph -> {\"x\": features, \"edge_index\": (2,E), \"coords\": (N,2)}\n```\n\n### Stain normalization\n\n```python\nfrom tiatoolbox.tools.stainnorm import get_normalizer\n\nnorm = get_normalizer(\"reinhard\")   # or \"macenko\", \"vahadane\"\nnorm.fit(target_tile)               # RGB ndarray HxWx3\nnormed = norm.transform(source_tile)\n```\n\n## H-optimus-0 Foundation Model\n\n1.1B-parameter ViT-G\u002F14, input **224×224 RGB at 0.5 mpp**, output **1536-d** embedding. License is gated — accept terms on Hugging Face and run `huggingface-cli login`.\n\n### Direct timm usage\n\n```python\nimport timm, torch\nfrom torchvision import transforms\n\nmodel = timm.create_model(\n    \"hf-hub:bioptimus\u002FH-optimus-0\",\n    pretrained=True,\n    init_values=1e-5,\n    dynamic_img_size=False,\n).eval().to(\"cuda\")\n\npreprocess = transforms.Compose([\n    transforms.ToTensor(),\n    transforms.Normalize(\n        mean=(0.707223, 0.578729, 0.703617),\n        std=(0.211883, 0.230117, 0.177517),\n    ),\n])\n\nwith torch.inference_mode(), torch.autocast(\"cuda\", dtype=torch.float16):\n    feats = model(preprocess(tile).unsqueeze(0).to(\"cuda\"))   # (1, 1536)\n```\n\nUse `batch_size=16` on a 24 GB GPU with fp16 autocast. Prefer `TimmBackbone(\"H-optimus-0\", pretrained=True)` inside `DeepFeatureExtractor` — TIAToolbox applies the correct preprocessing automatically.\n\n## Resolution Rules\n\n| Model | mpp | Patch size |\n| --- | --- | --- |\n| H-optimus-0 \u002F UNI \u002F Prov-GigaPath | 0.5 | 224×224 |\n| HoVer-Net (PanNuke) | 0.25 | 256×256 |\n| SlideGraph CNN features | 0.25 | 512×512 |\n| Tissue mask (Otsu) | 4 mpp or 1.25× | — |\n\nDownsample factor = `baseline_mpp \u002F target_mpp`. For a 0.25-mpp slide targeting 0.5 mpp, downsample by 2.\n\n## CAMELYON Datasets\n\n- **Format**: pyramidal `.tif`, OpenSlide-compatible, ~100 000 × 100 000 px at baseline.\n- **Annotations**: ASAP XML, polygon coordinates in **baseline (level-0) pixels**.\n- **CAMELYON16**: 270 training slides (`normal\u002F` + `tumor\u002F`) + 130 test slides, labels in `reference.csv`. Task: slide-level tumor classification + tumor segmentation.\n- **CAMELYON17**: 1000 slides across 100 patients (5 slides each). Patient-level pN-stage in `stages.csv`. Official 5-fold split is **by patient** — never split by slide.\n\n```python\nimport xml.etree.ElementTree as ET\ntree = ET.parse(\"slide.xml\")                 # ASAP format\nfor ann in tree.iter(\"Annotation\"):\n    pts = [(float(c.get(\"X\")), float(c.get(\"Y\")))\n           for c in ann.iter(\"Coordinate\")]   # baseline coords\n```\n\n## SageMaker Deployment\n\nWSIs are gigapixel — **never send raw bytes through the invocation path**. Pass an **S3 URI** in the request and let the container read via `s3fs` \u002F `boto3`.\n\n- **Endpoint type**: **Async Inference** (long-running, per-request) or **Batch Transform** (cohort scoring).\n- **Base container**: extend `763104351884.dkr.ecr.\u003Cregion>.amazonaws.com\u002Fpytorch-inference:2.x-gpu-py310`.\n- **Apt packages**: `openslide-tools libpixman-1-dev libvips`.\n- **Pip**: `tiatoolbox timm huggingface_hub s3fs`.\n- **Instance**: `ml.g5.2xlarge` minimum for H-optimus-0 fp16 (24 GB A10G). Use `ml.g5.12xlarge` for batches.\n- **Async config**: `invocations_timeout=3600`, `max_concurrent_invocations_per_instance=2`.\n\n```python\nfrom sagemaker.async_inference import AsyncInferenceConfig\nasync_config = AsyncInferenceConfig(\n    output_path=\"s3:\u002F\u002Fbucket\u002Fasync-out\u002F\",\n    max_concurrent_invocations_per_instance=2,\n)\npredictor = model.deploy(\n    instance_type=\"ml.g5.2xlarge\", initial_instance_count=1,\n    async_inference_config=async_config,\n)\npredictor.predict_async(input_path=\"s3:\u002F\u002Fbucket\u002Fslides\u002Fslide.svs\")\n```\n\nDockerfile sketch:\n\n```dockerfile\nFROM 763104351884.dkr.ecr.us-east-1.amazonaws.com\u002Fpytorch-inference:2.3.0-gpu-py310\nRUN apt-get update && apt-get install -y openslide-tools libpixman-1-dev libvips \\\n && rm -rf \u002Fvar\u002Flib\u002Fapt\u002Flists\u002F*\nRUN pip install --no-cache-dir tiatoolbox timm huggingface_hub s3fs\n```\n\n## Common Mistakes\n\n- **Wrong:** Using an old pixman library (\u003C0.40) with OpenSlide\n  **Right:** `apt-get install libpixman-1-dev` and rebuild, or use libvips ≥ 8.12\n  **Why:** Causes all-black tiles from `read_rect` due to a rendering bug\n\n- **Wrong:** Requesting a resolution finer than the slide's native mpp\n  **Right:** Use a coarser `resolution`, or check `reader.info.mpp` first\n  **Why:** Triggers `UserWarning: Scale > 1` and produces upsampled (interpolated) data\n\n- **Wrong:** Attempting to load H-optimus-0 without accepting the gated model terms\n  **Right:** Accept terms on the Hugging Face model page, then run `huggingface-cli login`\n  **Why:** Results in `OSError: 401` authentication failure\n\n- **Wrong:** Using a batch size too large for GPU memory in DeepFeatureExtractor\n  **Right:** Lower `batch_size` (16→8→4) and ensure fp16 autocast is enabled\n  **Why:** Causes CUDA out-of-memory errors\n\n- **Wrong:** Passing a non-pyramidal TIFF to OpenSlide\n  **Right:** Convert first with `vips tiffsave in.tif out.tif --tile --pyramid --compression jpeg`\n  **Why:** Raises `OpenSlideUnsupportedFormatError` because OpenSlide requires pyramidal format\n\n- **Wrong:** Passing a numpy array as an external mask with shape not aligned to the WSI pyramid\n  **Right:** Use `reader.tissue_mask(...)` directly and pass the returned reader object\n  **Why:** Causes `DimensionMismatchError` due to resolution\u002Fshape mismatch\n\n- **Wrong:** Processing PNG tiles without specifying resolution units\n  **Right:** Pass `units=\"baseline\"` and explicit `resolution=1.0`\n  **Why:** Tiles lack mpp metadata, triggering an \"unknown scale\" warning\n\n- **Wrong:** Splitting CAMELYON17 data by slide rather than by patient\n  **Right:** Split by `patient_id` (5-fold) per the official protocol\n  **Why:** Causes patient data leakage since each patient has 5 slides\n\n- **Wrong:** Skipping H-optimus-0 normalization (mean\u002Fstd) when extracting features\n  **Right:** Use `TimmBackbone` (applies normalization automatically) or apply mean\u002Fstd explicitly\n  **Why:** Features look random and produce low AUC without proper input normalization\n\n- **Wrong:** Using annotation coordinates at the wrong pyramid level\n  **Right:** ASAP XML coordinates are always at **baseline** level — scale them when reading at lower resolution\n  **Why:** Coordinates will be off by 2× or 4× if the level mismatch is not accounted for\n\n## Minimal Dependency Set\n\n```\ntiatoolbox>=1.5\ntimm>=1.0\ntorch>=2.1\nopenslide-python\nhuggingface_hub\n```\n\nSystem: `openslide-tools`, `libpixman-1-dev`, `libvips` (for non-pyramidal TIFF conversion).\n\n## References\n\n- TIAToolbox: Pocock et al. Commun Med 2022, https:\u002F\u002Fdoi.org\u002F10.1038\u002Fs43856-022-00186-5\n- H-optimus-0: Bioptimus, https:\u002F\u002Fhuggingface.co\u002Fbioptimus\u002FH-optimus-0\n- CAMELYON16: Bejnordi et al. JAMA 2017, https:\u002F\u002Fdoi.org\u002F10.1001\u002Fjama.2017.14585\n- CAMELYON17: Bandi et al. IEEE TMI 2019, https:\u002F\u002Fdoi.org\u002F10.1109\u002FTMI.2018.2867350\n",{"data":50,"body":65},{"name":4,"description":6,"usage":51,"version":52,"validated_against":53,"tags":58},"Invoke when analyzing whole-slide images, extracting tiles, running foundation-model embeddings, or deploying pathology models on SageMaker.","1.0.0",{"date":54,"packages":55},"2025-01-15",{"tiatoolbox":56,"openslide":57},"1.5","4.0",[59,60,4,61,62,63,64],"skill","category:pipeline","tiatoolbox","h-optimus-0","whole-slide-image","hcls",{"type":66,"children":67},"root",[68,76,83,89,118,124,129,154,159,165,193,199,309,315,320,679,692,698,746,1051,1064,1070,1076,1206,1211,1322,1328,1385,1391,1468,1474,1520,1526,1552,1558,1722,1749,1755,1858,1870,1876,1971,2018,2024,2058,2182,2267,2272,2313,2319,2660,2666,2676,2703,2709,2758],{"type":69,"tag":70,"props":71,"children":72},"element","h1",{"id":4},[73],{"type":74,"value":75},"text","Digital Pathology",{"type":69,"tag":77,"props":78,"children":80},"h2",{"id":79},"overview",[81],{"type":74,"value":82},"Overview",{"type":69,"tag":84,"props":85,"children":86},"p",{},[87],{"type":74,"value":88},"This skill teaches the agent to generate correct, runnable code for whole-slide image (WSI) pipelines. It covers TIAToolbox CLI and Python API, the H-optimus-0 foundation model, the standard tissue→tiles→features→aggregate→predict pattern, the CAMELYON datasets, and SageMaker deployment patterns for regulated workloads.",{"type":69,"tag":84,"props":90,"children":91},{},[92,94,101,103,109,110,116],{"type":74,"value":93},"Default to TIAToolbox primitives (",{"type":69,"tag":95,"props":96,"children":98},"code",{"className":97},[],[99],{"type":74,"value":100},"WSIReader",{"type":74,"value":102},", ",{"type":69,"tag":95,"props":104,"children":106},{"className":105},[],[107],{"type":74,"value":108},"PatchPredictor",{"type":74,"value":102},{"type":69,"tag":95,"props":111,"children":113},{"className":112},[],[114],{"type":74,"value":115},"DeepFeatureExtractor",{"type":74,"value":117},") rather than reimplementing slide I\u002FO. Default to H-optimus-0 at 0.5 mpp \u002F 224×224 unless the task specifies otherwise.",{"type":69,"tag":77,"props":119,"children":121},{"id":120},"usage",[122],{"type":74,"value":123},"Usage",{"type":69,"tag":84,"props":125,"children":126},{},[127],{"type":74,"value":128},"Invoke this skill when the user asks to:",{"type":69,"tag":130,"props":131,"children":132},"ul",{},[133,139,144,149],{"type":69,"tag":134,"props":135,"children":136},"li",{},[137],{"type":74,"value":138},"Inspect, tile, or stain-normalize a WSI (SVS, NDPI, MRXS, pyramidal TIFF).",{"type":69,"tag":134,"props":140,"children":141},{},[142],{"type":74,"value":143},"Extract features with a pathology foundation model.",{"type":69,"tag":134,"props":145,"children":146},{},[147],{"type":74,"value":148},"Build a slide-level classifier on CAMELYON or similar cohorts.",{"type":69,"tag":134,"props":150,"children":151},{},[152],{"type":74,"value":153},"Deploy a WSI model to AWS SageMaker.",{"type":69,"tag":84,"props":155,"children":156},{},[157],{"type":74,"value":158},"Ask for clarification only if the resolution, model, or output artifact is ambiguous. Otherwise apply the defaults in the Resolution Rules section.",{"type":69,"tag":77,"props":160,"children":162},{"id":161},"response-format",[163],{"type":74,"value":164},"Response Format",{"type":69,"tag":130,"props":166,"children":167},{},[168,173,178,183,188],{"type":69,"tag":134,"props":169,"children":170},{},[171],{"type":74,"value":172},"Lead with the command or code the user needs — explain after",{"type":69,"tag":134,"props":174,"children":175},{},[176],{"type":74,"value":177},"Structure as: confirm inputs → working code → key parameters explained → gotchas",{"type":69,"tag":134,"props":179,"children":180},{},[181],{"type":74,"value":182},"One complete working example per task; do not show every alternative",{"type":69,"tag":134,"props":184,"children":185},{},[186],{"type":74,"value":187},"Keep code comments minimal and functional (what, not why-it-exists)",{"type":69,"tag":134,"props":189,"children":190},{},[191],{"type":74,"value":192},"Target: 50-100 lines of code with brief surrounding explanation",{"type":69,"tag":77,"props":194,"children":196},{"id":195},"core-concepts",[197],{"type":74,"value":198},"Core Concepts",{"type":69,"tag":130,"props":200,"children":201},{},[202,237,269,279,289,299],{"type":69,"tag":134,"props":203,"children":204},{},[205,211,213,219,221,227,229,235],{"type":69,"tag":206,"props":207,"children":208},"strong",{},[209],{"type":74,"value":210},"Pyramidal WSI",{"type":74,"value":212},": multi-resolution image (levels). ",{"type":69,"tag":95,"props":214,"children":216},{"className":215},[],[217],{"type":74,"value":218},"baseline",{"type":74,"value":220}," = level 0 (native, finest). Addressing uses ",{"type":69,"tag":95,"props":222,"children":224},{"className":223},[],[225],{"type":74,"value":226},"resolution",{"type":74,"value":228}," + ",{"type":69,"tag":95,"props":230,"children":232},{"className":231},[],[233],{"type":74,"value":234},"units ∈ {mpp, power, level, baseline}",{"type":74,"value":236},".",{"type":69,"tag":134,"props":238,"children":239},{},[240,245,247,253,254,260,262,268],{"type":69,"tag":206,"props":241,"children":242},{},[243],{"type":74,"value":244},"mpp",{"type":74,"value":246},": microns per pixel. ",{"type":69,"tag":95,"props":248,"children":250},{"className":249},[],[251],{"type":74,"value":252},"0.5 mpp ≈ 20×",{"type":74,"value":102},{"type":69,"tag":95,"props":255,"children":257},{"className":256},[],[258],{"type":74,"value":259},"0.25 mpp ≈ 40×",{"type":74,"value":261},". Downsample = ",{"type":69,"tag":95,"props":263,"children":265},{"className":264},[],[266],{"type":74,"value":267},"baseline_mpp \u002F target_mpp",{"type":74,"value":236},{"type":69,"tag":134,"props":270,"children":271},{},[272,277],{"type":69,"tag":206,"props":273,"children":274},{},[275],{"type":74,"value":276},"Tissue mask",{"type":74,"value":278},": binary foreground mask computed at low resolution (e.g., Otsu at 1.25× or 4 mpp) to skip background tiles.",{"type":69,"tag":134,"props":280,"children":281},{},[282,287],{"type":69,"tag":206,"props":283,"children":284},{},[285],{"type":74,"value":286},"Patch \u002F tile",{"type":74,"value":288},": fixed-size crop (e.g., 224×224) read at a target mpp, used as model input.",{"type":69,"tag":134,"props":290,"children":291},{},[292,297],{"type":69,"tag":206,"props":293,"children":294},{},[295],{"type":74,"value":296},"Foundation model embedding",{"type":74,"value":298},": per-tile feature vector from a pretrained ViT (H-optimus-0 → 1536-d).",{"type":69,"tag":134,"props":300,"children":301},{},[302,307],{"type":69,"tag":206,"props":303,"children":304},{},[305],{"type":74,"value":306},"Aggregation",{"type":74,"value":308},": slide-level prediction from tile features (ABMIL, CLAM, TransMIL, SlideGraph).",{"type":69,"tag":77,"props":310,"children":312},{"id":311},"quick-reference-standard-pipeline",[313],{"type":74,"value":314},"Quick Reference — Standard Pipeline",{"type":69,"tag":84,"props":316,"children":317},{},[318],{"type":74,"value":319},"Copy-adapt this end-to-end pattern for any WSI classification task:",{"type":69,"tag":321,"props":322,"children":327},"pre",{"className":323,"code":324,"language":325,"meta":326,"style":326},"language-python shiki shiki-themes material-theme-lighter material-theme material-theme-palenight","import torch\nfrom tiatoolbox.wsicore.wsireader import WSIReader\nfrom tiatoolbox.models.architecture.vanilla import TimmBackbone\nfrom tiatoolbox.models.engine.semantic_segmentor import IOSegmentorConfig\nfrom tiatoolbox.models.engine.patch_predictor import IOPatchPredictorConfig\nfrom tiatoolbox.models import DeepFeatureExtractor\n\nSLIDE = \"slide.svs\"\nOUT = \".\u002Fout\"\nDEVICE = \"cuda\" if torch.cuda.is_available() else \"cpu\"\n\n# 1. Inspect\nreader = WSIReader.open(SLIDE)\ninfo = reader.info.as_dict()\nprint(info[\"mpp\"], info[\"level_dimensions\"])\n\n# 2. Tissue mask (Otsu at low res — do NOT pass as external mask)\nmask_reader = reader.tissue_mask(method=\"otsu\", resolution=4, units=\"mpp\")\n\n# 3. Tile + extract H-optimus-0 features @ 0.5 mpp, 224x224\nioconfig = IOPatchPredictorConfig(\n    input_resolutions=[{\"units\": \"mpp\", \"resolution\": 0.5}],\n    patch_input_shape=[224, 224],\n    stride_shape=[224, 224],\n)\nextractor = DeepFeatureExtractor(\n    model=TimmBackbone(\"H-optimus-0\", pretrained=True),\n    batch_size=16,\n    num_loader_workers=4,\n)\noutput = extractor.run(\n    images=[SLIDE],\n    masks=[mask_reader],\n    patch_mode=False,\n    ioconfig=ioconfig,\n    save_dir=OUT,\n    device=DEVICE,\n)\n# output[0] -> (positions.npy, features.npy)\n","python","",[328],{"type":69,"tag":95,"props":329,"children":330},{"__ignoreMap":326},[331,342,351,360,368,377,386,396,405,414,423,431,440,449,458,467,475,484,493,501,510,519,528,537,546,555,564,573,582,591,599,608,617,626,635,644,653,662,670],{"type":69,"tag":332,"props":333,"children":336},"span",{"class":334,"line":335},"line",1,[337],{"type":69,"tag":332,"props":338,"children":339},{},[340],{"type":74,"value":341},"import torch\n",{"type":69,"tag":332,"props":343,"children":345},{"class":334,"line":344},2,[346],{"type":69,"tag":332,"props":347,"children":348},{},[349],{"type":74,"value":350},"from tiatoolbox.wsicore.wsireader import WSIReader\n",{"type":69,"tag":332,"props":352,"children":354},{"class":334,"line":353},3,[355],{"type":69,"tag":332,"props":356,"children":357},{},[358],{"type":74,"value":359},"from tiatoolbox.models.architecture.vanilla import TimmBackbone\n",{"type":69,"tag":332,"props":361,"children":362},{"class":334,"line":26},[363],{"type":69,"tag":332,"props":364,"children":365},{},[366],{"type":74,"value":367},"from tiatoolbox.models.engine.semantic_segmentor import IOSegmentorConfig\n",{"type":69,"tag":332,"props":369,"children":371},{"class":334,"line":370},5,[372],{"type":69,"tag":332,"props":373,"children":374},{},[375],{"type":74,"value":376},"from tiatoolbox.models.engine.patch_predictor import IOPatchPredictorConfig\n",{"type":69,"tag":332,"props":378,"children":380},{"class":334,"line":379},6,[381],{"type":69,"tag":332,"props":382,"children":383},{},[384],{"type":74,"value":385},"from tiatoolbox.models import DeepFeatureExtractor\n",{"type":69,"tag":332,"props":387,"children":389},{"class":334,"line":388},7,[390],{"type":69,"tag":332,"props":391,"children":393},{"emptyLinePlaceholder":392},true,[394],{"type":74,"value":395},"\n",{"type":69,"tag":332,"props":397,"children":399},{"class":334,"line":398},8,[400],{"type":69,"tag":332,"props":401,"children":402},{},[403],{"type":74,"value":404},"SLIDE = \"slide.svs\"\n",{"type":69,"tag":332,"props":406,"children":408},{"class":334,"line":407},9,[409],{"type":69,"tag":332,"props":410,"children":411},{},[412],{"type":74,"value":413},"OUT = \".\u002Fout\"\n",{"type":69,"tag":332,"props":415,"children":417},{"class":334,"line":416},10,[418],{"type":69,"tag":332,"props":419,"children":420},{},[421],{"type":74,"value":422},"DEVICE = \"cuda\" if torch.cuda.is_available() else \"cpu\"\n",{"type":69,"tag":332,"props":424,"children":426},{"class":334,"line":425},11,[427],{"type":69,"tag":332,"props":428,"children":429},{"emptyLinePlaceholder":392},[430],{"type":74,"value":395},{"type":69,"tag":332,"props":432,"children":434},{"class":334,"line":433},12,[435],{"type":69,"tag":332,"props":436,"children":437},{},[438],{"type":74,"value":439},"# 1. Inspect\n",{"type":69,"tag":332,"props":441,"children":443},{"class":334,"line":442},13,[444],{"type":69,"tag":332,"props":445,"children":446},{},[447],{"type":74,"value":448},"reader = WSIReader.open(SLIDE)\n",{"type":69,"tag":332,"props":450,"children":452},{"class":334,"line":451},14,[453],{"type":69,"tag":332,"props":454,"children":455},{},[456],{"type":74,"value":457},"info = reader.info.as_dict()\n",{"type":69,"tag":332,"props":459,"children":461},{"class":334,"line":460},15,[462],{"type":69,"tag":332,"props":463,"children":464},{},[465],{"type":74,"value":466},"print(info[\"mpp\"], info[\"level_dimensions\"])\n",{"type":69,"tag":332,"props":468,"children":470},{"class":334,"line":469},16,[471],{"type":69,"tag":332,"props":472,"children":473},{"emptyLinePlaceholder":392},[474],{"type":74,"value":395},{"type":69,"tag":332,"props":476,"children":478},{"class":334,"line":477},17,[479],{"type":69,"tag":332,"props":480,"children":481},{},[482],{"type":74,"value":483},"# 2. Tissue mask (Otsu at low res — do NOT pass as external mask)\n",{"type":69,"tag":332,"props":485,"children":487},{"class":334,"line":486},18,[488],{"type":69,"tag":332,"props":489,"children":490},{},[491],{"type":74,"value":492},"mask_reader = reader.tissue_mask(method=\"otsu\", resolution=4, units=\"mpp\")\n",{"type":69,"tag":332,"props":494,"children":496},{"class":334,"line":495},19,[497],{"type":69,"tag":332,"props":498,"children":499},{"emptyLinePlaceholder":392},[500],{"type":74,"value":395},{"type":69,"tag":332,"props":502,"children":504},{"class":334,"line":503},20,[505],{"type":69,"tag":332,"props":506,"children":507},{},[508],{"type":74,"value":509},"# 3. Tile + extract H-optimus-0 features @ 0.5 mpp, 224x224\n",{"type":69,"tag":332,"props":511,"children":513},{"class":334,"line":512},21,[514],{"type":69,"tag":332,"props":515,"children":516},{},[517],{"type":74,"value":518},"ioconfig = IOPatchPredictorConfig(\n",{"type":69,"tag":332,"props":520,"children":522},{"class":334,"line":521},22,[523],{"type":69,"tag":332,"props":524,"children":525},{},[526],{"type":74,"value":527},"    input_resolutions=[{\"units\": \"mpp\", \"resolution\": 0.5}],\n",{"type":69,"tag":332,"props":529,"children":531},{"class":334,"line":530},23,[532],{"type":69,"tag":332,"props":533,"children":534},{},[535],{"type":74,"value":536},"    patch_input_shape=[224, 224],\n",{"type":69,"tag":332,"props":538,"children":540},{"class":334,"line":539},24,[541],{"type":69,"tag":332,"props":542,"children":543},{},[544],{"type":74,"value":545},"    stride_shape=[224, 224],\n",{"type":69,"tag":332,"props":547,"children":549},{"class":334,"line":548},25,[550],{"type":69,"tag":332,"props":551,"children":552},{},[553],{"type":74,"value":554},")\n",{"type":69,"tag":332,"props":556,"children":558},{"class":334,"line":557},26,[559],{"type":69,"tag":332,"props":560,"children":561},{},[562],{"type":74,"value":563},"extractor = DeepFeatureExtractor(\n",{"type":69,"tag":332,"props":565,"children":567},{"class":334,"line":566},27,[568],{"type":69,"tag":332,"props":569,"children":570},{},[571],{"type":74,"value":572},"    model=TimmBackbone(\"H-optimus-0\", pretrained=True),\n",{"type":69,"tag":332,"props":574,"children":576},{"class":334,"line":575},28,[577],{"type":69,"tag":332,"props":578,"children":579},{},[580],{"type":74,"value":581},"    batch_size=16,\n",{"type":69,"tag":332,"props":583,"children":585},{"class":334,"line":584},29,[586],{"type":69,"tag":332,"props":587,"children":588},{},[589],{"type":74,"value":590},"    num_loader_workers=4,\n",{"type":69,"tag":332,"props":592,"children":594},{"class":334,"line":593},30,[595],{"type":69,"tag":332,"props":596,"children":597},{},[598],{"type":74,"value":554},{"type":69,"tag":332,"props":600,"children":602},{"class":334,"line":601},31,[603],{"type":69,"tag":332,"props":604,"children":605},{},[606],{"type":74,"value":607},"output = extractor.run(\n",{"type":69,"tag":332,"props":609,"children":611},{"class":334,"line":610},32,[612],{"type":69,"tag":332,"props":613,"children":614},{},[615],{"type":74,"value":616},"    images=[SLIDE],\n",{"type":69,"tag":332,"props":618,"children":620},{"class":334,"line":619},33,[621],{"type":69,"tag":332,"props":622,"children":623},{},[624],{"type":74,"value":625},"    masks=[mask_reader],\n",{"type":69,"tag":332,"props":627,"children":629},{"class":334,"line":628},34,[630],{"type":69,"tag":332,"props":631,"children":632},{},[633],{"type":74,"value":634},"    patch_mode=False,\n",{"type":69,"tag":332,"props":636,"children":638},{"class":334,"line":637},35,[639],{"type":69,"tag":332,"props":640,"children":641},{},[642],{"type":74,"value":643},"    ioconfig=ioconfig,\n",{"type":69,"tag":332,"props":645,"children":647},{"class":334,"line":646},36,[648],{"type":69,"tag":332,"props":649,"children":650},{},[651],{"type":74,"value":652},"    save_dir=OUT,\n",{"type":69,"tag":332,"props":654,"children":656},{"class":334,"line":655},37,[657],{"type":69,"tag":332,"props":658,"children":659},{},[660],{"type":74,"value":661},"    device=DEVICE,\n",{"type":69,"tag":332,"props":663,"children":665},{"class":334,"line":664},38,[666],{"type":69,"tag":332,"props":667,"children":668},{},[669],{"type":74,"value":554},{"type":69,"tag":332,"props":671,"children":673},{"class":334,"line":672},39,[674],{"type":69,"tag":332,"props":675,"children":676},{},[677],{"type":74,"value":678},"# output[0] -> (positions.npy, features.npy)\n",{"type":69,"tag":84,"props":680,"children":681},{},[682,684,690],{"type":74,"value":683},"Then aggregate (ABMIL \u002F SlideGraph \u002F mean-pool) on ",{"type":69,"tag":95,"props":685,"children":687},{"className":686},[],[688],{"type":74,"value":689},"features.npy",{"type":74,"value":691}," for a slide-level prediction.",{"type":69,"tag":77,"props":693,"children":695},{"id":694},"tiatoolbox-cli",[696],{"type":74,"value":697},"TIAToolbox CLI",{"type":69,"tag":84,"props":699,"children":700},{},[701,703,709,711,717,718,724,725,731,732,738,739,745],{"type":74,"value":702},"All CLI commands accept ",{"type":69,"tag":95,"props":704,"children":706},{"className":705},[],[707],{"type":74,"value":708},"--img-input",{"type":74,"value":710}," (file or dir), ",{"type":69,"tag":95,"props":712,"children":714},{"className":713},[],[715],{"type":74,"value":716},"--output-path",{"type":74,"value":102},{"type":69,"tag":95,"props":719,"children":721},{"className":720},[],[722],{"type":74,"value":723},"--resolution",{"type":74,"value":102},{"type":69,"tag":95,"props":726,"children":728},{"className":727},[],[729],{"type":74,"value":730},"--units",{"type":74,"value":102},{"type":69,"tag":95,"props":733,"children":735},{"className":734},[],[736],{"type":74,"value":737},"--batch-size",{"type":74,"value":102},{"type":69,"tag":95,"props":740,"children":742},{"className":741},[],[743],{"type":74,"value":744},"--device cuda",{"type":74,"value":236},{"type":69,"tag":321,"props":747,"children":751},{"className":748,"code":749,"language":750,"meta":326,"style":326},"language-bash shiki shiki-themes material-theme-lighter material-theme material-theme-palenight","# Slide metadata\ntiatoolbox slide-info --img-input slide.svs --mode show\n\n# Tissue mask (binary PNG)\ntiatoolbox tissue-mask --img-input slide.svs --output-path .\u002Fmask --method otsu \\\n  --resolution 1.25 --units power\n\n# Tile classification with built-in ResNet18 on Kather100k\ntiatoolbox patch-predictor --img-input slide.svs \\\n  --pretrained-model resnet18-kather100k \\\n  --output-path .\u002Fpred --batch-size 32 --device cuda \\\n  --resolution 0.5 --units mpp\n\n# Stain normalization (Reinhard \u002F Macenko \u002F Vahadane)\ntiatoolbox stain-norm --img-input tiles\u002F --method reinhard --output-path .\u002Fnorm\n","bash",[752],{"type":69,"tag":95,"props":753,"children":754},{"__ignoreMap":326},[755,764,798,805,813,859,883,890,898,922,939,976,997,1004,1012],{"type":69,"tag":332,"props":756,"children":757},{"class":334,"line":335},[758],{"type":69,"tag":332,"props":759,"children":761},{"style":760},"--shiki-light:#90A4AE;--shiki-light-font-style:italic;--shiki-default:#546E7A;--shiki-default-font-style:italic;--shiki-dark:#676E95;--shiki-dark-font-style:italic",[762],{"type":74,"value":763},"# Slide metadata\n",{"type":69,"tag":332,"props":765,"children":766},{"class":334,"line":344},[767,772,778,783,788,793],{"type":69,"tag":332,"props":768,"children":770},{"style":769},"--shiki-light:#E2931D;--shiki-default:#FFCB6B;--shiki-dark:#FFCB6B",[771],{"type":74,"value":61},{"type":69,"tag":332,"props":773,"children":775},{"style":774},"--shiki-light:#91B859;--shiki-default:#C3E88D;--shiki-dark:#C3E88D",[776],{"type":74,"value":777}," slide-info",{"type":69,"tag":332,"props":779,"children":780},{"style":774},[781],{"type":74,"value":782}," --img-input",{"type":69,"tag":332,"props":784,"children":785},{"style":774},[786],{"type":74,"value":787}," slide.svs",{"type":69,"tag":332,"props":789,"children":790},{"style":774},[791],{"type":74,"value":792}," --mode",{"type":69,"tag":332,"props":794,"children":795},{"style":774},[796],{"type":74,"value":797}," show\n",{"type":69,"tag":332,"props":799,"children":800},{"class":334,"line":353},[801],{"type":69,"tag":332,"props":802,"children":803},{"emptyLinePlaceholder":392},[804],{"type":74,"value":395},{"type":69,"tag":332,"props":806,"children":807},{"class":334,"line":26},[808],{"type":69,"tag":332,"props":809,"children":810},{"style":760},[811],{"type":74,"value":812},"# Tissue mask (binary PNG)\n",{"type":69,"tag":332,"props":814,"children":815},{"class":334,"line":370},[816,820,825,829,833,838,843,848,853],{"type":69,"tag":332,"props":817,"children":818},{"style":769},[819],{"type":74,"value":61},{"type":69,"tag":332,"props":821,"children":822},{"style":774},[823],{"type":74,"value":824}," tissue-mask",{"type":69,"tag":332,"props":826,"children":827},{"style":774},[828],{"type":74,"value":782},{"type":69,"tag":332,"props":830,"children":831},{"style":774},[832],{"type":74,"value":787},{"type":69,"tag":332,"props":834,"children":835},{"style":774},[836],{"type":74,"value":837}," --output-path",{"type":69,"tag":332,"props":839,"children":840},{"style":774},[841],{"type":74,"value":842}," .\u002Fmask",{"type":69,"tag":332,"props":844,"children":845},{"style":774},[846],{"type":74,"value":847}," --method",{"type":69,"tag":332,"props":849,"children":850},{"style":774},[851],{"type":74,"value":852}," otsu",{"type":69,"tag":332,"props":854,"children":856},{"style":855},"--shiki-light:#90A4AE;--shiki-default:#EEFFFF;--shiki-dark:#BABED8",[857],{"type":74,"value":858}," \\\n",{"type":69,"tag":332,"props":860,"children":861},{"class":334,"line":379},[862,867,873,878],{"type":69,"tag":332,"props":863,"children":864},{"style":774},[865],{"type":74,"value":866},"  --resolution",{"type":69,"tag":332,"props":868,"children":870},{"style":869},"--shiki-light:#F76D47;--shiki-default:#F78C6C;--shiki-dark:#F78C6C",[871],{"type":74,"value":872}," 1.25",{"type":69,"tag":332,"props":874,"children":875},{"style":774},[876],{"type":74,"value":877}," --units",{"type":69,"tag":332,"props":879,"children":880},{"style":774},[881],{"type":74,"value":882}," power\n",{"type":69,"tag":332,"props":884,"children":885},{"class":334,"line":388},[886],{"type":69,"tag":332,"props":887,"children":888},{"emptyLinePlaceholder":392},[889],{"type":74,"value":395},{"type":69,"tag":332,"props":891,"children":892},{"class":334,"line":398},[893],{"type":69,"tag":332,"props":894,"children":895},{"style":760},[896],{"type":74,"value":897},"# Tile classification with built-in ResNet18 on Kather100k\n",{"type":69,"tag":332,"props":899,"children":900},{"class":334,"line":407},[901,905,910,914,918],{"type":69,"tag":332,"props":902,"children":903},{"style":769},[904],{"type":74,"value":61},{"type":69,"tag":332,"props":906,"children":907},{"style":774},[908],{"type":74,"value":909}," patch-predictor",{"type":69,"tag":332,"props":911,"children":912},{"style":774},[913],{"type":74,"value":782},{"type":69,"tag":332,"props":915,"children":916},{"style":774},[917],{"type":74,"value":787},{"type":69,"tag":332,"props":919,"children":920},{"style":855},[921],{"type":74,"value":858},{"type":69,"tag":332,"props":923,"children":924},{"class":334,"line":416},[925,930,935],{"type":69,"tag":332,"props":926,"children":927},{"style":774},[928],{"type":74,"value":929},"  --pretrained-model",{"type":69,"tag":332,"props":931,"children":932},{"style":774},[933],{"type":74,"value":934}," resnet18-kather100k",{"type":69,"tag":332,"props":936,"children":937},{"style":855},[938],{"type":74,"value":858},{"type":69,"tag":332,"props":940,"children":941},{"class":334,"line":425},[942,947,952,957,962,967,972],{"type":69,"tag":332,"props":943,"children":944},{"style":774},[945],{"type":74,"value":946},"  --output-path",{"type":69,"tag":332,"props":948,"children":949},{"style":774},[950],{"type":74,"value":951}," .\u002Fpred",{"type":69,"tag":332,"props":953,"children":954},{"style":774},[955],{"type":74,"value":956}," --batch-size",{"type":69,"tag":332,"props":958,"children":959},{"style":869},[960],{"type":74,"value":961}," 32",{"type":69,"tag":332,"props":963,"children":964},{"style":774},[965],{"type":74,"value":966}," --device",{"type":69,"tag":332,"props":968,"children":969},{"style":774},[970],{"type":74,"value":971}," cuda",{"type":69,"tag":332,"props":973,"children":974},{"style":855},[975],{"type":74,"value":858},{"type":69,"tag":332,"props":977,"children":978},{"class":334,"line":433},[979,983,988,992],{"type":69,"tag":332,"props":980,"children":981},{"style":774},[982],{"type":74,"value":866},{"type":69,"tag":332,"props":984,"children":985},{"style":869},[986],{"type":74,"value":987}," 0.5",{"type":69,"tag":332,"props":989,"children":990},{"style":774},[991],{"type":74,"value":877},{"type":69,"tag":332,"props":993,"children":994},{"style":774},[995],{"type":74,"value":996}," mpp\n",{"type":69,"tag":332,"props":998,"children":999},{"class":334,"line":442},[1000],{"type":69,"tag":332,"props":1001,"children":1002},{"emptyLinePlaceholder":392},[1003],{"type":74,"value":395},{"type":69,"tag":332,"props":1005,"children":1006},{"class":334,"line":451},[1007],{"type":69,"tag":332,"props":1008,"children":1009},{"style":760},[1010],{"type":74,"value":1011},"# Stain normalization (Reinhard \u002F Macenko \u002F Vahadane)\n",{"type":69,"tag":332,"props":1013,"children":1014},{"class":334,"line":460},[1015,1019,1024,1028,1033,1037,1042,1046],{"type":69,"tag":332,"props":1016,"children":1017},{"style":769},[1018],{"type":74,"value":61},{"type":69,"tag":332,"props":1020,"children":1021},{"style":774},[1022],{"type":74,"value":1023}," stain-norm",{"type":69,"tag":332,"props":1025,"children":1026},{"style":774},[1027],{"type":74,"value":782},{"type":69,"tag":332,"props":1029,"children":1030},{"style":774},[1031],{"type":74,"value":1032}," tiles\u002F",{"type":69,"tag":332,"props":1034,"children":1035},{"style":774},[1036],{"type":74,"value":847},{"type":69,"tag":332,"props":1038,"children":1039},{"style":774},[1040],{"type":74,"value":1041}," reinhard",{"type":69,"tag":332,"props":1043,"children":1044},{"style":774},[1045],{"type":74,"value":837},{"type":69,"tag":332,"props":1047,"children":1048},{"style":774},[1049],{"type":74,"value":1050}," .\u002Fnorm\n",{"type":69,"tag":84,"props":1052,"children":1053},{},[1054,1056,1062],{"type":74,"value":1055},"Use ",{"type":69,"tag":95,"props":1057,"children":1059},{"className":1058},[],[1060],{"type":74,"value":1061},"--units baseline",{"type":74,"value":1063}," when inputs are pre-extracted PNG tiles to avoid an \"unknown scale\" warning.",{"type":69,"tag":77,"props":1065,"children":1067},{"id":1066},"tiatoolbox-python-api",[1068],{"type":74,"value":1069},"TIAToolbox Python API",{"type":69,"tag":1071,"props":1072,"children":1074},"h3",{"id":1073},"wsireader",[1075],{"type":74,"value":100},{"type":69,"tag":321,"props":1077,"children":1079},{"className":323,"code":1078,"language":325,"meta":326,"style":326},"from tiatoolbox.wsicore.wsireader import WSIReader\n\nreader = WSIReader.open(\"slide.svs\")\nreader.info.as_dict()                              # mpp, levels, vendor\nreader.slide_dimensions(resolution=0.5, units=\"mpp\")\n\ntile = reader.read_rect(\n    location=(10000, 10000),    # baseline coords\n    size=(224, 224),\n    resolution=0.5, units=\"mpp\",\n)\nregion = reader.read_bounds(\n    bounds=(0, 0, 4096, 4096),\n    resolution=2.0, units=\"mpp\",\n)\nmask = reader.tissue_mask(method=\"otsu\", resolution=4, units=\"mpp\")\n",[1080],{"type":69,"tag":95,"props":1081,"children":1082},{"__ignoreMap":326},[1083,1090,1097,1105,1113,1121,1128,1136,1144,1152,1160,1167,1175,1183,1191,1198],{"type":69,"tag":332,"props":1084,"children":1085},{"class":334,"line":335},[1086],{"type":69,"tag":332,"props":1087,"children":1088},{},[1089],{"type":74,"value":350},{"type":69,"tag":332,"props":1091,"children":1092},{"class":334,"line":344},[1093],{"type":69,"tag":332,"props":1094,"children":1095},{"emptyLinePlaceholder":392},[1096],{"type":74,"value":395},{"type":69,"tag":332,"props":1098,"children":1099},{"class":334,"line":353},[1100],{"type":69,"tag":332,"props":1101,"children":1102},{},[1103],{"type":74,"value":1104},"reader = WSIReader.open(\"slide.svs\")\n",{"type":69,"tag":332,"props":1106,"children":1107},{"class":334,"line":26},[1108],{"type":69,"tag":332,"props":1109,"children":1110},{},[1111],{"type":74,"value":1112},"reader.info.as_dict()                              # mpp, levels, vendor\n",{"type":69,"tag":332,"props":1114,"children":1115},{"class":334,"line":370},[1116],{"type":69,"tag":332,"props":1117,"children":1118},{},[1119],{"type":74,"value":1120},"reader.slide_dimensions(resolution=0.5, units=\"mpp\")\n",{"type":69,"tag":332,"props":1122,"children":1123},{"class":334,"line":379},[1124],{"type":69,"tag":332,"props":1125,"children":1126},{"emptyLinePlaceholder":392},[1127],{"type":74,"value":395},{"type":69,"tag":332,"props":1129,"children":1130},{"class":334,"line":388},[1131],{"type":69,"tag":332,"props":1132,"children":1133},{},[1134],{"type":74,"value":1135},"tile = reader.read_rect(\n",{"type":69,"tag":332,"props":1137,"children":1138},{"class":334,"line":398},[1139],{"type":69,"tag":332,"props":1140,"children":1141},{},[1142],{"type":74,"value":1143},"    location=(10000, 10000),    # baseline coords\n",{"type":69,"tag":332,"props":1145,"children":1146},{"class":334,"line":407},[1147],{"type":69,"tag":332,"props":1148,"children":1149},{},[1150],{"type":74,"value":1151},"    size=(224, 224),\n",{"type":69,"tag":332,"props":1153,"children":1154},{"class":334,"line":416},[1155],{"type":69,"tag":332,"props":1156,"children":1157},{},[1158],{"type":74,"value":1159},"    resolution=0.5, units=\"mpp\",\n",{"type":69,"tag":332,"props":1161,"children":1162},{"class":334,"line":425},[1163],{"type":69,"tag":332,"props":1164,"children":1165},{},[1166],{"type":74,"value":554},{"type":69,"tag":332,"props":1168,"children":1169},{"class":334,"line":433},[1170],{"type":69,"tag":332,"props":1171,"children":1172},{},[1173],{"type":74,"value":1174},"region = reader.read_bounds(\n",{"type":69,"tag":332,"props":1176,"children":1177},{"class":334,"line":442},[1178],{"type":69,"tag":332,"props":1179,"children":1180},{},[1181],{"type":74,"value":1182},"    bounds=(0, 0, 4096, 4096),\n",{"type":69,"tag":332,"props":1184,"children":1185},{"class":334,"line":451},[1186],{"type":69,"tag":332,"props":1187,"children":1188},{},[1189],{"type":74,"value":1190},"    resolution=2.0, units=\"mpp\",\n",{"type":69,"tag":332,"props":1192,"children":1193},{"class":334,"line":460},[1194],{"type":69,"tag":332,"props":1195,"children":1196},{},[1197],{"type":74,"value":554},{"type":69,"tag":332,"props":1199,"children":1200},{"class":334,"line":469},[1201],{"type":69,"tag":332,"props":1202,"children":1203},{},[1204],{"type":74,"value":1205},"mask = reader.tissue_mask(method=\"otsu\", resolution=4, units=\"mpp\")\n",{"type":69,"tag":1071,"props":1207,"children":1209},{"id":1208},"patchpredictor",[1210],{"type":74,"value":108},{"type":69,"tag":321,"props":1212,"children":1214},{"className":323,"code":1213,"language":325,"meta":326,"style":326},"from tiatoolbox.models import PatchPredictor\nfrom tiatoolbox.models.engine.patch_predictor import IOPatchPredictorConfig\n\nioconfig = IOPatchPredictorConfig(\n    input_resolutions=[{\"units\": \"mpp\", \"resolution\": 0.5}],\n    patch_input_shape=[224, 224],\n    stride_shape=[224, 224],\n)\npredictor = PatchPredictor(pretrained_model=\"resnet18-kather100k\", batch_size=32)\nout = predictor.run(\n    images=[\"slide.svs\"], masks=[mask],\n    patch_mode=False, ioconfig=ioconfig,\n    save_dir=\".\u002Fpred\", device=\"cuda\",\n)\n",[1215],{"type":69,"tag":95,"props":1216,"children":1217},{"__ignoreMap":326},[1218,1226,1233,1240,1247,1254,1261,1268,1275,1283,1291,1299,1307,1315],{"type":69,"tag":332,"props":1219,"children":1220},{"class":334,"line":335},[1221],{"type":69,"tag":332,"props":1222,"children":1223},{},[1224],{"type":74,"value":1225},"from tiatoolbox.models import PatchPredictor\n",{"type":69,"tag":332,"props":1227,"children":1228},{"class":334,"line":344},[1229],{"type":69,"tag":332,"props":1230,"children":1231},{},[1232],{"type":74,"value":376},{"type":69,"tag":332,"props":1234,"children":1235},{"class":334,"line":353},[1236],{"type":69,"tag":332,"props":1237,"children":1238},{"emptyLinePlaceholder":392},[1239],{"type":74,"value":395},{"type":69,"tag":332,"props":1241,"children":1242},{"class":334,"line":26},[1243],{"type":69,"tag":332,"props":1244,"children":1245},{},[1246],{"type":74,"value":518},{"type":69,"tag":332,"props":1248,"children":1249},{"class":334,"line":370},[1250],{"type":69,"tag":332,"props":1251,"children":1252},{},[1253],{"type":74,"value":527},{"type":69,"tag":332,"props":1255,"children":1256},{"class":334,"line":379},[1257],{"type":69,"tag":332,"props":1258,"children":1259},{},[1260],{"type":74,"value":536},{"type":69,"tag":332,"props":1262,"children":1263},{"class":334,"line":388},[1264],{"type":69,"tag":332,"props":1265,"children":1266},{},[1267],{"type":74,"value":545},{"type":69,"tag":332,"props":1269,"children":1270},{"class":334,"line":398},[1271],{"type":69,"tag":332,"props":1272,"children":1273},{},[1274],{"type":74,"value":554},{"type":69,"tag":332,"props":1276,"children":1277},{"class":334,"line":407},[1278],{"type":69,"tag":332,"props":1279,"children":1280},{},[1281],{"type":74,"value":1282},"predictor = PatchPredictor(pretrained_model=\"resnet18-kather100k\", batch_size=32)\n",{"type":69,"tag":332,"props":1284,"children":1285},{"class":334,"line":416},[1286],{"type":69,"tag":332,"props":1287,"children":1288},{},[1289],{"type":74,"value":1290},"out = predictor.run(\n",{"type":69,"tag":332,"props":1292,"children":1293},{"class":334,"line":425},[1294],{"type":69,"tag":332,"props":1295,"children":1296},{},[1297],{"type":74,"value":1298},"    images=[\"slide.svs\"], masks=[mask],\n",{"type":69,"tag":332,"props":1300,"children":1301},{"class":334,"line":433},[1302],{"type":69,"tag":332,"props":1303,"children":1304},{},[1305],{"type":74,"value":1306},"    patch_mode=False, ioconfig=ioconfig,\n",{"type":69,"tag":332,"props":1308,"children":1309},{"class":334,"line":442},[1310],{"type":69,"tag":332,"props":1311,"children":1312},{},[1313],{"type":74,"value":1314},"    save_dir=\".\u002Fpred\", device=\"cuda\",\n",{"type":69,"tag":332,"props":1316,"children":1317},{"class":334,"line":451},[1318],{"type":69,"tag":332,"props":1319,"children":1320},{},[1321],{"type":74,"value":554},{"type":69,"tag":1071,"props":1323,"children":1325},{"id":1324},"deepfeatureextractor-timmbackbone",[1326],{"type":74,"value":1327},"DeepFeatureExtractor + TimmBackbone",{"type":69,"tag":321,"props":1329,"children":1331},{"className":323,"code":1330,"language":325,"meta":326,"style":326},"from tiatoolbox.models import DeepFeatureExtractor\nfrom tiatoolbox.models.architecture.vanilla import TimmBackbone\n\nextractor = DeepFeatureExtractor(\n    model=TimmBackbone(\"H-optimus-0\", pretrained=True),\n    batch_size=16, num_loader_workers=4,\n)\n",[1332],{"type":69,"tag":95,"props":1333,"children":1334},{"__ignoreMap":326},[1335,1342,1349,1356,1363,1370,1378],{"type":69,"tag":332,"props":1336,"children":1337},{"class":334,"line":335},[1338],{"type":69,"tag":332,"props":1339,"children":1340},{},[1341],{"type":74,"value":385},{"type":69,"tag":332,"props":1343,"children":1344},{"class":334,"line":344},[1345],{"type":69,"tag":332,"props":1346,"children":1347},{},[1348],{"type":74,"value":359},{"type":69,"tag":332,"props":1350,"children":1351},{"class":334,"line":353},[1352],{"type":69,"tag":332,"props":1353,"children":1354},{"emptyLinePlaceholder":392},[1355],{"type":74,"value":395},{"type":69,"tag":332,"props":1357,"children":1358},{"class":334,"line":26},[1359],{"type":69,"tag":332,"props":1360,"children":1361},{},[1362],{"type":74,"value":563},{"type":69,"tag":332,"props":1364,"children":1365},{"class":334,"line":370},[1366],{"type":69,"tag":332,"props":1367,"children":1368},{},[1369],{"type":74,"value":572},{"type":69,"tag":332,"props":1371,"children":1372},{"class":334,"line":379},[1373],{"type":69,"tag":332,"props":1374,"children":1375},{},[1376],{"type":74,"value":1377},"    batch_size=16, num_loader_workers=4,\n",{"type":69,"tag":332,"props":1379,"children":1380},{"class":334,"line":388},[1381],{"type":69,"tag":332,"props":1382,"children":1383},{},[1384],{"type":74,"value":554},{"type":69,"tag":1071,"props":1386,"children":1388},{"id":1387},"slidegraph-construction",[1389],{"type":74,"value":1390},"SlideGraph construction",{"type":69,"tag":321,"props":1392,"children":1394},{"className":323,"code":1393,"language":325,"meta":326,"style":326},"import numpy as np\nfrom tiatoolbox.tools.graph import SlideGraphConstructor\n\npositions = np.load(\"out\u002F0.position.npy\")   # (N, 4) x1,y1,x2,y2\nfeatures  = np.load(\"out\u002F0.features.npy\")   # (N, D)\ngraph = SlideGraphConstructor.build(\n    positions=positions[:, :2], features=features,\n)\n# graph -> {\"x\": features, \"edge_index\": (2,E), \"coords\": (N,2)}\n",[1395],{"type":69,"tag":95,"props":1396,"children":1397},{"__ignoreMap":326},[1398,1406,1414,1421,1429,1437,1445,1453,1460],{"type":69,"tag":332,"props":1399,"children":1400},{"class":334,"line":335},[1401],{"type":69,"tag":332,"props":1402,"children":1403},{},[1404],{"type":74,"value":1405},"import numpy as np\n",{"type":69,"tag":332,"props":1407,"children":1408},{"class":334,"line":344},[1409],{"type":69,"tag":332,"props":1410,"children":1411},{},[1412],{"type":74,"value":1413},"from tiatoolbox.tools.graph import SlideGraphConstructor\n",{"type":69,"tag":332,"props":1415,"children":1416},{"class":334,"line":353},[1417],{"type":69,"tag":332,"props":1418,"children":1419},{"emptyLinePlaceholder":392},[1420],{"type":74,"value":395},{"type":69,"tag":332,"props":1422,"children":1423},{"class":334,"line":26},[1424],{"type":69,"tag":332,"props":1425,"children":1426},{},[1427],{"type":74,"value":1428},"positions = np.load(\"out\u002F0.position.npy\")   # (N, 4) x1,y1,x2,y2\n",{"type":69,"tag":332,"props":1430,"children":1431},{"class":334,"line":370},[1432],{"type":69,"tag":332,"props":1433,"children":1434},{},[1435],{"type":74,"value":1436},"features  = np.load(\"out\u002F0.features.npy\")   # (N, D)\n",{"type":69,"tag":332,"props":1438,"children":1439},{"class":334,"line":379},[1440],{"type":69,"tag":332,"props":1441,"children":1442},{},[1443],{"type":74,"value":1444},"graph = SlideGraphConstructor.build(\n",{"type":69,"tag":332,"props":1446,"children":1447},{"class":334,"line":388},[1448],{"type":69,"tag":332,"props":1449,"children":1450},{},[1451],{"type":74,"value":1452},"    positions=positions[:, :2], features=features,\n",{"type":69,"tag":332,"props":1454,"children":1455},{"class":334,"line":398},[1456],{"type":69,"tag":332,"props":1457,"children":1458},{},[1459],{"type":74,"value":554},{"type":69,"tag":332,"props":1461,"children":1462},{"class":334,"line":407},[1463],{"type":69,"tag":332,"props":1464,"children":1465},{},[1466],{"type":74,"value":1467},"# graph -> {\"x\": features, \"edge_index\": (2,E), \"coords\": (N,2)}\n",{"type":69,"tag":1071,"props":1469,"children":1471},{"id":1470},"stain-normalization",[1472],{"type":74,"value":1473},"Stain normalization",{"type":69,"tag":321,"props":1475,"children":1477},{"className":323,"code":1476,"language":325,"meta":326,"style":326},"from tiatoolbox.tools.stainnorm import get_normalizer\n\nnorm = get_normalizer(\"reinhard\")   # or \"macenko\", \"vahadane\"\nnorm.fit(target_tile)               # RGB ndarray HxWx3\nnormed = norm.transform(source_tile)\n",[1478],{"type":69,"tag":95,"props":1479,"children":1480},{"__ignoreMap":326},[1481,1489,1496,1504,1512],{"type":69,"tag":332,"props":1482,"children":1483},{"class":334,"line":335},[1484],{"type":69,"tag":332,"props":1485,"children":1486},{},[1487],{"type":74,"value":1488},"from tiatoolbox.tools.stainnorm import get_normalizer\n",{"type":69,"tag":332,"props":1490,"children":1491},{"class":334,"line":344},[1492],{"type":69,"tag":332,"props":1493,"children":1494},{"emptyLinePlaceholder":392},[1495],{"type":74,"value":395},{"type":69,"tag":332,"props":1497,"children":1498},{"class":334,"line":353},[1499],{"type":69,"tag":332,"props":1500,"children":1501},{},[1502],{"type":74,"value":1503},"norm = get_normalizer(\"reinhard\")   # or \"macenko\", \"vahadane\"\n",{"type":69,"tag":332,"props":1505,"children":1506},{"class":334,"line":26},[1507],{"type":69,"tag":332,"props":1508,"children":1509},{},[1510],{"type":74,"value":1511},"norm.fit(target_tile)               # RGB ndarray HxWx3\n",{"type":69,"tag":332,"props":1513,"children":1514},{"class":334,"line":370},[1515],{"type":69,"tag":332,"props":1516,"children":1517},{},[1518],{"type":74,"value":1519},"normed = norm.transform(source_tile)\n",{"type":69,"tag":77,"props":1521,"children":1523},{"id":1522},"h-optimus-0-foundation-model",[1524],{"type":74,"value":1525},"H-optimus-0 Foundation Model",{"type":69,"tag":84,"props":1527,"children":1528},{},[1529,1531,1536,1538,1543,1545,1551],{"type":74,"value":1530},"1.1B-parameter ViT-G\u002F14, input ",{"type":69,"tag":206,"props":1532,"children":1533},{},[1534],{"type":74,"value":1535},"224×224 RGB at 0.5 mpp",{"type":74,"value":1537},", output ",{"type":69,"tag":206,"props":1539,"children":1540},{},[1541],{"type":74,"value":1542},"1536-d",{"type":74,"value":1544}," embedding. License is gated — accept terms on Hugging Face and run ",{"type":69,"tag":95,"props":1546,"children":1548},{"className":1547},[],[1549],{"type":74,"value":1550},"huggingface-cli login",{"type":74,"value":236},{"type":69,"tag":1071,"props":1553,"children":1555},{"id":1554},"direct-timm-usage",[1556],{"type":74,"value":1557},"Direct timm usage",{"type":69,"tag":321,"props":1559,"children":1561},{"className":323,"code":1560,"language":325,"meta":326,"style":326},"import timm, torch\nfrom torchvision import transforms\n\nmodel = timm.create_model(\n    \"hf-hub:bioptimus\u002FH-optimus-0\",\n    pretrained=True,\n    init_values=1e-5,\n    dynamic_img_size=False,\n).eval().to(\"cuda\")\n\npreprocess = transforms.Compose([\n    transforms.ToTensor(),\n    transforms.Normalize(\n        mean=(0.707223, 0.578729, 0.703617),\n        std=(0.211883, 0.230117, 0.177517),\n    ),\n])\n\nwith torch.inference_mode(), torch.autocast(\"cuda\", dtype=torch.float16):\n    feats = model(preprocess(tile).unsqueeze(0).to(\"cuda\"))   # (1, 1536)\n",[1562],{"type":69,"tag":95,"props":1563,"children":1564},{"__ignoreMap":326},[1565,1573,1581,1588,1596,1604,1612,1620,1628,1636,1643,1651,1659,1667,1675,1683,1691,1699,1706,1714],{"type":69,"tag":332,"props":1566,"children":1567},{"class":334,"line":335},[1568],{"type":69,"tag":332,"props":1569,"children":1570},{},[1571],{"type":74,"value":1572},"import timm, torch\n",{"type":69,"tag":332,"props":1574,"children":1575},{"class":334,"line":344},[1576],{"type":69,"tag":332,"props":1577,"children":1578},{},[1579],{"type":74,"value":1580},"from torchvision import transforms\n",{"type":69,"tag":332,"props":1582,"children":1583},{"class":334,"line":353},[1584],{"type":69,"tag":332,"props":1585,"children":1586},{"emptyLinePlaceholder":392},[1587],{"type":74,"value":395},{"type":69,"tag":332,"props":1589,"children":1590},{"class":334,"line":26},[1591],{"type":69,"tag":332,"props":1592,"children":1593},{},[1594],{"type":74,"value":1595},"model = timm.create_model(\n",{"type":69,"tag":332,"props":1597,"children":1598},{"class":334,"line":370},[1599],{"type":69,"tag":332,"props":1600,"children":1601},{},[1602],{"type":74,"value":1603},"    \"hf-hub:bioptimus\u002FH-optimus-0\",\n",{"type":69,"tag":332,"props":1605,"children":1606},{"class":334,"line":379},[1607],{"type":69,"tag":332,"props":1608,"children":1609},{},[1610],{"type":74,"value":1611},"    pretrained=True,\n",{"type":69,"tag":332,"props":1613,"children":1614},{"class":334,"line":388},[1615],{"type":69,"tag":332,"props":1616,"children":1617},{},[1618],{"type":74,"value":1619},"    init_values=1e-5,\n",{"type":69,"tag":332,"props":1621,"children":1622},{"class":334,"line":398},[1623],{"type":69,"tag":332,"props":1624,"children":1625},{},[1626],{"type":74,"value":1627},"    dynamic_img_size=False,\n",{"type":69,"tag":332,"props":1629,"children":1630},{"class":334,"line":407},[1631],{"type":69,"tag":332,"props":1632,"children":1633},{},[1634],{"type":74,"value":1635},").eval().to(\"cuda\")\n",{"type":69,"tag":332,"props":1637,"children":1638},{"class":334,"line":416},[1639],{"type":69,"tag":332,"props":1640,"children":1641},{"emptyLinePlaceholder":392},[1642],{"type":74,"value":395},{"type":69,"tag":332,"props":1644,"children":1645},{"class":334,"line":425},[1646],{"type":69,"tag":332,"props":1647,"children":1648},{},[1649],{"type":74,"value":1650},"preprocess = transforms.Compose([\n",{"type":69,"tag":332,"props":1652,"children":1653},{"class":334,"line":433},[1654],{"type":69,"tag":332,"props":1655,"children":1656},{},[1657],{"type":74,"value":1658},"    transforms.ToTensor(),\n",{"type":69,"tag":332,"props":1660,"children":1661},{"class":334,"line":442},[1662],{"type":69,"tag":332,"props":1663,"children":1664},{},[1665],{"type":74,"value":1666},"    transforms.Normalize(\n",{"type":69,"tag":332,"props":1668,"children":1669},{"class":334,"line":451},[1670],{"type":69,"tag":332,"props":1671,"children":1672},{},[1673],{"type":74,"value":1674},"        mean=(0.707223, 0.578729, 0.703617),\n",{"type":69,"tag":332,"props":1676,"children":1677},{"class":334,"line":460},[1678],{"type":69,"tag":332,"props":1679,"children":1680},{},[1681],{"type":74,"value":1682},"        std=(0.211883, 0.230117, 0.177517),\n",{"type":69,"tag":332,"props":1684,"children":1685},{"class":334,"line":469},[1686],{"type":69,"tag":332,"props":1687,"children":1688},{},[1689],{"type":74,"value":1690},"    ),\n",{"type":69,"tag":332,"props":1692,"children":1693},{"class":334,"line":477},[1694],{"type":69,"tag":332,"props":1695,"children":1696},{},[1697],{"type":74,"value":1698},"])\n",{"type":69,"tag":332,"props":1700,"children":1701},{"class":334,"line":486},[1702],{"type":69,"tag":332,"props":1703,"children":1704},{"emptyLinePlaceholder":392},[1705],{"type":74,"value":395},{"type":69,"tag":332,"props":1707,"children":1708},{"class":334,"line":495},[1709],{"type":69,"tag":332,"props":1710,"children":1711},{},[1712],{"type":74,"value":1713},"with torch.inference_mode(), torch.autocast(\"cuda\", dtype=torch.float16):\n",{"type":69,"tag":332,"props":1715,"children":1716},{"class":334,"line":503},[1717],{"type":69,"tag":332,"props":1718,"children":1719},{},[1720],{"type":74,"value":1721},"    feats = model(preprocess(tile).unsqueeze(0).to(\"cuda\"))   # (1, 1536)\n",{"type":69,"tag":84,"props":1723,"children":1724},{},[1725,1726,1732,1734,1740,1742,1747],{"type":74,"value":1055},{"type":69,"tag":95,"props":1727,"children":1729},{"className":1728},[],[1730],{"type":74,"value":1731},"batch_size=16",{"type":74,"value":1733}," on a 24 GB GPU with fp16 autocast. Prefer ",{"type":69,"tag":95,"props":1735,"children":1737},{"className":1736},[],[1738],{"type":74,"value":1739},"TimmBackbone(\"H-optimus-0\", pretrained=True)",{"type":74,"value":1741}," inside ",{"type":69,"tag":95,"props":1743,"children":1745},{"className":1744},[],[1746],{"type":74,"value":115},{"type":74,"value":1748}," — TIAToolbox applies the correct preprocessing automatically.",{"type":69,"tag":77,"props":1750,"children":1752},{"id":1751},"resolution-rules",[1753],{"type":74,"value":1754},"Resolution Rules",{"type":69,"tag":1756,"props":1757,"children":1758},"table",{},[1759,1782],{"type":69,"tag":1760,"props":1761,"children":1762},"thead",{},[1763],{"type":69,"tag":1764,"props":1765,"children":1766},"tr",{},[1767,1773,1777],{"type":69,"tag":1768,"props":1769,"children":1770},"th",{},[1771],{"type":74,"value":1772},"Model",{"type":69,"tag":1768,"props":1774,"children":1775},{},[1776],{"type":74,"value":244},{"type":69,"tag":1768,"props":1778,"children":1779},{},[1780],{"type":74,"value":1781},"Patch size",{"type":69,"tag":1783,"props":1784,"children":1785},"tbody",{},[1786,1805,1823,1840],{"type":69,"tag":1764,"props":1787,"children":1788},{},[1789,1795,1800],{"type":69,"tag":1790,"props":1791,"children":1792},"td",{},[1793],{"type":74,"value":1794},"H-optimus-0 \u002F UNI \u002F Prov-GigaPath",{"type":69,"tag":1790,"props":1796,"children":1797},{},[1798],{"type":74,"value":1799},"0.5",{"type":69,"tag":1790,"props":1801,"children":1802},{},[1803],{"type":74,"value":1804},"224×224",{"type":69,"tag":1764,"props":1806,"children":1807},{},[1808,1813,1818],{"type":69,"tag":1790,"props":1809,"children":1810},{},[1811],{"type":74,"value":1812},"HoVer-Net (PanNuke)",{"type":69,"tag":1790,"props":1814,"children":1815},{},[1816],{"type":74,"value":1817},"0.25",{"type":69,"tag":1790,"props":1819,"children":1820},{},[1821],{"type":74,"value":1822},"256×256",{"type":69,"tag":1764,"props":1824,"children":1825},{},[1826,1831,1835],{"type":69,"tag":1790,"props":1827,"children":1828},{},[1829],{"type":74,"value":1830},"SlideGraph CNN features",{"type":69,"tag":1790,"props":1832,"children":1833},{},[1834],{"type":74,"value":1817},{"type":69,"tag":1790,"props":1836,"children":1837},{},[1838],{"type":74,"value":1839},"512×512",{"type":69,"tag":1764,"props":1841,"children":1842},{},[1843,1848,1853],{"type":69,"tag":1790,"props":1844,"children":1845},{},[1846],{"type":74,"value":1847},"Tissue mask (Otsu)",{"type":69,"tag":1790,"props":1849,"children":1850},{},[1851],{"type":74,"value":1852},"4 mpp or 1.25×",{"type":69,"tag":1790,"props":1854,"children":1855},{},[1856],{"type":74,"value":1857},"—",{"type":69,"tag":84,"props":1859,"children":1860},{},[1861,1863,1868],{"type":74,"value":1862},"Downsample factor = ",{"type":69,"tag":95,"props":1864,"children":1866},{"className":1865},[],[1867],{"type":74,"value":267},{"type":74,"value":1869},". For a 0.25-mpp slide targeting 0.5 mpp, downsample by 2.",{"type":69,"tag":77,"props":1871,"children":1873},{"id":1872},"camelyon-datasets",[1874],{"type":74,"value":1875},"CAMELYON Datasets",{"type":69,"tag":130,"props":1877,"children":1878},{},[1879,1897,1913,1946],{"type":69,"tag":134,"props":1880,"children":1881},{},[1882,1887,1889,1895],{"type":69,"tag":206,"props":1883,"children":1884},{},[1885],{"type":74,"value":1886},"Format",{"type":74,"value":1888},": pyramidal ",{"type":69,"tag":95,"props":1890,"children":1892},{"className":1891},[],[1893],{"type":74,"value":1894},".tif",{"type":74,"value":1896},", OpenSlide-compatible, ~100 000 × 100 000 px at baseline.",{"type":69,"tag":134,"props":1898,"children":1899},{},[1900,1905,1907,1912],{"type":69,"tag":206,"props":1901,"children":1902},{},[1903],{"type":74,"value":1904},"Annotations",{"type":74,"value":1906},": ASAP XML, polygon coordinates in ",{"type":69,"tag":206,"props":1908,"children":1909},{},[1910],{"type":74,"value":1911},"baseline (level-0) pixels",{"type":74,"value":236},{"type":69,"tag":134,"props":1914,"children":1915},{},[1916,1921,1923,1929,1930,1936,1938,1944],{"type":69,"tag":206,"props":1917,"children":1918},{},[1919],{"type":74,"value":1920},"CAMELYON16",{"type":74,"value":1922},": 270 training slides (",{"type":69,"tag":95,"props":1924,"children":1926},{"className":1925},[],[1927],{"type":74,"value":1928},"normal\u002F",{"type":74,"value":228},{"type":69,"tag":95,"props":1931,"children":1933},{"className":1932},[],[1934],{"type":74,"value":1935},"tumor\u002F",{"type":74,"value":1937},") + 130 test slides, labels in ",{"type":69,"tag":95,"props":1939,"children":1941},{"className":1940},[],[1942],{"type":74,"value":1943},"reference.csv",{"type":74,"value":1945},". Task: slide-level tumor classification + tumor segmentation.",{"type":69,"tag":134,"props":1947,"children":1948},{},[1949,1954,1956,1962,1964,1969],{"type":69,"tag":206,"props":1950,"children":1951},{},[1952],{"type":74,"value":1953},"CAMELYON17",{"type":74,"value":1955},": 1000 slides across 100 patients (5 slides each). Patient-level pN-stage in ",{"type":69,"tag":95,"props":1957,"children":1959},{"className":1958},[],[1960],{"type":74,"value":1961},"stages.csv",{"type":74,"value":1963},". Official 5-fold split is ",{"type":69,"tag":206,"props":1965,"children":1966},{},[1967],{"type":74,"value":1968},"by patient",{"type":74,"value":1970}," — never split by slide.",{"type":69,"tag":321,"props":1972,"children":1974},{"className":323,"code":1973,"language":325,"meta":326,"style":326},"import xml.etree.ElementTree as ET\ntree = ET.parse(\"slide.xml\")                 # ASAP format\nfor ann in tree.iter(\"Annotation\"):\n    pts = [(float(c.get(\"X\")), float(c.get(\"Y\")))\n           for c in ann.iter(\"Coordinate\")]   # baseline coords\n",[1975],{"type":69,"tag":95,"props":1976,"children":1977},{"__ignoreMap":326},[1978,1986,1994,2002,2010],{"type":69,"tag":332,"props":1979,"children":1980},{"class":334,"line":335},[1981],{"type":69,"tag":332,"props":1982,"children":1983},{},[1984],{"type":74,"value":1985},"import xml.etree.ElementTree as ET\n",{"type":69,"tag":332,"props":1987,"children":1988},{"class":334,"line":344},[1989],{"type":69,"tag":332,"props":1990,"children":1991},{},[1992],{"type":74,"value":1993},"tree = ET.parse(\"slide.xml\")                 # ASAP format\n",{"type":69,"tag":332,"props":1995,"children":1996},{"class":334,"line":353},[1997],{"type":69,"tag":332,"props":1998,"children":1999},{},[2000],{"type":74,"value":2001},"for ann in tree.iter(\"Annotation\"):\n",{"type":69,"tag":332,"props":2003,"children":2004},{"class":334,"line":26},[2005],{"type":69,"tag":332,"props":2006,"children":2007},{},[2008],{"type":74,"value":2009},"    pts = [(float(c.get(\"X\")), float(c.get(\"Y\")))\n",{"type":69,"tag":332,"props":2011,"children":2012},{"class":334,"line":370},[2013],{"type":69,"tag":332,"props":2014,"children":2015},{},[2016],{"type":74,"value":2017},"           for c in ann.iter(\"Coordinate\")]   # baseline coords\n",{"type":69,"tag":77,"props":2019,"children":2021},{"id":2020},"sagemaker-deployment",[2022],{"type":74,"value":2023},"SageMaker Deployment",{"type":69,"tag":84,"props":2025,"children":2026},{},[2027,2029,2034,2036,2041,2043,2049,2051,2057],{"type":74,"value":2028},"WSIs are gigapixel — ",{"type":69,"tag":206,"props":2030,"children":2031},{},[2032],{"type":74,"value":2033},"never send raw bytes through the invocation path",{"type":74,"value":2035},". Pass an ",{"type":69,"tag":206,"props":2037,"children":2038},{},[2039],{"type":74,"value":2040},"S3 URI",{"type":74,"value":2042}," in the request and let the container read via ",{"type":69,"tag":95,"props":2044,"children":2046},{"className":2045},[],[2047],{"type":74,"value":2048},"s3fs",{"type":74,"value":2050}," \u002F ",{"type":69,"tag":95,"props":2052,"children":2054},{"className":2053},[],[2055],{"type":74,"value":2056},"boto3",{"type":74,"value":236},{"type":69,"tag":130,"props":2059,"children":2060},{},[2061,2085,2102,2118,2134,2159],{"type":69,"tag":134,"props":2062,"children":2063},{},[2064,2069,2071,2076,2078,2083],{"type":69,"tag":206,"props":2065,"children":2066},{},[2067],{"type":74,"value":2068},"Endpoint type",{"type":74,"value":2070},": ",{"type":69,"tag":206,"props":2072,"children":2073},{},[2074],{"type":74,"value":2075},"Async Inference",{"type":74,"value":2077}," (long-running, per-request) or ",{"type":69,"tag":206,"props":2079,"children":2080},{},[2081],{"type":74,"value":2082},"Batch Transform",{"type":74,"value":2084}," (cohort scoring).",{"type":69,"tag":134,"props":2086,"children":2087},{},[2088,2093,2095,2101],{"type":69,"tag":206,"props":2089,"children":2090},{},[2091],{"type":74,"value":2092},"Base container",{"type":74,"value":2094},": extend ",{"type":69,"tag":95,"props":2096,"children":2098},{"className":2097},[],[2099],{"type":74,"value":2100},"763104351884.dkr.ecr.\u003Cregion>.amazonaws.com\u002Fpytorch-inference:2.x-gpu-py310",{"type":74,"value":236},{"type":69,"tag":134,"props":2103,"children":2104},{},[2105,2110,2111,2117],{"type":69,"tag":206,"props":2106,"children":2107},{},[2108],{"type":74,"value":2109},"Apt packages",{"type":74,"value":2070},{"type":69,"tag":95,"props":2112,"children":2114},{"className":2113},[],[2115],{"type":74,"value":2116},"openslide-tools libpixman-1-dev libvips",{"type":74,"value":236},{"type":69,"tag":134,"props":2119,"children":2120},{},[2121,2126,2127,2133],{"type":69,"tag":206,"props":2122,"children":2123},{},[2124],{"type":74,"value":2125},"Pip",{"type":74,"value":2070},{"type":69,"tag":95,"props":2128,"children":2130},{"className":2129},[],[2131],{"type":74,"value":2132},"tiatoolbox timm huggingface_hub s3fs",{"type":74,"value":236},{"type":69,"tag":134,"props":2135,"children":2136},{},[2137,2142,2143,2149,2151,2157],{"type":69,"tag":206,"props":2138,"children":2139},{},[2140],{"type":74,"value":2141},"Instance",{"type":74,"value":2070},{"type":69,"tag":95,"props":2144,"children":2146},{"className":2145},[],[2147],{"type":74,"value":2148},"ml.g5.2xlarge",{"type":74,"value":2150}," minimum for H-optimus-0 fp16 (24 GB A10G). Use ",{"type":69,"tag":95,"props":2152,"children":2154},{"className":2153},[],[2155],{"type":74,"value":2156},"ml.g5.12xlarge",{"type":74,"value":2158}," for batches.",{"type":69,"tag":134,"props":2160,"children":2161},{},[2162,2167,2168,2174,2175,2181],{"type":69,"tag":206,"props":2163,"children":2164},{},[2165],{"type":74,"value":2166},"Async config",{"type":74,"value":2070},{"type":69,"tag":95,"props":2169,"children":2171},{"className":2170},[],[2172],{"type":74,"value":2173},"invocations_timeout=3600",{"type":74,"value":102},{"type":69,"tag":95,"props":2176,"children":2178},{"className":2177},[],[2179],{"type":74,"value":2180},"max_concurrent_invocations_per_instance=2",{"type":74,"value":236},{"type":69,"tag":321,"props":2183,"children":2185},{"className":323,"code":2184,"language":325,"meta":326,"style":326},"from sagemaker.async_inference import AsyncInferenceConfig\nasync_config = AsyncInferenceConfig(\n    output_path=\"s3:\u002F\u002Fbucket\u002Fasync-out\u002F\",\n    max_concurrent_invocations_per_instance=2,\n)\npredictor = model.deploy(\n    instance_type=\"ml.g5.2xlarge\", initial_instance_count=1,\n    async_inference_config=async_config,\n)\npredictor.predict_async(input_path=\"s3:\u002F\u002Fbucket\u002Fslides\u002Fslide.svs\")\n",[2186],{"type":69,"tag":95,"props":2187,"children":2188},{"__ignoreMap":326},[2189,2197,2205,2213,2221,2228,2236,2244,2252,2259],{"type":69,"tag":332,"props":2190,"children":2191},{"class":334,"line":335},[2192],{"type":69,"tag":332,"props":2193,"children":2194},{},[2195],{"type":74,"value":2196},"from sagemaker.async_inference import AsyncInferenceConfig\n",{"type":69,"tag":332,"props":2198,"children":2199},{"class":334,"line":344},[2200],{"type":69,"tag":332,"props":2201,"children":2202},{},[2203],{"type":74,"value":2204},"async_config = AsyncInferenceConfig(\n",{"type":69,"tag":332,"props":2206,"children":2207},{"class":334,"line":353},[2208],{"type":69,"tag":332,"props":2209,"children":2210},{},[2211],{"type":74,"value":2212},"    output_path=\"s3:\u002F\u002Fbucket\u002Fasync-out\u002F\",\n",{"type":69,"tag":332,"props":2214,"children":2215},{"class":334,"line":26},[2216],{"type":69,"tag":332,"props":2217,"children":2218},{},[2219],{"type":74,"value":2220},"    max_concurrent_invocations_per_instance=2,\n",{"type":69,"tag":332,"props":2222,"children":2223},{"class":334,"line":370},[2224],{"type":69,"tag":332,"props":2225,"children":2226},{},[2227],{"type":74,"value":554},{"type":69,"tag":332,"props":2229,"children":2230},{"class":334,"line":379},[2231],{"type":69,"tag":332,"props":2232,"children":2233},{},[2234],{"type":74,"value":2235},"predictor = model.deploy(\n",{"type":69,"tag":332,"props":2237,"children":2238},{"class":334,"line":388},[2239],{"type":69,"tag":332,"props":2240,"children":2241},{},[2242],{"type":74,"value":2243},"    instance_type=\"ml.g5.2xlarge\", initial_instance_count=1,\n",{"type":69,"tag":332,"props":2245,"children":2246},{"class":334,"line":398},[2247],{"type":69,"tag":332,"props":2248,"children":2249},{},[2250],{"type":74,"value":2251},"    async_inference_config=async_config,\n",{"type":69,"tag":332,"props":2253,"children":2254},{"class":334,"line":407},[2255],{"type":69,"tag":332,"props":2256,"children":2257},{},[2258],{"type":74,"value":554},{"type":69,"tag":332,"props":2260,"children":2261},{"class":334,"line":416},[2262],{"type":69,"tag":332,"props":2263,"children":2264},{},[2265],{"type":74,"value":2266},"predictor.predict_async(input_path=\"s3:\u002F\u002Fbucket\u002Fslides\u002Fslide.svs\")\n",{"type":69,"tag":84,"props":2268,"children":2269},{},[2270],{"type":74,"value":2271},"Dockerfile sketch:",{"type":69,"tag":321,"props":2273,"children":2277},{"className":2274,"code":2275,"language":2276,"meta":326,"style":326},"language-dockerfile shiki shiki-themes material-theme-lighter material-theme material-theme-palenight","FROM 763104351884.dkr.ecr.us-east-1.amazonaws.com\u002Fpytorch-inference:2.3.0-gpu-py310\nRUN apt-get update && apt-get install -y openslide-tools libpixman-1-dev libvips \\\n && rm -rf \u002Fvar\u002Flib\u002Fapt\u002Flists\u002F*\nRUN pip install --no-cache-dir tiatoolbox timm huggingface_hub s3fs\n","dockerfile",[2278],{"type":69,"tag":95,"props":2279,"children":2280},{"__ignoreMap":326},[2281,2289,2297,2305],{"type":69,"tag":332,"props":2282,"children":2283},{"class":334,"line":335},[2284],{"type":69,"tag":332,"props":2285,"children":2286},{},[2287],{"type":74,"value":2288},"FROM 763104351884.dkr.ecr.us-east-1.amazonaws.com\u002Fpytorch-inference:2.3.0-gpu-py310\n",{"type":69,"tag":332,"props":2290,"children":2291},{"class":334,"line":344},[2292],{"type":69,"tag":332,"props":2293,"children":2294},{},[2295],{"type":74,"value":2296},"RUN apt-get update && apt-get install -y openslide-tools libpixman-1-dev libvips \\\n",{"type":69,"tag":332,"props":2298,"children":2299},{"class":334,"line":353},[2300],{"type":69,"tag":332,"props":2301,"children":2302},{},[2303],{"type":74,"value":2304}," && rm -rf \u002Fvar\u002Flib\u002Fapt\u002Flists\u002F*\n",{"type":69,"tag":332,"props":2306,"children":2307},{"class":334,"line":26},[2308],{"type":69,"tag":332,"props":2309,"children":2310},{},[2311],{"type":74,"value":2312},"RUN pip install --no-cache-dir tiatoolbox timm huggingface_hub s3fs\n",{"type":69,"tag":77,"props":2314,"children":2316},{"id":2315},"common-mistakes",[2317],{"type":74,"value":2318},"Common Mistakes",{"type":69,"tag":130,"props":2320,"children":2321},{},[2322,2362,2406,2440,2469,2504,2541,2576,2605,2633],{"type":69,"tag":134,"props":2323,"children":2324},{},[2325,2330,2332,2337,2339,2345,2347,2352,2354,2360],{"type":69,"tag":206,"props":2326,"children":2327},{},[2328],{"type":74,"value":2329},"Wrong:",{"type":74,"value":2331}," Using an old pixman library (\u003C0.40) with OpenSlide\n",{"type":69,"tag":206,"props":2333,"children":2334},{},[2335],{"type":74,"value":2336},"Right:",{"type":74,"value":2338}," ",{"type":69,"tag":95,"props":2340,"children":2342},{"className":2341},[],[2343],{"type":74,"value":2344},"apt-get install libpixman-1-dev",{"type":74,"value":2346}," and rebuild, or use libvips ≥ 8.12\n",{"type":69,"tag":206,"props":2348,"children":2349},{},[2350],{"type":74,"value":2351},"Why:",{"type":74,"value":2353}," Causes all-black tiles from ",{"type":69,"tag":95,"props":2355,"children":2357},{"className":2356},[],[2358],{"type":74,"value":2359},"read_rect",{"type":74,"value":2361}," due to a rendering bug",{"type":69,"tag":134,"props":2363,"children":2364},{},[2365,2369,2371,2375,2377,2382,2384,2390,2392,2396,2398,2404],{"type":69,"tag":206,"props":2366,"children":2367},{},[2368],{"type":74,"value":2329},{"type":74,"value":2370}," Requesting a resolution finer than the slide's native mpp\n",{"type":69,"tag":206,"props":2372,"children":2373},{},[2374],{"type":74,"value":2336},{"type":74,"value":2376}," Use a coarser ",{"type":69,"tag":95,"props":2378,"children":2380},{"className":2379},[],[2381],{"type":74,"value":226},{"type":74,"value":2383},", or check ",{"type":69,"tag":95,"props":2385,"children":2387},{"className":2386},[],[2388],{"type":74,"value":2389},"reader.info.mpp",{"type":74,"value":2391}," first\n",{"type":69,"tag":206,"props":2393,"children":2394},{},[2395],{"type":74,"value":2351},{"type":74,"value":2397}," Triggers ",{"type":69,"tag":95,"props":2399,"children":2401},{"className":2400},[],[2402],{"type":74,"value":2403},"UserWarning: Scale > 1",{"type":74,"value":2405}," and produces upsampled (interpolated) data",{"type":69,"tag":134,"props":2407,"children":2408},{},[2409,2413,2415,2419,2421,2426,2430,2432,2438],{"type":69,"tag":206,"props":2410,"children":2411},{},[2412],{"type":74,"value":2329},{"type":74,"value":2414}," Attempting to load H-optimus-0 without accepting the gated model terms\n",{"type":69,"tag":206,"props":2416,"children":2417},{},[2418],{"type":74,"value":2336},{"type":74,"value":2420}," Accept terms on the Hugging Face model page, then run ",{"type":69,"tag":95,"props":2422,"children":2424},{"className":2423},[],[2425],{"type":74,"value":1550},{"type":69,"tag":206,"props":2427,"children":2428},{},[2429],{"type":74,"value":2351},{"type":74,"value":2431}," Results in ",{"type":69,"tag":95,"props":2433,"children":2435},{"className":2434},[],[2436],{"type":74,"value":2437},"OSError: 401",{"type":74,"value":2439}," authentication failure",{"type":69,"tag":134,"props":2441,"children":2442},{},[2443,2447,2449,2453,2455,2461,2463,2467],{"type":69,"tag":206,"props":2444,"children":2445},{},[2446],{"type":74,"value":2329},{"type":74,"value":2448}," Using a batch size too large for GPU memory in DeepFeatureExtractor\n",{"type":69,"tag":206,"props":2450,"children":2451},{},[2452],{"type":74,"value":2336},{"type":74,"value":2454}," Lower ",{"type":69,"tag":95,"props":2456,"children":2458},{"className":2457},[],[2459],{"type":74,"value":2460},"batch_size",{"type":74,"value":2462}," (16→8→4) and ensure fp16 autocast is enabled\n",{"type":69,"tag":206,"props":2464,"children":2465},{},[2466],{"type":74,"value":2351},{"type":74,"value":2468}," Causes CUDA out-of-memory errors",{"type":69,"tag":134,"props":2470,"children":2471},{},[2472,2476,2478,2482,2484,2490,2494,2496,2502],{"type":69,"tag":206,"props":2473,"children":2474},{},[2475],{"type":74,"value":2329},{"type":74,"value":2477}," Passing a non-pyramidal TIFF to OpenSlide\n",{"type":69,"tag":206,"props":2479,"children":2480},{},[2481],{"type":74,"value":2336},{"type":74,"value":2483}," Convert first with ",{"type":69,"tag":95,"props":2485,"children":2487},{"className":2486},[],[2488],{"type":74,"value":2489},"vips tiffsave in.tif out.tif --tile --pyramid --compression jpeg",{"type":69,"tag":206,"props":2491,"children":2492},{},[2493],{"type":74,"value":2351},{"type":74,"value":2495}," Raises ",{"type":69,"tag":95,"props":2497,"children":2499},{"className":2498},[],[2500],{"type":74,"value":2501},"OpenSlideUnsupportedFormatError",{"type":74,"value":2503}," because OpenSlide requires pyramidal format",{"type":69,"tag":134,"props":2505,"children":2506},{},[2507,2511,2513,2517,2519,2525,2527,2531,2533,2539],{"type":69,"tag":206,"props":2508,"children":2509},{},[2510],{"type":74,"value":2329},{"type":74,"value":2512}," Passing a numpy array as an external mask with shape not aligned to the WSI pyramid\n",{"type":69,"tag":206,"props":2514,"children":2515},{},[2516],{"type":74,"value":2336},{"type":74,"value":2518}," Use ",{"type":69,"tag":95,"props":2520,"children":2522},{"className":2521},[],[2523],{"type":74,"value":2524},"reader.tissue_mask(...)",{"type":74,"value":2526}," directly and pass the returned reader object\n",{"type":69,"tag":206,"props":2528,"children":2529},{},[2530],{"type":74,"value":2351},{"type":74,"value":2532}," Causes ",{"type":69,"tag":95,"props":2534,"children":2536},{"className":2535},[],[2537],{"type":74,"value":2538},"DimensionMismatchError",{"type":74,"value":2540}," due to resolution\u002Fshape mismatch",{"type":69,"tag":134,"props":2542,"children":2543},{},[2544,2548,2550,2554,2556,2562,2564,2570,2574],{"type":69,"tag":206,"props":2545,"children":2546},{},[2547],{"type":74,"value":2329},{"type":74,"value":2549}," Processing PNG tiles without specifying resolution units\n",{"type":69,"tag":206,"props":2551,"children":2552},{},[2553],{"type":74,"value":2336},{"type":74,"value":2555}," Pass ",{"type":69,"tag":95,"props":2557,"children":2559},{"className":2558},[],[2560],{"type":74,"value":2561},"units=\"baseline\"",{"type":74,"value":2563}," and explicit ",{"type":69,"tag":95,"props":2565,"children":2567},{"className":2566},[],[2568],{"type":74,"value":2569},"resolution=1.0",{"type":69,"tag":206,"props":2571,"children":2572},{},[2573],{"type":74,"value":2351},{"type":74,"value":2575}," Tiles lack mpp metadata, triggering an \"unknown scale\" warning",{"type":69,"tag":134,"props":2577,"children":2578},{},[2579,2583,2585,2589,2591,2597,2599,2603],{"type":69,"tag":206,"props":2580,"children":2581},{},[2582],{"type":74,"value":2329},{"type":74,"value":2584}," Splitting CAMELYON17 data by slide rather than by patient\n",{"type":69,"tag":206,"props":2586,"children":2587},{},[2588],{"type":74,"value":2336},{"type":74,"value":2590}," Split by ",{"type":69,"tag":95,"props":2592,"children":2594},{"className":2593},[],[2595],{"type":74,"value":2596},"patient_id",{"type":74,"value":2598}," (5-fold) per the official protocol\n",{"type":69,"tag":206,"props":2600,"children":2601},{},[2602],{"type":74,"value":2351},{"type":74,"value":2604}," Causes patient data leakage since each patient has 5 slides",{"type":69,"tag":134,"props":2606,"children":2607},{},[2608,2612,2614,2618,2619,2625,2627,2631],{"type":69,"tag":206,"props":2609,"children":2610},{},[2611],{"type":74,"value":2329},{"type":74,"value":2613}," Skipping H-optimus-0 normalization (mean\u002Fstd) when extracting features\n",{"type":69,"tag":206,"props":2615,"children":2616},{},[2617],{"type":74,"value":2336},{"type":74,"value":2518},{"type":69,"tag":95,"props":2620,"children":2622},{"className":2621},[],[2623],{"type":74,"value":2624},"TimmBackbone",{"type":74,"value":2626}," (applies normalization automatically) or apply mean\u002Fstd explicitly\n",{"type":69,"tag":206,"props":2628,"children":2629},{},[2630],{"type":74,"value":2351},{"type":74,"value":2632}," Features look random and produce low AUC without proper input normalization",{"type":69,"tag":134,"props":2634,"children":2635},{},[2636,2640,2642,2646,2648,2652,2654,2658],{"type":69,"tag":206,"props":2637,"children":2638},{},[2639],{"type":74,"value":2329},{"type":74,"value":2641}," Using annotation coordinates at the wrong pyramid level\n",{"type":69,"tag":206,"props":2643,"children":2644},{},[2645],{"type":74,"value":2336},{"type":74,"value":2647}," ASAP XML coordinates are always at ",{"type":69,"tag":206,"props":2649,"children":2650},{},[2651],{"type":74,"value":218},{"type":74,"value":2653}," level — scale them when reading at lower resolution\n",{"type":69,"tag":206,"props":2655,"children":2656},{},[2657],{"type":74,"value":2351},{"type":74,"value":2659}," Coordinates will be off by 2× or 4× if the level mismatch is not accounted for",{"type":69,"tag":77,"props":2661,"children":2663},{"id":2662},"minimal-dependency-set",[2664],{"type":74,"value":2665},"Minimal Dependency Set",{"type":69,"tag":321,"props":2667,"children":2671},{"className":2668,"code":2670,"language":74},[2669],"language-text","tiatoolbox>=1.5\ntimm>=1.0\ntorch>=2.1\nopenslide-python\nhuggingface_hub\n",[2672],{"type":69,"tag":95,"props":2673,"children":2674},{"__ignoreMap":326},[2675],{"type":74,"value":2670},{"type":69,"tag":84,"props":2677,"children":2678},{},[2679,2681,2687,2688,2694,2695,2701],{"type":74,"value":2680},"System: ",{"type":69,"tag":95,"props":2682,"children":2684},{"className":2683},[],[2685],{"type":74,"value":2686},"openslide-tools",{"type":74,"value":102},{"type":69,"tag":95,"props":2689,"children":2691},{"className":2690},[],[2692],{"type":74,"value":2693},"libpixman-1-dev",{"type":74,"value":102},{"type":69,"tag":95,"props":2696,"children":2698},{"className":2697},[],[2699],{"type":74,"value":2700},"libvips",{"type":74,"value":2702}," (for non-pyramidal TIFF conversion).",{"type":69,"tag":77,"props":2704,"children":2706},{"id":2705},"references",[2707],{"type":74,"value":2708},"References",{"type":69,"tag":130,"props":2710,"children":2711},{},[2712,2725,2736,2747],{"type":69,"tag":134,"props":2713,"children":2714},{},[2715,2717],{"type":74,"value":2716},"TIAToolbox: Pocock et al. Commun Med 2022, ",{"type":69,"tag":2718,"props":2719,"children":2723},"a",{"href":2720,"rel":2721},"https:\u002F\u002Fdoi.org\u002F10.1038\u002Fs43856-022-00186-5",[2722],"nofollow",[2724],{"type":74,"value":2720},{"type":69,"tag":134,"props":2726,"children":2727},{},[2728,2730],{"type":74,"value":2729},"H-optimus-0: Bioptimus, ",{"type":69,"tag":2718,"props":2731,"children":2734},{"href":2732,"rel":2733},"https:\u002F\u002Fhuggingface.co\u002Fbioptimus\u002FH-optimus-0",[2722],[2735],{"type":74,"value":2732},{"type":69,"tag":134,"props":2737,"children":2738},{},[2739,2741],{"type":74,"value":2740},"CAMELYON16: Bejnordi et al. JAMA 2017, ",{"type":69,"tag":2718,"props":2742,"children":2745},{"href":2743,"rel":2744},"https:\u002F\u002Fdoi.org\u002F10.1001\u002Fjama.2017.14585",[2722],[2746],{"type":74,"value":2743},{"type":69,"tag":134,"props":2748,"children":2749},{},[2750,2752],{"type":74,"value":2751},"CAMELYON17: Bandi et al. IEEE TMI 2019, ",{"type":69,"tag":2718,"props":2753,"children":2756},{"href":2754,"rel":2755},"https:\u002F\u002Fdoi.org\u002F10.1109\u002FTMI.2018.2867350",[2722],[2757],{"type":74,"value":2754},{"type":69,"tag":2759,"props":2760,"children":2761},"style",{},[2762],{"type":74,"value":2763},"html .light .shiki span {color: var(--shiki-light);background: var(--shiki-light-bg);font-style: var(--shiki-light-font-style);font-weight: var(--shiki-light-font-weight);text-decoration: var(--shiki-light-text-decoration);}html.light .shiki span {color: var(--shiki-light);background: var(--shiki-light-bg);font-style: var(--shiki-light-font-style);font-weight: var(--shiki-light-font-weight);text-decoration: var(--shiki-light-text-decoration);}html .default .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .dark .shiki span {color: var(--shiki-dark);background: var(--shiki-dark-bg);font-style: var(--shiki-dark-font-style);font-weight: var(--shiki-dark-font-weight);text-decoration: var(--shiki-dark-text-decoration);}html.dark .shiki span {color: var(--shiki-dark);background: var(--shiki-dark-bg);font-style: var(--shiki-dark-font-style);font-weight: var(--shiki-dark-font-weight);text-decoration: var(--shiki-dark-text-decoration);}",{"items":2765,"total":2862},[2766,2784,2797,2811,2826,2839,2852],{"slug":2767,"name":2767,"fn":2768,"description":2769,"org":2770,"tags":2771,"stars":26,"repoUrl":27,"updatedAt":2783},"aws-genai-ml-architect","design AWS GenAI and ML architectures","Reasoning skill for designing AWS GenAI and ML architectures for healthcare and life sciences workloads. Use when the user asks to choose between SageMaker and Bedrock, design a RAG system over medical literature, architect clinical NLP or medical imaging inference, plan genomics or drug discovery pipelines on AWS, address HIPAA\u002FPHI compliance in ML systems, design MLOps for regulated clinical models, or optimize cost for HCLS ML workloads. Triggers include \"AWS architecture\", \"SageMaker vs Bedrock\", \"HIPAA ML\", \"clinical RAG\", \"medical imaging inference\", \"genomics on AWS\", \"PHI training\", \"MLOps healthcare\", \"Bedrock guardrails\", \"HealthLake\", \"HCLS cloud architecture\", \"BAA compliance\", \"SageMaker endpoint\", \"Bedrock knowledge base\", \"clinical NLP on AWS\", \"FDA SaMD on AWS\".",{"slug":8,"name":9,"logoUrl":10,"githubOrg":11},[2772,2775,2778,2779,2780],{"name":2773,"slug":2774,"type":16},"Architecture","architecture",{"name":2776,"slug":2777,"type":16},"AWS","aws",{"name":18,"slug":19,"type":16},{"name":21,"slug":22,"type":16},{"name":2781,"slug":2782,"type":16},"LLM","llm","2026-07-12T08:38:07.975937",{"slug":2785,"name":2785,"fn":2786,"description":2787,"org":2788,"tags":2789,"stars":26,"repoUrl":27,"updatedAt":2796},"biomarker-discovery","guide biomarker discovery and validation","Reason about biomarker discovery and validation in HCLS — classifying biomarker intent, choosing feature-selection and cross-validation strategies, avoiding leakage, and planning external replication. Use when the user asks to discover, develop, or validate a biomarker; select features from high-dimensional omics or clinical data; design a validation study; choose evaluation metrics; justify sample size; combine multi-omics signals; or assess clinical utility. Triggers include \"discover a biomarker\", \"validate biomarker\", \"prognostic vs predictive\", \"feature selection\", \"LASSO vs elastic net\", \"nested cross-validation\", \"data leakage\", \"C-index\", \"time-dependent AUC\", \"decision curve analysis\", \"external validation cohort\", \"events per variable\", \"optimism-corrected\", \"multi-omics integration\", \"clinical utility of a biomarker\", \"is this biomarker ready\".",{"slug":8,"name":9,"logoUrl":10,"githubOrg":11},[2790,2791,2794,2795],{"name":2776,"slug":2777,"type":16},{"name":2792,"slug":2793,"type":16},"Bioinformatics","bioinformatics",{"name":21,"slug":22,"type":16},{"name":14,"slug":15,"type":16},"2026-07-12T08:37:49.295301",{"slug":2798,"name":2798,"fn":2799,"description":2800,"org":2801,"tags":2802,"stars":26,"repoUrl":27,"updatedAt":2810},"cdisc-compliance","reason about CDISC SDTM and ADaM implementation","Reason about CDISC SDTM and ADaM implementation for regulatory submissions. Use when the user asks about SDTM domain mapping, ADaM dataset design, controlled terminology versioning, define.xml completeness, FDA or PMDA submission requirements, query prioritization by clinical impact, SUPPQUAL usage, or CDISC compliance review. Triggers include \"SDTM mapping\", \"ADaM dataset\", \"CDISC compliance\", \"controlled terminology\", \"define.xml\", \"FDA submission data\", \"PMDA submission\", \"SDTM domain\", \"ADSL\", \"ADAE\", \"ADLB\", \"BDS structure\", \"SUPPQUAL\", \"RELREC\", \"value-level metadata\", \"CDISC CT\", \"regulatory submission data standards\", \"eCTD datasets\", \"SDTM 3.3\", \"ADaM 1.1\", \"query prioritization\", \"clinical data review\".\n",{"slug":8,"name":9,"logoUrl":10,"githubOrg":11},[2803,2806,2807],{"name":2804,"slug":2805,"type":16},"Clinical Trials","clinical-trials",{"name":21,"slug":22,"type":16},{"name":2808,"slug":2809,"type":16},"Regulatory Compliance","regulatory-compliance","2026-07-12T08:37:33.35594",{"slug":2812,"name":2812,"fn":2813,"description":2814,"org":2815,"tags":2816,"stars":26,"repoUrl":27,"updatedAt":2825},"cell-type-annotation","annotate single-cell RNA-seq clusters","Generate code to assign cell type labels to single-cell RNA-seq clusters using CellTypist, SingleR, marker-based annotation, or reference label transfer (scANVI\u002Fingest). Triggers on requests to \"annotate cell types\", \"label clusters\", \"run CellTypist\", \"SingleR annotation\", \"marker gene dotplot\", \"transfer labels from reference atlas\", \"cell identity\", \"automated annotation\", \"reference mapping\", \"scANVI label transfer\", \"canonical markers\", \"immune cell types\", \"hierarchical annotation\", \"majority voting CellTypist\", \"over-clustering annotation\".",{"slug":8,"name":9,"logoUrl":10,"githubOrg":11},[2817,2818,2821,2822],{"name":2792,"slug":2793,"type":16},{"name":2819,"slug":2820,"type":16},"Data Analysis","data-analysis",{"name":21,"slug":22,"type":16},{"name":2823,"slug":2824,"type":16},"RNA-seq","rna-seq","2026-07-12T08:38:05.443454",{"slug":2827,"name":2827,"fn":2828,"description":2829,"org":2830,"tags":2831,"stars":26,"repoUrl":27,"updatedAt":2838},"cheminformatics","calculate molecular properties with RDKit","Cheminformatics pipeline for small-molecule property calculation, filtering, and similarity analysis using RDKit. Use when the user asks to compute molecular descriptors, filter compounds by Lipinski or Veber rules, detect PAINS, calculate fingerprint similarity, run matched molecular pair analysis, generate ADMET descriptors, or process SMILES. Triggers include \"RDKit\", \"molecular descriptors\", \"Lipinski\", \"rule of five\", \"Veber\", \"PAINS\", \"pan-assay interference\", \"Morgan fingerprint\", \"Tanimoto\", \"fingerprint similarity\", \"matched molecular pair\", \"MMP\", \"mmpdb\", \"ADMET\", \"druglikeness\", \"SMILES\", \"cheminformatics\", \"compound filtering\", \"chemical similarity\".",{"slug":8,"name":9,"logoUrl":10,"githubOrg":11},[2832,2833,2836,2837],{"name":2792,"slug":2793,"type":16},{"name":2834,"slug":2835,"type":16},"Chemistry","chemistry",{"name":2819,"slug":2820,"type":16},{"name":14,"slug":15,"type":16},"2026-07-12T08:37:28.334619",{"slug":2840,"name":2840,"fn":2841,"description":2842,"org":2843,"tags":2844,"stars":26,"repoUrl":27,"updatedAt":2851},"claims-analytics","analyze and parse healthcare claims data","Pipeline skill for healthcare claims data parsing, analysis, and fraud detection. Use when the user asks to parse X12 837 or 835 claim files, manipulate ICD-10 CPT or HCPCS codes, detect billing pattern anomalies, profile providers against specialty peers, identify outlier billing behavior, validate NCCI edits programmatically, detect duplicate claims, run Benford's law analysis on charges, build claims data pipelines, or analyze E&M code distributions. Triggers include \"parse X12 837\", \"parse 835\", \"claims SQL\", \"ICD-10 manipulation\", \"CPT code analysis\", \"provider profiling\", \"billing outlier\", \"NCCI validation code\", \"duplicate claim detection\", \"Benford's law charges\", \"claims ETL\", \"E&M distribution analysis\", \"claims analytics pipeline\".\n",{"slug":8,"name":9,"logoUrl":10,"githubOrg":11},[2845,2846,2847,2850],{"name":2819,"slug":2820,"type":16},{"name":18,"slug":19,"type":16},{"name":2848,"slug":2849,"type":16},"Insurance","insurance",{"name":21,"slug":22,"type":16},"2026-07-12T08:37:34.815088",{"slug":2853,"name":2853,"fn":2854,"description":2855,"org":2856,"tags":2857,"stars":26,"repoUrl":27,"updatedAt":2861},"claims-billing-rules","analyze healthcare claims billing rules","Reasoning skill for healthcare claims billing rules and fraud detection logic. Use when the user asks about CMS billing rules, place of service codes, global surgery periods, modifier usage (25 59 76 77), NCCI edit logic, column 1 column 2 code pairs, mutually exclusive procedures, modifier indicators, fraud waste and abuse patterns, E&M upcoding, unbundling, phantom billing, impossible day detection, coding error versus fraud distinction, FWA investigation methodology, or claims audit logic. Triggers include \"CMS billing rules\", \"NCCI edits\", \"modifier 25\", \"modifier 59\", \"global surgery period\", \"upcoding\", \"unbundling\", \"phantom billing\", \"impossible day\", \"FWA\", \"fraud waste abuse\", \"coding error vs fraud\", \"claims audit\", \"billing compliance\", \"E&M level selection\".\n",{"slug":8,"name":9,"logoUrl":10,"githubOrg":11},[2858,2859,2860],{"name":18,"slug":19,"type":16},{"name":2848,"slug":2849,"type":16},{"name":2808,"slug":2809,"type":16},"2026-07-12T08:38:28.210856",40,{"items":2864,"total":3040},[2865,2884,2905,2915,2928,2941,2951,2961,2982,2997,3012,3027],{"slug":2866,"name":2866,"fn":2867,"description":2868,"org":2869,"tags":2870,"stars":2881,"repoUrl":2882,"updatedAt":2883},"agentcore-investigation","investigate Bedrock AgentCore runtime sessions","Investigate Bedrock AgentCore runtime sessions via CloudWatch Logs Insights — resolve session\u002Ftrace IDs, query OTEL spans, filter noise, build timelines. Use when debugging AgentCore agent sessions, tracing tool calls, or analyzing latency.",{"slug":8,"name":9,"logoUrl":10,"githubOrg":11},[2871,2872,2875,2878],{"name":2776,"slug":2777,"type":16},{"name":2873,"slug":2874,"type":16},"Debugging","debugging",{"name":2876,"slug":2877,"type":16},"Logs","logs",{"name":2879,"slug":2880,"type":16},"Observability","observability",9427,"https:\u002F\u002Fgithub.com\u002Fawslabs\u002Fmcp","2026-07-12T08:37:22.601527",{"slug":2885,"name":2886,"fn":2887,"description":2888,"org":2889,"tags":2890,"stars":2881,"repoUrl":2882,"updatedAt":2904},"amazon-aurora-dsql","amazon aurora dsql","build applications with Aurora DSQL","Build with Aurora DSQL — manage schemas, execute queries, handle migrations, diagnose query plans, load data, and develop applications with a serverless, distributed SQL database. Covers IAM auth, multi-tenant patterns, MySQL-to-DSQL and PostgreSQL-to-DSQL schema conversion, FK replacement code generation, OCC retry patterns, ORM migration (Django\u002FHibernate\u002FRails), DDL operations, query plan explainability, SQL compatibility validation, and bulk data loading. Triggers on phrases like: DSQL, Aurora DSQL, create DSQL table, DSQL schema, migrate to DSQL, distributed SQL database, serverless PostgreSQL-compatible database, DSQL query plan, DSQL EXPLAIN ANALYZE, why is my DSQL query slow, DSQL foreign key, DSQL OCC retry, DSQL multi-region, load into DSQL, load CSV into DSQL, bulk load DSQL, aurora-dsql-loader.",{"slug":8,"name":9,"logoUrl":10,"githubOrg":11},[2891,2894,2895,2898,2901],{"name":2892,"slug":2893,"type":16},"Aurora","aurora",{"name":2776,"slug":2777,"type":16},{"name":2896,"slug":2897,"type":16},"Database","database",{"name":2899,"slug":2900,"type":16},"Serverless","serverless",{"name":2902,"slug":2903,"type":16},"SQL","sql","2026-07-12T08:36:45.053393",{"slug":2906,"name":2907,"fn":2887,"description":2888,"org":2908,"tags":2909,"stars":2881,"repoUrl":2882,"updatedAt":2914},"aurora-dsql","aurora dsql",{"slug":8,"name":9,"logoUrl":10,"githubOrg":11},[2910,2911,2912,2913],{"name":2776,"slug":2777,"type":16},{"name":2896,"slug":2897,"type":16},{"name":2899,"slug":2900,"type":16},{"name":2902,"slug":2903,"type":16},"2026-07-12T08:36:42.694299",{"slug":2916,"name":2917,"fn":2887,"description":2888,"org":2918,"tags":2919,"stars":2881,"repoUrl":2882,"updatedAt":2927},"aws-dsql","aws dsql",{"slug":8,"name":9,"logoUrl":10,"githubOrg":11},[2920,2921,2922,2925,2926],{"name":2776,"slug":2777,"type":16},{"name":2896,"slug":2897,"type":16},{"name":2923,"slug":2924,"type":16},"Migration","migration",{"name":2899,"slug":2900,"type":16},{"name":2902,"slug":2903,"type":16},"2026-07-12T08:36:38.584057",{"slug":2929,"name":2930,"fn":2887,"description":2888,"org":2931,"tags":2932,"stars":2881,"repoUrl":2882,"updatedAt":2940},"distributed-postgres","distributed postgres",{"slug":8,"name":9,"logoUrl":10,"githubOrg":11},[2933,2934,2935,2938,2939],{"name":2776,"slug":2777,"type":16},{"name":2896,"slug":2897,"type":16},{"name":2936,"slug":2937,"type":16},"PostgreSQL","postgresql",{"name":2899,"slug":2900,"type":16},{"name":2902,"slug":2903,"type":16},"2026-07-12T08:36:46.530743",{"slug":2942,"name":2943,"fn":2887,"description":2888,"org":2944,"tags":2945,"stars":2881,"repoUrl":2882,"updatedAt":2950},"distributed-sql","distributed sql",{"slug":8,"name":9,"logoUrl":10,"githubOrg":11},[2946,2947,2948,2949],{"name":2776,"slug":2777,"type":16},{"name":2896,"slug":2897,"type":16},{"name":2899,"slug":2900,"type":16},{"name":2902,"slug":2903,"type":16},"2026-07-12T08:36:48.104182",{"slug":2952,"name":2952,"fn":2887,"description":2888,"org":2953,"tags":2954,"stars":2881,"repoUrl":2882,"updatedAt":2960},"dsql",{"slug":8,"name":9,"logoUrl":10,"githubOrg":11},[2955,2956,2957,2958,2959],{"name":2776,"slug":2777,"type":16},{"name":2896,"slug":2897,"type":16},{"name":2923,"slug":2924,"type":16},{"name":2899,"slug":2900,"type":16},{"name":2902,"slug":2903,"type":16},"2026-07-12T08:36:36.374512",{"slug":2962,"name":2962,"fn":2963,"description":2964,"org":2965,"tags":2966,"stars":2979,"repoUrl":2980,"updatedAt":2981},"cost-efficiency-analyzer","analyze cost efficiency and expenses","Analyzes cost structure, cost efficiency, and expense management from P&L data. Use when the user asks about costs, expenses, COGS, operating expenses, cost ratios, cost control, spending efficiency, margin compression from cost side, or wants to understand where money is going. Also use for \"are we spending too much\", \"cost breakdown\", \"expense analysis\", or \"how efficient are our operations\". NOT for revenue or top-line analysis.",{"slug":8,"name":9,"logoUrl":10,"githubOrg":11},[2967,2970,2973,2976],{"name":2968,"slug":2969,"type":16},"Accounting","accounting",{"name":2971,"slug":2972,"type":16},"Analytics","analytics",{"name":2974,"slug":2975,"type":16},"Cost Optimization","cost-optimization",{"name":2977,"slug":2978,"type":16},"Finance","finance",3176,"https:\u002F\u002Fgithub.com\u002Fawslabs\u002Fagentcore-samples","2026-07-12T08:40:03.29555",{"slug":2983,"name":2983,"fn":2984,"description":2985,"org":2986,"tags":2987,"stars":2979,"repoUrl":2980,"updatedAt":2996},"executive-financial-briefing","generate executive financial briefings","Generates a concise executive-level financial briefing or summary suitable for a CEO, CFO, or board presentation. Use when the user asks for a summary, briefing, executive summary, board update, financial overview, financial health check, or \"how is the business doing\". Covers the full P&L picture in one page. Also use for \"give me the highlights\", \"what do I need to know\", or \"quick financial update\".",{"slug":8,"name":9,"logoUrl":10,"githubOrg":11},[2988,2989,2990,2993],{"name":2776,"slug":2777,"type":16},{"name":2977,"slug":2978,"type":16},{"name":2991,"slug":2992,"type":16},"Management","management",{"name":2994,"slug":2995,"type":16},"Reporting","reporting","2026-07-12T08:40:02.066471",{"slug":2998,"name":2998,"fn":2999,"description":3000,"org":3001,"tags":3002,"stars":2979,"repoUrl":2980,"updatedAt":3011},"multi-quarter-trend-analysis","analyze multi-quarter financial trends","Analyzes financial trends across multiple quarters by comparing P&L metrics over time. Use when the user wants to see trends, patterns, trajectories, or directional movement across 3 or more quarters. Also use for \"how are we trending\", \"show me the trend\", \"track performance over time\", \"quarter over quarter comparison across all quarters\", or any multi-period longitudinal analysis.",{"slug":8,"name":9,"logoUrl":10,"githubOrg":11},[3003,3004,3005,3008],{"name":2971,"slug":2972,"type":16},{"name":2977,"slug":2978,"type":16},{"name":3006,"slug":3007,"type":16},"Financial Statements","financial-statements",{"name":3009,"slug":3010,"type":16},"Variance Analysis","variance-analysis","2026-07-12T08:40:00.79141",{"slug":3013,"name":3013,"fn":3014,"description":3015,"org":3016,"tags":3017,"stars":2979,"repoUrl":2980,"updatedAt":3026},"pdf","process and manipulate PDF documents","Use this skill whenever the user wants to do anything with PDF files. This includes reading or extracting text\u002Ftables from PDFs, combining or merging multiple PDFs into one, splitting PDFs apart, rotating pages, adding watermarks, creating new PDFs, filling PDF forms, encrypting\u002Fdecrypting PDFs, extracting images, and OCR on scanned PDFs to make them searchable. If the user mentions a .pdf file or asks to produce one, use this skill.",{"slug":8,"name":9,"logoUrl":10,"githubOrg":11},[3018,3021,3024],{"name":3019,"slug":3020,"type":16},"Automation","automation",{"name":3022,"slug":3023,"type":16},"Documents","documents",{"name":3025,"slug":3013,"type":16},"PDF","2026-07-12T08:41:44.135656",{"slug":3028,"name":3028,"fn":3029,"description":3030,"org":3031,"tags":3032,"stars":2979,"repoUrl":2980,"updatedAt":3039},"quarterly-kpi-calculator","calculate quarterly financial KPIs","Calculates quarterly financial KPIs from P&L data. P&L figures can be provided directly by the user or fetched from the financial data MCP server. Use when the user wants KPI calculations such as Gross Margin %, EBITDA Margin %, Operating Expense Ratio, or Revenue Growth % QoQ. Also use for quarterly performance review, P&L analysis, or interpreting financial ratios against benchmarks.",{"slug":8,"name":9,"logoUrl":10,"githubOrg":11},[3033,3034,3035,3036],{"name":2968,"slug":2969,"type":16},{"name":2819,"slug":2820,"type":16},{"name":2977,"slug":2978,"type":16},{"name":3037,"slug":3038,"type":16},"KPI","kpi","2026-07-12T08:39:59.54971",150]