histolab
यह क्या करती है
Histolab माइक्रोस्कोप स्लाइड की तस्वीरें तैयार करने का टूल है। यह विश्लेषण के लिए इन तस्वीरों के खास हिस्से (tiles) चुनने, सभी तस्वीरों के रंग एक जैसे करने और भविष्य के अध्ययन के लिए डेटा व्यवस्थित करने में मदद करता है।
कब इस्तेमाल करें
- ✓किसी स्लाइड तस्वीर से विश्लेषण के लिए खास हिस्से चुनने हों।
- ✓अलग-अलग स्लाइड तस्वीरों के रंग को एक जैसा बनाने के लिए।
- ✓AI मॉडल को ट्रेन करने के लिए स्लाइड तस्वीरों के सेट को व्यवस्थित करने के लिए।
Skill का लिंक
https://github.com/K-Dense-AI/scientific-agent-skills/blob/main/skills/histolab/SKILL.mdइसे कॉपी करके अपने AI (Claude, ChatGPT या Cursor) में पेस्ट करें और निर्देशों का पालन करने को कहें।
कैसे इस्तेमाल करें
सबसे आसान तरीका: मैसेज कॉपी करके अपने AI में पेस्ट करें। वह skill पढ़कर निर्देशों का पालन करेगा।
पेस्ट करने के लिए तैयार मैसेज
Claude Code, Codex या Cursor के लिए: प्रोजेक्ट फ़ोल्डर में चलाएँ और skill इंस्टॉल हो जाएगी।
SKILL.md डाउनलोड करें और अपने एजेंट के skills फ़ोल्डर में रखें।
AI से क्या माँगें: उदाहरण
“'example.svs' स्लाइड से 512x512 पिक्सल के 100 रैंडम tiles चुनो, जिनमें कम से कम 80% टिशू हो।”
हर हफ़्ते 5 नई skills, 1 मिनट में पढ़ें।
यह कैसे काम करती है
Histolab पहले स्लाइड में टिशू वाले क्षेत्रों की पहचान करता है। फिर अलग-अलग तरीकों (random, grid, score-based) से तय करता है कि तस्वीर के कौन से टुकड़े निकालने हैं। यह रंगों को इस तरह एडजस्ट भी कर सकता है कि सभी तस्वीरें एक जैसी दिखें।
तकनीकी सामग्री (मूल SKILL.md)
लेखक का मूल टेक्स्ट, अंग्रेज़ी में, सीधे GitHub से।
Histolab
When to use
Use Histolab to inspect WSI metadata, identify tissue, extract image tiles, and standardize H&E staining. Its masks and scores are image-processing heuristics; they do not diagnose cancer, count individual cells, or establish image quality.
Installation
Histolab 0.7.0 remains the latest published release as of the review date. Its release constraints require Python <3.12, NumPy <=1.24.4, scikit-image <0.19.4, SciPy <1.10.1, Pillow <11, and openslide-python 1.3.1. Keep this stack isolated from modern scientific environments. Windows is not supported by this Histolab release.
Install native OpenSlide for your system, then create a dedicated environment (Python 3.10 was tested):
uv venv --python 3.10 .venv-histolab
uv pip install --python .venv-histolab/bin/python 'histolab==0.7.0' pooch matplotlib
.venv-histolab/bin/python -c 'import openslide; print(openslide.__library_version__)'
On macOS with Homebrew, brew install openslide installs the native library.
If the older Python binding cannot find it, launch Python with the library path
set immediately before Python starts:
env DYLD_FALLBACK_LIBRARY_PATH="$(brew --prefix openslide)/lib" .venv-histolab/bin/python -c 'import openslide; print(openslide.__library_version__)'
pooch is optional for remote examples. Start with a local slide or the tiny
bundled cmu_small_region sample; other sample functions may download hundreds
of megabytes. Exact mpp extraction also needs large-image and a matching
source plugin; see slide management.
Workflow
- Inspect
slide.dimensions,slide.levels(a list), andslide.level_dimensions(level)(a method). Check both MPP axes in metadata. - Select physical field of view and pixel resolution; level numbers are not interchangeable across scanners. Preserve level-0 coordinate bounds.
- Choose
TissueMaskfor all tissue sections orBiggestTissueBoxMaskfor the largest section's bounding box. Inspect the mask at its actual resolution. - Configure a tiler and preview with the same mask passed to extraction. Preview methods return a Pillow image; save or display that return value.
- Extract into a distinct per-slide/per-strategy directory. Count saved files, inspect representative tiles, and retain parameters, source IDs and QC flags.
- Split datasets by patient before training/validation/test tile assignment. Fit stain normalization targets on training data only and validate on held-out scanners. A seed reproduces sampling; it does not prevent patient leakage.
Quick start
Illustrative for a user-provided slide; the same API path is tested with small
local fixtures. n_tiles is an upper bound, not a promise of 100 valid tiles.
from pathlib import Path
from histolab.slide import Slide
from histolab.masks import TissueMask
from histolab.tiler import RandomTiler
output = Path("output/random_tiles")
output.mkdir(parents=True, exist_ok=True)
slide = Slide("slide.svs", processed_path=output)
mask = TissueMask()
slide.locate_mask(mask).save(output / "mask_preview.png")
tiler = RandomTiler(
tile_size=(512, 512), n_tiles=100, level=0, seed=42,
check_tissue=True, tissue_percent=80.0, prefix="random_",
)
tiler.locate_tiles(slide, extraction_mask=mask).save(output / "tile_preview.png")
tiler.extract(slide, extraction_mask=mask)
print("[OK] Saved tiles:", len(list(output.glob("random_tile_*.png"))))
extraction_mask belongs to extract() and locate_tiles(), not to the tiler
constructor. locate_tiles() has no n_tiles argument. Previewing runs tile
selection again, so it may be expensive; use a separate small tiler for initial
exploration, then preview the final configuration before committing a large run.
Choose a strategy
| Tiler | Selection | Important limitation |
|---|---|---|
RandomTiler |
Seeded sampling, at most n_tiles, up to max_iter attempts |
May overlap, repeat, or miss rare structures |
GridTiler |
Grid within the extraction mask | Boundary tiles and tissue checks can leave gaps |
ScoreTiler |
Scores all eligible grid candidates; saves top n_tiles |
Lower output count does not avoid scoring all candidates |
For grids, stride in each axis is tile size minus pixel_overlap; positive
…
अक्सर पूछे जाने वाले सवाल
क्या Histolab बीमारी की पहचान कर सकता है?
नहीं, Histolab बीमारी की पहचान नहीं करता। यह तस्वीरें तैयार और विश्लेषित करने का टूल है, चिकित्सीय निदान (diagnosis) करने का नहीं।
क्या मैं Histolab को किसी भी कंप्यूटर पर चला सकता हूँ?
नवीनतम वर्शन (0.7.0) Windows के साथ संगत नहीं है और इसके लिए Python की कुछ खास library वर्शन चाहिए। इसे इस्तेमाल करने के लिए अलग environment बनाने की सलाह दी जाती है।
'Tiles' क्या हैं?
'Tiles' बड़ी तस्वीर से निकाले गए छोटे टुकड़े या वर्ग होते हैं। Histolab के संदर्भ में ये माइक्रोस्कोप स्लाइड तस्वीर के वे हिस्से हैं जो विश्लेषण के लिए निकाले जाते हैं।
जानकारी
लेखक का मूल विवरण
Extracts and preprocesses whole-slide histology image tiles with Histolab. Use for WSI inspection, tissue masks, random/grid/score-based tile extraction, H&E stain normalization, and tile dataset preparation. For multiplexed imaging or deep learning inference pipelines, use pathml.
लोकप्रियता
- GitHub स्टार
- 51k
- रैंकिंग में स्थान
- #3476
- लाइसेंस
- MIT
- अपडेट की गई
- 15/10/2026
कमेंट
- …
इस repository की और skills
13c-metabolic-flux
51kकार्बन-13 आइसोटोप ट्रेसिंग डेटा से मेटाबोलिक फ़्लक्स का अनुमान लगाता है। कोशिका के मेटाबॉलिज़्म और बायोकेमिकल मार्गों का विश्लेषण करने के लिए यह उपयोगी है।
adaptyv
51kAdaptyv API का उपयोग करके प्रोटीन कैरेक्टराइज़ेशन प्रयोग डिज़ाइन करता है। लागत का अनुमान लगाने, सीक्वेंस सबमिट करने और लैब के नतीजों पर नज़र रखने में मदद करता है।
aeon
51kटाइम सीरीज़ डेटा पर मशीन लर्निंग के काम करता है। क्रमबद्ध डेटा में वर्गीकरण, पूर्वानुमान, एनोमली डिटेक्शन और पैटर्न खोजने के लिए यह उपयोगी है।
alphagenome
51kजेनेटिक वेरिएंट्स के पहले से गणना किए गए जीनोमिक प्रभाव देखता है। वेरिएंट का जीनोम पर असर समझने के लिए स्कोर और स्पष्टीकरण देता है।
मिलती-जुलती skills
gitcrawl
394kयह आपके एजेंट को GitHub issues और pull requests के सेव आर्काइव में खोजने, मिलते-जुलते मामलों को समूह में रखने और लाइव स्थिति जांचने देती है।
slacrawl
394kयह आपके एजेंट को स्थानीय Slack आर्काइव में संदेश खोजने और गिनने, उसकी ताज़गी जांचने और ज़रूरत पड़ने पर उसे ताज़ा करने देती है।
goplaces
394kयह आपके एजेंट को Google Places से जगहें खोजने, उनका विवरण और समीक्षाएं पाने, और जगह के नाम हल करने में मदद करती है, स्क्रिप्ट के लिए JSON आउटपुट के साथ।