展示HN:从S3流式传输十亿像素医疗图像,无需下载。
Show HN: Streaming gigabyte medical images from S3 without downloading them

原始链接: https://github.com/PABannier/WSIStreamer

## WSI Streamer:云原生全玻片图像服务器 WSI Streamer 是一款专为存储在对象存储(如 S3)中的大型全玻片图像 (WSI) 设计的现代切片服务器。它通过按需流式传输切片来简化 WSI 查看,避免下载整个文件。 安装简单,使用 Rust (`cargo install wsi-streamer`),只需一条命令即可开始从 S3 提供服务。它原生支持 Aperio SVS 和金字塔 TIFF 格式,利用 HTTP Range 请求实现高效的切片传输。 主要功能包括内置的 OpenSeadragon 基础查看器、生产级别的 HMAC-SHA256 身份验证和多层缓存。配置最少,依赖于命令行标志或环境变量。也提供 Docker 支持,方便部署。 WSI Streamer 提供 REST API 用于访问玻片、切片、元数据和缩略图。它专为可扩展性和易用性而设计,为 WSI 可视化提供精简的解决方案。 [https://github.com/PABannier/WSIStreamer](https://github.com/PABannier/WSIStreamer)

黑客新闻 新 | 过去 | 评论 | 提问 | 展示 | 工作 | 提交 登录 展示HN:从S3流式传输千兆医疗图像,无需下载它们 (github.com/pabannier) 13点 由 el_pa_b 1小时前 | 隐藏 | 过去 | 收藏 | 2评论 matthberg 19分钟前 [–] 看起来非常类似于如今网络地图的工作方式,特别是protomap文件[0]。我想知道是否可以在leaflet或其他前端地图库中添加一个shim层来查看医疗图像?很棒的工作!0: https://protomaps.com/回复 el_pa_b 9分钟前 | 父评论 [–] 谢谢!的确,数字病理学、卫星图像和地理空间数据共享许多计算问题:高效存储、快速空间检索/索引。我认为这应该可以实现。对于数字病理学,该领域与扫描仪供应商专有格式(SVS、NDPI、MRXS等)紧密相关。 指南 | 常见问题 | 列表 | API | 安全 | 法律 | 申请YC | 联系 搜索:
相关文章

原文

CI crates.io Docker

A modern, cloud-native tile server for Whole Slide Images. One command to start serving tiles directly from S3.

Video demo

# Installation (requires Rust, see alternatives below)
cargo install wsi-streamer

# On your local machine
wsi-streamer s3://my-slides-bucket --s3-region eu-west-3

That's it. No configuration files, no local storage, no complex setup. Open http://localhost:3000/view/sample.svs in your browser to view a slide.

Whole Slide Images are large (1-10GB+) and typically live in object storage. Traditional viewers require downloading entire files before serving a single tile. WSI Streamer takes a different approach: it understands slide formats natively, fetches only the bytes needed via HTTP range requests, and returns JPEG tiles immediately.

  • Range-based streaming — fetches only the bytes needed for each tile, no local files
  • Built-in viewer — OpenSeadragon-based web viewer with pan, zoom, and dark theme
  • Native format support — Rust parsers for Aperio SVS and pyramidal TIFF
  • Production-ready — HMAC-SHA256 signed URL authentication
  • Multi-level caching — slides, blocks, and encoded tiles

Install from crates.io:

cargo install wsi-streamer

Or build from source:

git clone https://github.com/PABannier/WSIStreamer.git
cd WSIStreamer
cargo build --release

Or run with Docker:

# Pull from GitHub Container Registry
docker run -p 3000:3000 -e WSI_S3_BUCKET=my-bucket ghcr.io/pabannier/wsistreamer:latest

# Or use Docker Compose for local development with MinIO
docker compose up --build
# Serve slides from S3
wsi-streamer s3://my-slides

# Custom port
wsi-streamer s3://my-slides --port 8080

# S3-compatible storage (MinIO, etc.)
wsi-streamer s3://slides --s3-endpoint http://localhost:9000
# List slides
curl http://localhost:3000/slides

# Get slide metadata
curl http://localhost:3000/slides/sample.svs

# Fetch a tile (level 0, position 0,0)
curl http://localhost:3000/tiles/sample.svs/0/0/0.jpg -o tile.jpg

# Get thumbnail
curl "http://localhost:3000/slides/sample.svs/thumbnail?max_size=256" -o thumb.jpg
# Enable HMAC-SHA256 authentication
wsi-streamer s3://my-slides --auth-enabled --auth-secret "$SECRET"

# Generate signed URLs
wsi-streamer sign --path /tiles/slide.svs/0/0/0.jpg --secret "$SECRET" --base-url http://localhost:3000

The web viewer handles authentication automatically when enabled.

# Check S3 connectivity
wsi-streamer check s3://my-slides

# List available slides
wsi-streamer check s3://my-slides --list-slides

# Test a specific slide
wsi-streamer check s3://my-slides --test-slide sample.svs

All options can be set via CLI flags or environment variables:

Option Env Var Default Description
--host WSI_HOST 0.0.0.0 Bind address
--port WSI_PORT 3000 HTTP port
--s3-bucket WSI_S3_BUCKET S3 bucket name
--s3-endpoint WSI_S3_ENDPOINT Custom S3 endpoint
--s3-region WSI_S3_REGION us-east-1 AWS region
--auth-enabled WSI_AUTH_ENABLED false Enable authentication
--auth-secret WSI_AUTH_SECRET HMAC secret key
--cache-slides WSI_CACHE_SLIDES 100 Max slides in cache
--cache-tiles WSI_CACHE_TILES 100MB Tile cache size
--jpeg-quality WSI_JPEG_QUALITY 80 JPEG quality (1-100)
--cors-origins WSI_CORS_ORIGINS any Allowed CORS origins

Run wsi-streamer --help for full details.

Endpoint Description
GET /health Health check
GET /view/{slide_id} Web viewer
GET /tiles/{slide_id}/{level}/{x}/{y}.jpg Fetch tile
GET /slides List slides
GET /slides/{slide_id} Slide metadata
GET /slides/{slide_id}/thumbnail Thumbnail
GET /slides/{slide_id}/dzi DZI descriptor

See API_SPECIFICATIONS.md for complete documentation.

Format Extensions Compression
Aperio SVS .svs JPEG, JPEG 2000
Pyramidal TIFF .tif, .tiff JPEG, JPEG 2000

Files must be tiled (not stripped) and pyramidal.

MIT. See LICENSE.

Issues and pull requests welcome. See CONTRIBUTING.md.

联系我们 contact @ memedata.com