Imagebox3
Tile Serving on the web without a server
Install / Use
/learn @episphere/Imagebox3README
ImageBox3
A JavaScript library for zero-footprint, in-browser patch extraction from TIFF-based Whole Slide Imaging (WSI) data. No (server-side) tiling service needed! All computation is performed on your device using HTTP Range Requests to retrieve remote patches without downloading the entire image. This ensures complete user governance while operating public and private images alike at zero cost. ImageBox3 is freely usable and immediately portable to any device with a web browser. Try it with your own whole slide imaging data at: https://episphere.github.io/imagebox3.
Example Usage
Here is how you would retrieve a patch/tile at a specific location in a whole slide image using Imagebox3:
import { Imagebox3 } from "https://episphere.github.io/imagebox3/imagebox3.mjs"
// Create an instance with the URL to the image (or a File object for a local image).
const wholeSlide = new Imagebox3("https://storage.googleapis.com/imagebox_test/openslide-testdata/Aperio/CMU-1.svs")
// Initialize the instance, i.e., retrieve relevant metadata from the file headers.
await wholeSlide.init()
// Get basic image info, such as the width, height and pixelsPerMicron.
const { width: imageWidth, height: imageHeight, pixelsPerMicron } = await wholeSlide.getInfo()
// Fetch patch by passing in parameters corresponding to the coordinates of the top left corner of the patch and its width
// and height in image pixel coordinates, along with the resolution at which it should be returned.
let patchWidth = 512
let patchHeight = 512
let patchTopLeftX = Math.round( (imageWidth - patchWidth) / 2)
let patchTopLeftY = Math.round( (imageHeight - patchHeight) / 2)
let patchResolution = 512
const patchBlob = await wholeSlide.getTile(patchTopLeftX, patchTopLeftY, patchWidth, patchHeight, patchResolution)
// Render the retrieved PNG blob as an image on a webpage.
const patchObjectURL = URL.createObjectURL(patchBlob)
const img = new Image()
img.src = patchObjectURL
img.onload = () => {
URL.revokeObjectURL(img.src)
}
Related Skills
node-connect
349.2kDiagnose OpenClaw node connection and pairing failures for Android, iOS, and macOS companion apps
frontend-design
109.5kCreate distinctive, production-grade frontend interfaces with high design quality. Use this skill when the user asks to build web components, pages, or applications. Generates creative, polished code that avoids generic AI aesthetics.
openai-whisper-api
349.2kTranscribe audio via OpenAI Audio Transcriptions API (Whisper).
qqbot-media
349.2kQQBot 富媒体收发能力。使用 <qqmedia> 标签,系统根据文件扩展名自动识别类型(图片/语音/视频/文件)。
