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.
You can find the Cornerstone documentation on the website.
The documentation is divided into several sections
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
The downstream validation is defined in
.github/workflows/ohif-downstream.yml.
It runs on every CS3D pull request and workflow_dispatch:
- Checks out the CS3D PR branch and builds it (
bun run build:esm). - Checks out the OHIF Viewer at the ref specified by the
OHIF_REFenv variable (defaults tomaster). - Installs OHIF dependencies, then symlinks the locally built CS3D packages
into OHIF's
node_modulesviascripts/link-ohif-cornerstone-node-modules.mjs. - Runs OHIF unit tests and Playwright e2e tests against the linked build.
By default the workflow checks out master of the OHIF Viewer. To test against
a different OHIF branch (e.g. when a feature requires coordinated changes in
both repos):
- Open
.github/workflows/ohif-downstream.yml. - Change the
OHIF_REFenvironment variable (line 19) frommasterto the target branch:env: OHIF_REF: feat/my-ohif-feature # was: master
- Commit and push. The downstream job will now clone and test against that OHIF branch instead.
- Remember to set
OHIF_REFback tomasterbefore merging your CS3D PR.
Tip: This pairs with the OHIF side of the integration. While
OHIF_REFlets a CS3D PR test against an OHIF branch, the OHIF repo has a symmetric mechanism — theohif-integrationlabel andCS3D_REFin the PR body — that lets an OHIF PR test against a CS3D branch. Together these allow both sides to run the full test suite against unpublished code. See the OHIF Viewer README — Cornerstone3D Integration Testing for details on the OHIF side.
Two scripts are provided for linking a local CS3D build into an OHIF checkout so you can iterate without publishing:
From the CS3D repo root, after building (bun run build:esm):
node scripts/link-ohif-cornerstone-node-modules.mjs /path/to/ohifThis replaces the installed @cornerstonejs/* packages inside OHIF's
node_modules with symlinks pointing to the local CS3D build output. The
following packages are linked:
| Package | Local path |
|---|---|
@cornerstonejs/adapters |
packages/adapters |
@cornerstonejs/ai |
packages/ai |
@cornerstonejs/core |
packages/core |
@cornerstonejs/dicom-image-loader |
packages/dicomImageLoader |
@cornerstonejs/labelmap-interpolation |
packages/labelmap-interpolation |
@cornerstonejs/nifti-volume-loader |
packages/nifti-volume-loader |
@cornerstonejs/polymorphic-segmentation |
packages/polymorphic-segmentation |
@cornerstonejs/tools |
packages/tools |
After linking, start OHIF's dev server (yarn dev or bun run dev) and any
changes you make in CS3D (after rebuilding) will be reflected immediately.
To restore the registry-installed packages:
node scripts/unlink-ohif-cornerstone-node-modules.mjs /path/to/ohifThis removes the symlinks and runs yarn install --frozen-lockfile in the OHIF
directory to restore the original packages.
# 1. Build CS3D
cd /path/to/cornerstone3D
bun install --frozen-lockfile
bun 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
yarn dev
# 4. Iterate — rebuild CS3D after changes:
cd /path/to/cornerstone3D
bun run build:esm
# OHIF dev server picks up changes automatically
# 5. When done, unlink
node scripts/unlink-ohif-cornerstone-node-modules.mjs /path/to/ohifTip: For the
yarn linkbased approach (useful when working on a single package rather than the full set), see the Linking Cornerstone Libraries doc.
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.
Cornerstone has adopted a Code of Conduct that we expect project participants to adhere to.
Read our guide on How-to Contribute and about our Issue Triage process.
Cornerstone is MIT licensed.