cornerstone3D

cornerstonejsMIT活跃维护

一套用于构建 Web 医学影像应用的 JavaScript 库,提供渲染、分割等基础能力,方便开发放射科阅片类应用。

Cornerstone is a set of JavaScript libraries that can be used to build web-based medical imaging applications. It provides a framework to build radiology applications such as the OHIF Viewer.

v5.16.0发布于 2026-11-09 20:03 UTC1,166star540fork同步于 2026-11-10 11:50 UTC

怎么上手

由 README 提炼,执行前请确认
corepack enable
pnpm install --frozen-lockfile
硬件要求按 README 说明

README 未说明

下载:源码 zip·GitHub Releases(安装包)本站不镜像安装包

项目说明

由 README 自动翻译提炼

用 JavaScript 构建 Web 医学影像应用的库集合,可直接支撑放射科阅片器

一套用于构建 Web 医学影像应用的 JavaScript 库,提供渲染、分割等基础能力,方便开发放射科阅片类应用。

核心能力

  • 用 WebGL 做高性能图像渲染
  • 用 WebAssembly 加速图像解压
  • 提供自定义图像、体数据与元数据加载 API
  • 开箱支持 DICOMweb 标准
  • 内置 OHIF Viewer 下游兼容性验证流程

容易踩的坑

仓库通过 packageManager 锁定 pnpm 12.8.1,需先启用 Corepack 才能用对版本;单元测试报找不到 canvas.node 时需运行 pnpm run rebuild:canvas 重建原生 canvas 模块;本地联调 OHIF 需先 pnpm run build:esm 再用 link 脚本软链,结束时要 unlink 恢复

内容由模型根据 README 生成,可能不完整或不准确,以官方文档为准。看原文 README

最近发版

5 个版本v5.16.0
  1. v5.16.0最新正式版2026-11-09 · 2026-11-09 20:03 UTC

    What's Changed

    Full Changelog: https://github.com/cornerstonejs/cornerstone3D/compare/v5.15.2...v5.16.0

  2. v5.15.22026-11-03 · 2026-11-03 19:35 UTC
    查看更新说明

    What's Changed

    Full Changelog: https://github.com/cornerstonejs/cornerstone3D/compare/v5.15.1...v5.15.2

  3. v5.15.12026-11-03 · 2026-11-03 16:51 UTC
    查看更新说明

    What's Changed

    Full Changelog: https://github.com/cornerstonejs/cornerstone3D/compare/v5.15.0...v5.15.1

  4. v5.15.02026-11-03 · 2026-11-03 14:57 UTC
    查看更新说明

    What's Changed

    Full Changelog: https://github.com/cornerstonejs/cornerstone3D/compare/v5.14.0...v5.15.0

  5. v5.14.02026-10-28 · 2026-10-28 12:13 UTC
    查看更新说明

    What's Changed

    Full Changelog: https://github.com/cornerstonejs/cornerstone3D/compare/v5.13.2...v5.14.0

用户点评

