Skip to content

Latest commit

Β 

History

46 Commits

Folders and files

NameName
Last commit message
Last commit date
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

🦷 DenCT β€” Dental CBCT Viewer

npm License React TypeScript

πŸ“– API reference β€” the full component props, imperative ref, and /core exports. Documentation per language:

πŸ‡¬πŸ‡§ English Β· πŸ‡©πŸ‡ͺ Deutsch Β· πŸ‡ͺπŸ‡Έ EspaΓ±ol Β· πŸ‡­πŸ‡Ί Magyar

DenCT

DenCT is an embeddable dental CBCT / CT DICOM viewer for React + TypeScript. Load several CTs at once and switch between them; MPR and true-3D views (with render presets, colormaps and a low/medium/high quality control), panoramic (OPG) reconstruction along the dental arch, perpendicular cross-sections, guided implant planning with nerve/sinus/neighbour safety clearances and bone quality (Misch D1–D5), a printable drill-guide (STL) export, and configurable image (PNG/JPG) and PDF report exports β€” all in a 4-language UI (EN/DE/ES/HU). Everything runs locally in the browser β€” no upload. Built on Cornerstone3D and vtk.js.

πŸ”— Repository: https://github.com/ZoliQua/Dental-CBCT-Viewer


πŸ“¦ Installation

npm install dental-cbct-viewer react react-dom

Requirements: React 18 or 19 (peer dependency); a bundler that supports the exports field, ESM, Web Workers and WASM (Vite, webpack 5, Next.js, Rollup). The heavy imaging libraries (Cornerstone3D, vtk.js, jsPDF, dicom-parser) are regular dependencies and are installed for you.

⚠️ Cross-origin isolation. The DICOM decode workers use SharedArrayBuffer, so the host page must be served with:

Cross-Origin-Opener-Policy: same-origin
Cross-Origin-Embedder-Policy: require-corp

Without these headers, image decoding will not run.

πŸš€ Quick start

Render DicomViewer and import the stylesheet once:

import { DicomViewer } from "dental-cbct-viewer";
import "dental-cbct-viewer/style.css";

export function Planner() {
  return (
    <div style={{ height: "100vh" }}>
      <DicomViewer lang="en" />
    </div>
  );
}

The viewer fills its parent, so give it a sized container. Dark mode is the default and is scoped to the viewer's own root β€” it never touches the host page's theme.

πŸŽ›οΈ Imperative API (ref)

import { useRef } from "react";
import { DicomViewer, type DicomViewerHandle } from "dental-cbct-viewer";
import "dental-cbct-viewer/style.css";

function App() {
  const ref = useRef<DicomViewerHandle>(null);

  return (
    <>
      <button onClick={() => ref.current?.loadSample()}>Load sample</button>
      <button onClick={() => ref.current?.exportPdf()}>Export PDF</button>
      <DicomViewer
        ref={ref}
        initialLayout="1+3"
        onImplantsChange={(implants) => console.log(implants.length, "implants")}
        onPlanChange={(plan) => localStorage.setItem("plan", JSON.stringify(plan))}
      />
    </>
  );
}

Handle methods: getImplants, addImplant, updateImplant, removeImplant, getPlan, loadPlan, loadStudy(files), loadSample, setLayout, setActiveView, exportPdf, exportGuideStl.

Props: patientId, patientName, initialPlan, initialLayout, lang, onPlanChange, onImplantsChange, className, embedded.

🧩 Framework-free core (/core)

Pure, React-free building blocks run in Node, tests or your own logic β€” the implant data model + system catalog and all the geometry/analysis math:

import {
  IMPLANT_SYSTEMS, getImplantSystem,   // implant catalog
  implantWorldAxis, evaluateImplant,   // geometry + nerve/sinus/neighbour safety
  classifyBone, sampleImplantBoneHU,   // Misch D1–D5 bone quality
} from "dental-cbct-viewer/core";

The heavy CSG kernel (drill-guide Boolean via manifold-3d) is loaded lazily, so importing /core for the geometry/safety helpers stays light.

✨ Highlights

  • πŸ—‚οΈ Multi-study β€” load several CTs (DICOM folders, .dcm files, GALILEOS and OneVolume/Morita folders) into a left-panel series tree and switch between them instantly; each study keeps its own plan
  • 🧊 True-3D volume rendering with render presets (incl. translucent X-ray), colormaps (Grayscale / Cool / Warm / Spectral / Inverted) and a Low/Medium/High quality control, intersecting slice planes and a crop box
  • 🩻 MPR (axial / sagittal / coronal) with linked crosshairs, plus panoramic (OPG) reconstruction and tiltable cross-sections along a draggable dental arch curve
  • 🦷 Guided implant planning β€” 3D implant + drill sleeve, nerve / sinus / neighbour safety clearances, bone quality (Misch D1–D5, indicative class from uncalibrated CBCT gray values at the implant site)
  • πŸ–¨οΈ Printable drill guide (STL) via constructive solid geometry (manifold-3d). The exported guide has no integrated drill stop and no metal sleeve, and tissue fit requires a registered surface scan β€” verify the fit on a printed model before any clinical use.
  • πŸ–ΌοΈ Image export (PNG/JPG) β€” pick views, resolution, on-image info to burn in, separate files or one grid β€” and a configurable PDF report (toggle header fields and sections, portrait/landscape; jsPDF with a bundled Unicode font so Hungarian accents render)
  • πŸ”— Plan save/load (JSON), imperative ref API, controlled props/callbacks
  • πŸ”’ 100% local β€” DICOM parsing, rendering and exports run in the browser; nothing is uploaded
  • 🌐 4 UI languages (EN / DE / ES / HU) Β· πŸŒ“ self-scoped dark mode Β· 🧱 embeddable

βš™οΈ Notes for host bundlers

  • Vite: works out of the box.
  • Next.js / webpack 5: render the viewer in a client component ("use client") β€” it reads the DOM on mount. Ensure the COOP/COEP headers above are set (e.g. via next.config.js headers). Worker/WASM assets are pre-bundled into the package.

πŸ”’ Security & privacy

  • No network egress. The viewer never uploads scans or patient data β€” all parsing, rendering and exports happen in the browser. It contacts no analytics or third-party host; the only fetch is for its own bundled sample asset. Exported PDF/PNG/STL/plan files are user-initiated downloads.
  • Untrusted input is bounded. Decompression enforces an output budget (gzip-bomb safe), the native-volume decoders validate geometry against hard caps before allocating, and plan JSON is parsed with a strict field allowlist (no prototype pollution).
  • Content-Security-Policy. The hosted demo ships a strict CSP (connect-src 'self', object-src 'none', no unsafe-eval for scripts). When you embed the component, set an appropriate CSP on your host page β€” the library needs script-src 'wasm-unsafe-eval' and worker-src blob: for the WASM decode workers, plus the COOP/COEP headers below.

πŸ“„ License & disclaimer

MIT Β© ZoltΓ‘n Dul. Bundled Roboto font under Apache-2.0 (see LICENSE).

Medical disclaimer: research/demonstration software only β€” not a certified medical device and not for clinical diagnosis, treatment planning, precise measurement or implant workflows.

About

🩻 DenCT 🦷 Dental CBCT (Cone Beam Computed Tomography) DICOM viewer πŸ’» in React + Cornerstone3D - MPR & 3D views, panoramic (OPG) reconstruction, cross-sections, measurements, 3D implant planning with layers and PDF export.

Topics

Resources

Code of conduct

Contributing

Stars

9 stars

Watchers

1 watching

Forks

Releases

Packages

Contributors

Languages