Clinical Trial Ipd Sim
RConsortium/pharma-skills
End-to-end R workflow to simulate individual patient data (IPD) for a registered clinical trial using a g-formula causal-DAG simulator.
WSI processing for digital pathology. An agent skill from jaechang-hits/SciAgent-Skills.
$ npx skills add jaechang-hits/SciAgent-Skills --skill histolab-wsi-processing -a claude-codeProject install by default; add -g for ~/.claude/skills/.
$ gh skill install jaechang-hits/SciAgent-Skills histolab-wsi-processing --agent claude-codeProject scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).
$ git clone --depth 1 https://github.com/jaechang-hits/SciAgent-Skills.git skills-src && mkdir -p .claude/skills && cp -r skills-src/skills/medical-imaging/histolab-wsi-processing .claude/skills/histolab-wsi-processing && rm -rf skills-srcUse ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.
Claude Code skills documentation · loads skills from .claude/skills/
Install the "histolab-wsi-processing" agent skill from https://github.com/jaechang-hits/SciAgent-Skills/tree/main/skills/medical-imaging/histolab-wsi-processing into .claude/skills/histolab-wsi-processing/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "histolab-wsi-processing", then confirm the skill loads.Claude Code copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$skill-installer install https://github.com/jaechang-hits/SciAgent-Skills/tree/main/skills/medical-imaging/histolab-wsi-processingType this inside Codex. $skill-installer <name> installs a curated skill from openai/skills. The installer writes to $CODEX_HOME/skills (default ~/.codex/skills). Restart Codex if the skill does not show up.
$ npx skills add jaechang-hits/SciAgent-Skills --skill histolab-wsi-processing -a codexProject install goes to .agents/skills/; add -g for ~/.codex/skills/.
$ gh skill install jaechang-hits/SciAgent-Skills histolab-wsi-processing --agent codexProject scope by default (.agents/skills/); add --scope user for a personal install.
$ git clone --depth 1 https://github.com/jaechang-hits/SciAgent-Skills.git skills-src && mkdir -p .agents/skills && cp -r skills-src/skills/medical-imaging/histolab-wsi-processing .agents/skills/histolab-wsi-processing && rm -rf skills-srcUse ~/.agents/skills/ instead of .agents/skills for a personal install.
Codex skills documentation · loads skills from .agents/skills/
Install the "histolab-wsi-processing" agent skill from https://github.com/jaechang-hits/SciAgent-Skills/tree/main/skills/medical-imaging/histolab-wsi-processing into .agents/skills/histolab-wsi-processing/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "histolab-wsi-processing", then confirm the skill loads.Codex copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$ npx skills add jaechang-hits/SciAgent-Skills --skill histolab-wsi-processing -a cursorProject install goes to .agents/skills/; add -g for ~/.cursor/skills/.
$ gh skill install jaechang-hits/SciAgent-Skills histolab-wsi-processing --agent cursorProject scope by default (.agents/skills/); add --scope user for a personal install.
$ git clone --depth 1 https://github.com/jaechang-hits/SciAgent-Skills.git skills-src && mkdir -p .cursor/skills && cp -r skills-src/skills/medical-imaging/histolab-wsi-processing .cursor/skills/histolab-wsi-processing && rm -rf skills-srcUse ~/.cursor/skills/ instead of .cursor/skills for a personal install.
Cursor skills documentation · loads skills from .cursor/skills/, .agents/skills/, .claude/skills/, .codex/skills/
Install the "histolab-wsi-processing" agent skill from https://github.com/jaechang-hits/SciAgent-Skills/tree/main/skills/medical-imaging/histolab-wsi-processing into .cursor/skills/histolab-wsi-processing/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "histolab-wsi-processing", then confirm the skill loads.Cursor copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$ gemini skills install https://github.com/jaechang-hits/SciAgent-Skills.git --path skills/medical-imaging/histolab-wsi-processing--scope user (default) or --scope workspace; --path is the subfolder of the repo that holds the skill; --consent skips the security confirmation prompt.
$ npx skills add jaechang-hits/SciAgent-Skills --skill histolab-wsi-processing -a gemini-cliProject install goes to .agents/skills/; add -g for ~/.gemini/skills/.
$ gh skill install jaechang-hits/SciAgent-Skills histolab-wsi-processing --agent gemini-cliProject scope by default (.agents/skills/); add --scope user for a personal install.
$ git clone --depth 1 https://github.com/jaechang-hits/SciAgent-Skills.git skills-src && mkdir -p .gemini/skills && cp -r skills-src/skills/medical-imaging/histolab-wsi-processing .gemini/skills/histolab-wsi-processing && rm -rf skills-srcUse ~/.gemini/skills/ instead of .gemini/skills for a personal install, then run /skills reload.
Gemini CLI skills documentation · loads skills from .gemini/skills/, .agents/skills/
Install the "histolab-wsi-processing" agent skill from https://github.com/jaechang-hits/SciAgent-Skills/tree/main/skills/medical-imaging/histolab-wsi-processing into .gemini/skills/histolab-wsi-processing/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "histolab-wsi-processing", then confirm the skill loads.Gemini CLI copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$ gh skill install jaechang-hits/SciAgent-Skills histolab-wsi-processingInstalls for Copilot at project scope by default; add --scope user for a personal install. Preview a skill first with gh skill preview. Needs GitHub CLI 2.90.0 or later (public preview).
$ npx skills add jaechang-hits/SciAgent-Skills --skill histolab-wsi-processing -a github-copilotProject install goes to .agents/skills/; add -g for ~/.copilot/skills/.
$ git clone --depth 1 https://github.com/jaechang-hits/SciAgent-Skills.git skills-src && mkdir -p .github/skills && cp -r skills-src/skills/medical-imaging/histolab-wsi-processing .github/skills/histolab-wsi-processing && rm -rf skills-srcUse ~/.copilot/skills/ instead of .github/skills for a personal install. Commit .github/skills so cloud agent and code review can use it.
GitHub Copilot skills documentation · loads skills from .github/skills/, .claude/skills/, .agents/skills/
Install the "histolab-wsi-processing" agent skill from https://github.com/jaechang-hits/SciAgent-Skills/tree/main/skills/medical-imaging/histolab-wsi-processing into .github/skills/histolab-wsi-processing/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "histolab-wsi-processing", then confirm the skill loads.GitHub Copilot copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$ npx skills add jaechang-hits/SciAgent-Skills --skill histolab-wsi-processing -a opencodeOpenCode documents no install command of its own. Project install goes to .agents/skills/; add -g for ~/.config/opencode/skills/.
$ gh skill install jaechang-hits/SciAgent-Skills histolab-wsi-processing --agent opencodeProject scope by default (.agents/skills/); add --scope user for a personal install.
$ git clone --depth 1 https://github.com/jaechang-hits/SciAgent-Skills.git skills-src && mkdir -p .opencode/skills && cp -r skills-src/skills/medical-imaging/histolab-wsi-processing .opencode/skills/histolab-wsi-processing && rm -rf skills-srcUse ~/.config/opencode/skills/ instead of .opencode/skills for a personal install.
OpenCode skills documentation · loads skills from .opencode/skills/, .claude/skills/, .agents/skills/
Install the "histolab-wsi-processing" agent skill from https://github.com/jaechang-hits/SciAgent-Skills/tree/main/skills/medical-imaging/histolab-wsi-processing into .opencode/skills/histolab-wsi-processing/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "histolab-wsi-processing", then confirm the skill loads.OpenCode copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
histolab-wsi-processingWSI processing for digital pathology. An agent skill from jaechang-hits/SciAgent-Skills.
Histolab Wsi Processing is an agent skill from jaechang-hits/SciAgent-Skills. WSI processing for digital pathology. Tissue detection, tile extraction (random, grid, score-based), filter pipelines for H&E/IHC. For dataset prep, tile-based DL, slide QC. Use pathml for multiplexed imaging.
Its SKILL.md is about 5.8k tokens, which your agent loads only when the skill is triggered. The skill folder holds 4 other files, including reference files (for example `references/filters_preprocessing.md`, `references/tile_extraction.md` and `references/visualization_slides.md`).
It sits in Research & Science, covering Slides and decks and Clinical and healthcare research. It works with Python. The repository describes itself as: 197 bioinformatics & life science skills for Claude Code and AI agents — BixBench 92.0% accuracy. RNA-seq, single-cell, drug discovery, proteomics, and more. Powers OmicsHorizon. The licence is Apache-2.0.
9 steps, taken from the first numbered list in SKILL.md.
Read from SKILL.md and the folder at commit 82c862c. It shows what the files ask for, not the result of running them.
Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.
From allowed-tools in the SKILL.md frontmatter.
Shell commands in SKILL.md call:
pipbrewapt-getFrom the folder's file list and the shell code blocks in SKILL.md.
Links to these hosts (documentation or services it may open):
histolab.readthedocs.iogithub.comopenslide.orgportal.gdc.cancer.govFrom URLs in SKILL.md, links to its own repository left out.
Names no API keys, tokens, secrets or passwords.
From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.
Histolab Wsi Processing loads about 5.8k tokens when it runs, and up to ~14k if it reads all its reference files. Until then it costs about 58 tokens; SKILL.md has 1,394 words of instructions outside code blocks.
Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.
The automated check noted patterns worth knowing about, such as sudo or a known installer.
sudo apt-get install openslide-toolsAutomated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.
The full file from jaechang-hits/SciAgent-Skills at commit 82c862c, republished under its Apache-2.0 licence (© jaechang-hits). 1,394 words, ~5,759 tokens.
.claude/skills/histolab-wsi-processing/SKILL.md (or your agent's skills folder). This skill also uses 3 other files; get the full folder from GitHub.Histolab is a Python library for processing whole slide images (WSI) in digital pathology. It automates tissue detection, extracts informative tiles from gigapixel images using multiple strategies, and provides composable filter pipelines for preprocessing. The library handles SVS, TIFF, NDPI, and other WSI formats via OpenSlide.
openslide-python directlypathml insteadhistolab (includes OpenSlide Python bindings)# macOS
brew install openslide
pip install histolab
# Ubuntu/Debian
sudo apt-get install openslide-tools
pip install histolabfrom histolab.slide import Slide
from histolab.tiler import RandomTiler
# Load slide
slide = Slide("slide.svs", processed_path="output/")
print(f"Dimensions: {slide.dimensions}, Levels: {slide.levels}")
# Configure tiler
tiler = RandomTiler(
tile_size=(512, 512), n_tiles=100, level=0, seed=42,
check_tissue=True, tissue_percent=80.0
)
# Preview and extract
tiler.locate_tiles(slide, n_tiles=20)
tiler.extract(slide)The Slide class is the primary interface for loading and inspecting WSI files.
from histolab.slide import Slide
from histolab.data import prostate_tissue
# Load from built-in sample data (prostate, ovarian, breast, heart, kidney)
prostate_svs, prostate_path = prostate_tissue()
slide = Slide(prostate_path, processed_path="output/")
# Inspect properties
print(f"Dimensions: {slide.dimensions}") # (width, height) at level 0
print(f"Levels: {slide.levels}") # Number of pyramid levels
print(f"Level dims: {slide.level_dimensions}") # Dimensions per level
print(f"Magnification: {slide.properties.get('openslide.objective-power', 'N/A')}")
print(f"MPP-X: {slide.properties.get('openslide.mpp-x', 'N/A')}")
# Thumbnail and scaled image
slide.save_thumbnail() # Saves to processed_path
scaled = slide.scaled_image(scale_factor=32)
# Extract region at specific coordinates
region = slide.extract_region(location=(1000, 2000), size=(512, 512), level=0)Mask classes identify tissue regions and filter background for tile extraction.
from histolab.masks import TissueMask, BiggestTissueBoxMask, BinaryMask
import numpy as np
# TissueMask: segments ALL tissue regions (multiple sections)
tissue_mask = TissueMask()
mask_array = tissue_mask(slide) # Binary NumPy array: True=tissue, False=background
print(f"Tissue coverage: {mask_array.sum() / mask_array.size * 100:.1f}%")
# BiggestTissueBoxMask: bounding box of largest tissue region (default)
biggest_mask = BiggestTissueBoxMask()
# Visualize mask on slide thumbnail
slide.locate_mask(tissue_mask)
# Custom mask via BinaryMask subclass
class RectangularROI(BinaryMask):
def __init__(self, x, y, w, h):
self.x, self.y, self.w, self.h = x, y, w, h
def _mask(self, slide):
thumb = slide.thumbnail
mask = np.zeros(thumb.shape[:2], dtype=bool)
mask[self.y:self.y+self.h, self.x:self.x+self.w] = True
return maskThree strategies for extracting tiles: random sampling, grid coverage, and score-based selection.
from histolab.tiler import RandomTiler, GridTiler, ScoreTiler
from histolab.scorer import NucleiScorer
from histolab.masks import TissueMask
# RandomTiler: fixed number of randomly positioned tiles
random_tiler = RandomTiler(
tile_size=(512, 512), n_tiles=100, level=0,
seed=42, check_tissue=True, tissue_percent=80.0
)
random_tiler.locate_tiles(slide, n_tiles=20) # Preview first
random_tiler.extract(slide)
# GridTiler: systematic grid coverage
grid_tiler = GridTiler(
tile_size=(512, 512), level=0,
pixel_overlap=0, check_tissue=True, tissue_percent=70.0
)
grid_tiler.extract(slide, extraction_mask=TissueMask())
# ScoreTiler: top-ranked tiles by scoring function
score_tiler = ScoreTiler(
tile_size=(512, 512), n_tiles=50, level=0,
scorer=NucleiScorer(), check_tissue=True
)
score_tiler.extract(slide, report_path="tiles_report.csv")
# Report CSV: tile_name, x_coord, y_coord, level, score, tissue_percentComposable image and morphological filters for tissue detection and preprocessing.
from histolab.filters.image_filters import (
RgbToGrayscale, RgbToHsv, RgbToHed,
OtsuThreshold, AdaptiveThreshold,
StretchContrast, HistogramEqualization, Invert
)
from histolab.filters.morphological_filters import (
BinaryDilation, BinaryErosion, BinaryOpening, BinaryClosing,
RemoveSmallObjects, RemoveSmallHoles
)
from histolab.filters.compositions import Compose
# Standard tissue detection pipeline
tissue_pipeline = Compose([
RgbToGrayscale(),
OtsuThreshold(),
BinaryDilation(disk_size=5),
RemoveSmallHoles(area_threshold=1000),
RemoveSmallObjects(area_threshold=500)
])
# Use custom pipeline with TissueMask
from histolab.masks import TissueMask
custom_mask = TissueMask(filters=tissue_pipeline)
# Stain deconvolution (H&E)
hed_filter = RgbToHed() # Hematoxylin-Eosin-DAB separation# Apply filters to individual tiles
from histolab.tile import Tile
filter_chain = Compose([RgbToGrayscale(), StretchContrast()])
filtered_tile = tile.apply_filters(filter_chain)
# Lambda for custom inline filters
from histolab.filters.image_filters import Lambda
import numpy as np
brightness = Lambda(lambda img: np.clip(img * 1.2, 0, 255).astype(np.uint8))
red_channel = Lambda(lambda img: img[:, :, 0])Scorers rank tiles by tissue content quality for use with ScoreTiler.
from histolab.scorer import NucleiScorer, CellularityScorer, Scorer
import numpy as np
# Built-in scorers
nuclei = NucleiScorer() # Scores by nuclei density (grayscale threshold + count)
cellularity = CellularityScorer() # Scores by overall cellular content
# Custom scorer
class ColorVarianceScorer(Scorer):
def __call__(self, tile):
"""Score tiles by color variance (higher = more informative)."""
tile_array = np.array(tile.image)
return np.var(tile_array, axis=(0, 1)).sum()
score_tiler = ScoreTiler(
tile_size=(512, 512), n_tiles=30,
scorer=ColorVarianceScorer()
)Built-in methods and matplotlib patterns for inspecting slides, masks, and tiles.
import matplotlib.pyplot as plt
from histolab.masks import TissueMask
# Built-in: mask overlay on slide thumbnail
slide.locate_mask(TissueMask())
# Built-in: tile location preview
tiler.locate_tiles(slide, n_tiles=20)
# Manual side-by-side: slide vs mask
mask = TissueMask()
mask_array = mask(slide)
fig, axes = plt.subplots(1, 2, figsize=(15, 7))
axes[0].imshow(slide.thumbnail); axes[0].set_title("Slide"); axes[0].axis('off')
axes[1].imshow(mask_array, cmap='gray'); axes[1].set_title("Mask"); axes[1].axis('off')
plt.tight_layout()
plt.show()
# Display extracted tiles in grid
from pathlib import Path
from PIL import Image
tile_paths = list(Path("output/tiles/").glob("*.png"))[:16]
fig, axes = plt.subplots(4, 4, figsize=(12, 12))
for idx, tp in enumerate(axes.ravel()):
if idx < len(tile_paths):
tp.imshow(Image.open(tile_paths[idx]))
tp.set_title(tile_paths[idx].stem, fontsize=8)
tp.axis('off')
plt.tight_layout()
plt.show()Whole slide images use a pyramidal structure with multiple resolution levels. Level 0 is the highest resolution (native scan). Higher levels provide progressively lower resolutions for faster access.
for level in range(slide.levels):
dims = slide.level_dimensions[level]
downsample = slide.level_downsamples[level]
print(f"Level {level}: {dims}, downsample: {downsample:.0f}x")
# Level 0: (98304, 221184), downsample: 1x
# Level 1: (24576, 55296), downsample: 4xFilters are designed to be chained via Compose. The output of one filter becomes the input of the next. Image filters operate on RGB/grayscale arrays; morphological filters operate on binary arrays. Order matters: always convert to the expected input type before applying downstream filters.
All tilers accept an extraction_mask parameter. The default is BiggestTissueBoxMask(). Override with TissueMask() for multi-section slides or a custom BinaryMask subclass for ROI-specific extraction.
Goal: Quickly inspect a slide, detect tissue, and sample diverse regions for review.
from histolab.slide import Slide
from histolab.tiler import RandomTiler
from histolab.masks import TissueMask
import matplotlib.pyplot as plt
import logging
logging.basicConfig(level=logging.INFO)
slide = Slide("slide.svs", processed_path="output/exploratory/")
print(f"Dimensions: {slide.dimensions}, Levels: {slide.levels}")
slide.save_thumbnail()
# Visualize tissue detection
tissue_mask = TissueMask()
slide.locate_mask(tissue_mask)
mask_arr = tissue_mask(slide)
print(f"Tissue coverage: {mask_arr.sum() / mask_arr.size * 100:.1f}%")
# Sample tiles
tiler = RandomTiler(
tile_size=(512, 512), n_tiles=50, level=0,
seed=42, check_tissue=True, tissue_percent=80.0
)
tiler.locate_tiles(slide, n_tiles=20)
tiler.extract(slide)Goal: Build a quality-controlled tile dataset from multiple slides for model training.
from pathlib import Path
from histolab.slide import Slide
from histolab.tiler import ScoreTiler
from histolab.scorer import NucleiScorer
import pandas as pd
import logging
logging.basicConfig(level=logging.INFO)
slide_dir = Path("slides/")
output_base = Path("output/dataset/")
all_reports = []
tiler = ScoreTiler(
tile_size=(512, 512), n_tiles=100, level=0,
scorer=NucleiScorer(), check_tissue=True, tissue_percent=80.0
)
for slide_path in sorted(slide_dir.glob("*.svs")):
out_dir = output_base / slide_path.stem
out_dir.mkdir(parents=True, exist_ok=True)
slide = Slide(str(slide_path), processed_path=str(out_dir))
slide.save_thumbnail()
report_path = str(out_dir / "report.csv")
tiler.extract(slide, report_path=report_path)
df = pd.read_csv(report_path)
df["slide"] = slide_path.stem
all_reports.append(df)
print(f"{slide_path.stem}: {len(df)} tiles, mean score {df['score'].mean():.3f}")
combined = pd.concat(all_reports, ignore_index=True)
combined.to_csv(output_base / "dataset_manifest.csv", index=False)
print(f"Total: {len(combined)} tiles from {len(all_reports)} slides")Goal: Handle slides with pen annotations or unusual staining using custom filter pipelines.
from histolab.slide import Slide
from histolab.masks import TissueMask
from histolab.tiler import GridTiler
from histolab.filters.compositions import Compose
from histolab.filters.image_filters import RgbToGrayscale, OtsuThreshold
from histolab.filters.morphological_filters import (
BinaryDilation, RemoveSmallObjects, RemoveSmallHoles
)
# Aggressive artifact removal pipeline
aggressive_filters = Compose([
RgbToGrayscale(),
OtsuThreshold(),
BinaryDilation(disk_size=10),
RemoveSmallHoles(area_threshold=5000),
RemoveSmallObjects(area_threshold=3000)
])
custom_mask = TissueMask(filters=aggressive_filters)
slide = Slide("artifact_slide.svs", processed_path="output/clean/")
# Compare default vs custom mask
slide.locate_mask(TissueMask()) # Default
slide.locate_mask(custom_mask) # Custom (tighter)
# Extract with custom mask
grid_tiler = GridTiler(
tile_size=(512, 512), level=1,
check_tissue=True, tissue_percent=70.0
)
grid_tiler.extract(slide, extraction_mask=custom_mask)| Parameter | Module | Default | Range / Options | Effect |
|---|---|---|---|---|
tile_size | All Tilers | (512, 512) | Any (w, h) tuple | Tile dimensions in pixels |
level | All Tilers | 0 | 0 to slide.levels-1 | Pyramid level (0=highest resolution) |
check_tissue | All Tilers | True | True/False | Filter tiles by tissue content |
tissue_percent | All Tilers | 80.0 | 0.0-100.0 | Minimum tissue coverage threshold |
n_tiles | Random/ScoreTiler | varies | Any positive int | Number of tiles to extract |
seed | RandomTiler | None | Any int | Random seed for reproducibility |
pixel_overlap | GridTiler | 0 | 0+ | Overlap between adjacent tiles in pixels |
scorer | ScoreTiler | required | NucleiScorer(), CellularityScorer(), custom | Scoring function for tile ranking |
extraction_mask | All Tilers | BiggestTissueBoxMask() | Any BinaryMask | Mask defining valid extraction region |
disk_size | Morphological filters | 5 | 1-20 | Structuring element size |
area_threshold | RemoveSmall* | 500/1000 | 0+ | Minimum area for objects/holes in pixels |
Always preview before extracting: Call locate_tiles() and locate_mask() to validate settings before committing to full extraction. This saves hours on large slide collections.
Match level to analysis resolution: Level 0 provides maximum detail but is slow; level 1-2 is typically sufficient for initial analysis. Use level 0 only for tasks requiring cellular detail.
Choose the right tiler strategy:
RandomTiler for exploratory analysis and diverse samplingGridTiler for complete coverage and spatial analysisScoreTiler for quality-driven dataset curationUse seeds for reproducibility: Always set seed in RandomTiler to ensure consistent tile selection across runs.
Customize masks for specific stains: H&E and IHC stains have different color profiles. Adjust filter parameters or build custom Compose pipelines for non-standard stains.
Anti-pattern -- Don't use TissueMask when BiggestTissueBoxMask suffices: TissueMask is more computationally expensive. Use it only when the slide has multiple tissue sections.
Enable logging for batch processing: logging.basicConfig(level=logging.INFO) provides progress tracking during extraction.
Generate CSV reports with ScoreTiler: Use report_path in extract() to create metadata manifests for downstream ML pipelines.
Anti-pattern -- Don't extract at level 0 for initial exploration: Use level 1 or 2 for fast iteration, then switch to level 0 for final dataset generation.
When to use: Isolate and enhance nuclei signal from H&E stained sections for analysis.
from histolab.filters.image_filters import RgbToHed, HistogramEqualization, Lambda
from histolab.filters.compositions import Compose
nuclei_pipeline = Compose([
RgbToHed(),
Lambda(lambda hed: hed[:, :, 0]), # Extract hematoxylin channel
HistogramEqualization()
])
# Apply to slide thumbnail for visualization
enhanced = nuclei_pipeline(slide.thumbnail)When to use: Assess tile quality distribution and identify optimal score thresholds.
import pandas as pd
import matplotlib.pyplot as plt
report = pd.read_csv("tiles_report.csv")
fig, axes = plt.subplots(1, 2, figsize=(14, 5))
axes[0].hist(report['score'], bins=30, edgecolor='black', alpha=0.7)
axes[0].set_xlabel('Tile Score'); axes[0].set_ylabel('Frequency')
axes[0].set_title('Score Distribution')
axes[1].scatter(report['tissue_percent'], report['score'], alpha=0.5)
axes[1].set_xlabel('Tissue %'); axes[1].set_ylabel('Score')
axes[1].set_title('Score vs Tissue Coverage')
plt.tight_layout()
plt.savefig("quality_analysis.png", dpi=150, bbox_inches='tight')
plt.show()When to use: Extract tiles at multiple magnification levels from the same locations for multi-scale analysis.
from histolab.tiler import RandomTiler
for level in [0, 1, 2]:
tiler = RandomTiler(
tile_size=(512, 512), n_tiles=50,
level=level, seed=42, # Same seed = same locations
prefix=f"level{level}_"
)
tiler.extract(slide)
print(f"Extracted level {level} tiles")| Problem | Cause | Solution |
|---|---|---|
OpenSlideError: Unsupported format | OpenSlide C library not installed or slide format unsupported | Install OpenSlide system library; verify format with openslide-show-properties |
| No tiles extracted | tissue_percent too high or mask misses tissue | Lower tissue_percent (try 60-70%); preview mask with locate_mask() |
| Many background tiles | check_tissue=False or poor mask | Enable check_tissue=True; increase tissue_percent; use TissueMask() |
| Extraction very slow | Level 0 on large slide or TissueMask on many sections | Extract at level 1-2; use BiggestTissueBoxMask; reduce n_tiles |
| Tiles have pen artifacts | Default mask includes pen marks | Build custom filter with HSV-based pen detection; increase RemoveSmallObjects threshold |
MemoryError during extraction | Level 0 tile access on very large WSI | Extract at lower level; process fewer tiles per batch |
| Inconsistent results across runs | Missing seed in RandomTiler | Always set seed parameter |
| Tiles too small/large for model | tile_size mismatch with model input | Adjust tile_size to match model requirements (commonly 224, 256, 512) |
Comprehensive filter reference covering all image filters (RgbToGrayscale, RgbToHsv, RgbToHed, OtsuThreshold, AdaptiveThreshold, Invert, StretchContrast, HistogramEqualization, Lambda) and morphological filters (BinaryDilation, BinaryErosion, BinaryOpening, BinaryClosing, RemoveSmallObjects, RemoveSmallHoles) with individual code examples, use-case descriptions, and common preprocessing pipelines (tissue detection, pen removal, nuclei enhancement, stain normalization).
Compose chaining, quality control filters, custom mask integrationDetailed tile extraction reference covering all three tiler strategies (RandomTiler, GridTiler, ScoreTiler) with full parameter documentation, all built-in scorers (NucleiScorer, CellularityScorer), custom scorer creation, extraction workflows with logging and CSV reporting, and advanced patterns (multi-level, hierarchical, post-extraction blur filtering).
Consolidated visualization, slide management, and tissue mask reference. Covers slide inspection workflows, mask comparison visualization, tile grid display, quality assessment (score distributions, top/bottom tile comparison), multi-slide collection thumbnails, tissue coverage bar charts, filter effect visualization pipeline, PDF report generation, and interactive Jupyter widgets.
© jaechang-hits, Apache-2.0. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file
SKILL.md and 3 other files (references) in skills/medical-imaging/histolab-wsi-processing of jaechang-hits/SciAgent-Skills.
Open the folder on GitHubat commit 82c862c
We found 1 copy of this SKILL.md (exact, near-identical or edited) in other folders, from 1 other GitHub owner. This page covers the copy in jaechang-hits/SciAgent-Skills, which our catalogue first saw on October 7, 2026.
Histolab Wsi Processing next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.
| Skill | Stars | Used in | Tokens | Auto-check | Licence | Repo updated |
|---|---|---|---|---|---|---|
| Histolab Wsi Processing this skilljaechang-hits/SciAgent-Skills | 371 | 1 repos | ~5.8k | Automated safety check: Notes | Apache-2.0 | |
| Clinical Trial Ipd SimRConsortium/pharma-skills | 119 | — | ~4.1k | Automated safety check: Pass | MIT | |
| Academic Paper to PPTXYuan1z0825/nature-skills | 47k | — | ~1.1k | Automated safety check: Pass | Apache-2.0 | |
| pydicom DICOM Toolkitdavila7/claude-code-templates | 32k | 11 repos | ~3.3k | Automated safety check: Pass | MIT | |
| Histolab Whole Slide Image Tilingdavila7/claude-code-templates | 32k | 11 repos | ~5.1k | Automated safety check: Pass | MIT | |
| NeuroKit2 Biosignal Processingdavila7/claude-code-templates | 32k | 11 repos | ~3k | Automated safety check: Pass | MIT |
RConsortium/pharma-skills
End-to-end R workflow to simulate individual patient data (IPD) for a registered clinical trial using a g-formula causal-DAG simulator.
Yuan1z0825/nature-skills
Creates or revises a Chinese-language academic PPTX deck from a scientific paper or reading notes, reusing the paper's figures and adding speaker notes.
davila7/claude-code-templates
Reads, edits, anonymizes and converts DICOM medical imaging files with pydicom, including pixel data extraction and compressed transfer syntaxes.
davila7/claude-code-templates
Processes digital pathology whole slide images with histolab: tissue detection, mask creation, tile extraction and dataset preparation for deep learning.
davila7/claude-code-templates
Processes physiological signals with NeuroKit2 in Python: ECG, PPG, EEG, EDA, respiration, EMG and EOG, including HRV, events and complexity measures.
davila7/claude-code-templates
Computational pathology toolkit for analyzing whole-slide images (WSI) and multiparametric imaging data.
jaechang-hits/SciAgent-Skills
NEB-IRC activation energy pipeline for reaction barriers using GFN2-xTB and pysisyphus.
jaechang-hits/SciAgent-Skills
3Dmol.js WebGL molecular visualization emitted as self-contained HTML.
jaechang-hits/SciAgent-Skills
Constraint-based (COBRA) analysis of genome-scale metabolic models: FBA, FVA, knockouts, flux sampling, production envelopes, gapfilling, media optimization.
jaechang-hits/SciAgent-Skills
Read, write, and edit ChemDraw CDX/CDXML files with RDKit's rdkit.Chem.rdChemDraw plus direct XML editing, always paired with a rendered PNG.
jaechang-hits/SciAgent-Skills
Programmatic PubMed access via NCBI E-utilities REST API. An agent skill from jaechang-hits/SciAgent-Skills.
jaechang-hits/SciAgent-Skills
Scaffold a new SciAgent-Skills entry. An agent skill from jaechang-hits/SciAgent-Skills.
Works with
Categories
WSI processing for digital pathology. An agent skill from jaechang-hits/SciAgent-Skills. Histolab Wsi Processing is an agent skill from jaechang-hits/SciAgent-Skills. WSI processing for digital pathology.
Histolab Wsi Processing fits situations like: tasks that involve Slides and decks; tasks that involve Clinical and healthcare research.
Run `npx skills add jaechang-hits/SciAgent-Skills --skill histolab-wsi-processing -a claude-code`. Or copy the skill folder (skills/medical-imaging/histolab-wsi-processing in jaechang-hits/SciAgent-Skills) into .claude/skills/histolab-wsi-processing in your project. Claude Code loads it when a task matches its description.
Run `npx skills add jaechang-hits/SciAgent-Skills --skill histolab-wsi-processing -a codex`. Or copy the skill folder (skills/medical-imaging/histolab-wsi-processing in jaechang-hits/SciAgent-Skills) into .agents/skills/histolab-wsi-processing in your project. Codex loads it when a task matches its description.
Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add jaechang-hits/SciAgent-Skills --skill histolab-wsi-processing -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/histolab-wsi-processing, .gemini/skills/histolab-wsi-processing, .github/skills/histolab-wsi-processing and .opencode/skills/histolab-wsi-processing in your project.
Going by SKILL.md and its folder, Histolab Wsi Processing needs the command-line tools its instructions call (pip, brew and apt-get). Our summary lists: Python 3.
SKILL.md names 4 domains. As links in the text: histolab.readthedocs.io, github.com, openslide.org and portal.gdc.cancer.gov. This is read from the text; nothing was executed.
Our automated static check of SKILL.md found notes only (runs commands with sudo), nothing it rates as a warning. It is not a guarantee. Review the folder before installing.
Histolab Wsi Processing is published under the Apache-2.0 licence (declared in SKILL.md). It allows redistribution, so the full SKILL.md is shown on this page.
About 5.8k tokens (SKILL.md is roughly 23k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full. Its references folder adds about 8.2k tokens, read only when the agent opens those files.
Skills that share tags, products or a category with Histolab Wsi Processing: Clinical Trial Ipd Sim (RConsortium/pharma-skills, 119 stars), Academic Paper to PPTX (Yuan1z0825/nature-skills, 47k stars), pydicom DICOM Toolkit (davila7/claude-code-templates, 32k stars) and Histolab Whole Slide Image Tiling (davila7/claude-code-templates, 32k stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.
jaechang-hits (a GitHub user) maintains it in jaechang-hits/SciAgent-Skills, which has 371 GitHub stars. The repository holds 169 skills in this directory. The repository was last updated on September 29, 2026.
Source: jaechang-hits/SciAgent-Skills on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.