登录用户的真实使用记录,可按版本和硬件筛选
共 0 条

    还没有人点评。第一个说出真实体验的人最有价值。

    README 原文

    未翻译

    Cornerstone.js · GitHub license

    Cornerstone is a set of JavaScript libraries that can be used to build web-based medical imaging applications. It provides a framework to build radiology applications such as the OHIF Viewer

    • Fast: Cornerstone leverages WebGL to provide high-performance image rendering and WebAssembly for fast image decompression.
    • Flexible: Cornerstone provides APIs for defining custom image, volume, and metadata loading schemes, allowing developers to easily connect with proprietary image archives.
    • Community Driven: Cornerstone is supported by the Open Health Imaging Foundation. We publish our roadmap and welcome contributions and collaboration.
    • Standards Compliant: Cornerstone's core focus is Radiology, so it provides DICOMweb compatibility out-of-the-box

    Learn how to use Cornerstone3D in your project.

    Local Setup

    This repository is pinned to pnpm 12.8.1 via packageManager. Use Corepack to run the pinned version:

    corepack enable
    pnpm install --frozen-lockfile
    

    The repo disables pnpm's own package-manager auto-switching because some standalone pnpm installs try to download a platform-specific pnpm binary and can fail before any install command runs. Corepack and CI still use the pinned pnpm version.

    Documentation

    You can find the Cornerstone documentation on the website.

    The documentation is divided into several sections

    OHIF Downstream Validation

    The Cornerstone3D build includes an OHIF checkout and test linked to the current branch of CS3D in order to test compatibility with the checked out version. This ensures that CS3D changes do not break the OHIF Viewer before they are published.

    Additionally, the OHIF pipeline can build and deploy a preview release against a CS3D branch for manual testing. This pipeline does not re-test the CS3D side but is intended for manual validation of changes in the full viewer.

    Some tests in OHIF may need additional wait time built in to enable them to pass on slower servers

    How it works

    The downstream validation is defined in .github/workflows/ohif-downstream.yml. It runs on every CS3D pull request and workflow_dispatch:

    1. Checks out the CS3D PR branch and builds it (pnpm run build:esm).
    2. Checks out the OHIF Viewer at a ref resolved for that run: by default master; on pull requests you can override with a line in the PR description (see below); on workflow_dispatch you can set the ohif_ref input.
    3. Installs OHIF dependencies, then symlinks the locally built CS3D packages into OHIF's node_modules via scripts/link-ohif-cornerstone-node-modules.mjs.
    4. Runs OHIF unit tests and Playwright e2e tests against the linked build.

    Choosing the OHIF Viewer ref (OHIF_REF / ohif_ref)

    By default the workflow checks out master of OHIF/Viewers. You can point downstream validation at another branch or tag without editing the workflow file:

    On a CS3D pull request — add a line to the PR description (same style as OHIF uses for CS3D_REF: on the OHIF side):

    OHIF_REF: your-branch-or-tag
    

    The first line matching that pattern wins; the value is the first token after the colon (no spaces in the ref). If you omit this line, the job uses master.

    When running the workflow manually — use the ohif_ref input on workflow_dispatch (defaults to master).

    Coordinated CS3D + OHIF changes — when a feature needs changes in both repositories, create an OHIF branch whose name matches your CS3D branch (e.g. both feat/shared-thing). Then put OHIF_REF: feat/shared-thing in the CS3D PR body (or set ohif_ref to that name for a manual run). Matching names make it obvious which Viewer branch pairs with which Cornerstone branch and avoid juggling unrelated branch names across the two repos.

    Tip: This pairs with the OHIF side of the integration. The OHIF repo uses the ohif-integration label and CS3D_REF: in the PR body to test an OHIF PR against a CS3D branch. Together, OHIF_REF: here and CS3D_REF: there let both sides run the full test suite against unpublished code. See the OHIF Viewer README — Cornerstone3D Integration Testing for details on the OHIF side.

    Local Development: Linking & Unlinking

    Two scripts are provided for linking a local CS3D build into an OHIF checkout so you can iterate without publishing:

    Link

    From the CS3D repo root, after building (pnpm run build:esm):

    node scripts/link-ohif-cornerstone-node-modules.mjs /path/to/ohif
    

    This replaces the installed @cornerstonejs/* packages inside OHIF's node_modules with symlinks pointing to the local CS3D build output. The following packages are linked:

    PackageLocal path
    @cornerstonejs/adapterspackages/adapters
    @cornerstonejs/aipackages/ai
    @cornerstonejs/corepackages/core
    @cornerstonejs/dicom-image-loaderpackages/dicomImageLoader
    @cornerstonejs/labelmap-interpolationpackages/labelmap-interpolation
    @cornerstonejs/metadatapackages/metadata
    @cornerstonejs/nifti-volume-loaderpackages/nifti-volume-loader
    @cornerstonejs/polymorphic-segmentationpackages/polymorphic-segmentation
    @cornerstonejs/toolspackages/tools

    After linking, start OHIF's dev server (pnpm run dev) and any changes you make in CS3D (after rebuilding) will be reflected immediately.

    Unlink

    To restore the registry-installed packages:

    node scripts/unlink-ohif-cornerstone-node-modules.mjs /path/to/ohif
    

    This removes the symlinks and runs pnpm install --frozen-lockfile in the OHIF directory to restore the original packages.

    Typical workflow

    # 1. Build CS3D
    cd /path/to/cornerstone3D
    pnpm install --frozen-lockfile
    pnpm run build:esm
    
    # 2. Link into OHIF
    node scripts/link-ohif-cornerstone-node-modules.mjs /path/to/ohif
    
    # 3. Start OHIF
    cd /path/to/ohif
    pnpm run dev
    
    # 4. Iterate — rebuild CS3D after changes:
    cd /path/to/cornerstone3D
    pnpm run build:esm
    # OHIF dev server picks up changes automatically
    
    # 5. When done, unlink
    node scripts/unlink-ohif-cornerstone-node-modules.mjs /path/to/ohif
    

    Tip: For the pnpm link based approach (useful when working on a single package rather than the full set), see the Linking Cornerstone Libraries doc.

    Troubleshooting

    If unit tests fail with "Cannot find module '../build/Release/canvas.node'", the native canvas addon wasn’t built. Run pnpm run rebuild:canvas; if that doesn’t fix it, see docs/troubleshooting.md.

    Support

    Users can post questions and issues on the Open Health Imaging Foundation (OHIF) Community Forum. Developer issues or bugs can be reported as Github Issues.

    The OHIF Resources page may be of interest to Cornerstone users, as it includes presentations and demonstrations of OHIF and Cornerstone.

    Contributing

    Code of Conduct

    Cornerstone has adopted a Code of Conduct that we expect project participants to adhere to.

    Contributing Guide

    Read our guide on How-to Contribute and about our Issue Triage process.

    Testing

    The repository has three browser-level test paths:

    Start with:

    ./scripts/run-karma.sh
    ./scripts/run-playwright.sh
    yarn test:vitest:browser
    

    Detailed usage, wrapper flags, report output, and baseline management live in the contributor docs:

    Vitest browser-mode tests currently live only in-repo. Use yarn test:vitest:browser, yarn test:vitest:browser:update, and yarn test:vitest:browser:ui. The test files are matched from tests/vitest-browser/**/*.browser.test.ts.

    License

    Cornerstone is MIT licensed.