Skip to content

Raster-Lab/RasterOneImage

Repository files navigation

Raster OneImage

An Apple-native, local-first diagnostic imaging and advanced-visualization workstation.

OneImage reads DICOM studies, drives 2D / MPR / 3D visualization on-device (Apple-silicon Metal, no render server), and layers vendor-neutral quantification suites — calcium scoring, coronary and vascular analysis, cardiac function, neuro perfusion, oncology response, body composition, and more — on top of a strict, verifiable imaging core.

Safety class: IEC 62304 Class C. A failure could contribute to serious injury through compromised diagnostic integrity, so the standards in CLAUDE.md and Docs/QA/QUALITY-PLAN.md are binding for every change. This is pre-submission engineering — not a cleared medical device.


What makes it different

  • Local-first, no server. Each Mac is its own render farm (Metal raycaster, 60+ fps volume rendering). No thin client, no cloud dependency, no per-seat concurrency licensing — PHI never has to leave the machine.
  • "No silent anything." Strict declared-syntax decode (no silent codec fallback), geometry-refusal gates (gantry tilt / accumulated shear are refused, not silently reformatted), frame-integrity gating for cine, and a typed-error discipline where every failure surfaces explicitly rather than degrading quietly (SRS-GEN-004).
  • Class C lifecycle as code. Requirements (Docs/SRS-baseline-v1.0.md), a risk register, architecture decision records, and golden-image tests live in-repo and are enforced in CI — safety-relevant code carries // Traces: SRS-… and tests carry // Verifies: SRS-….
  • Engines first, suites second. ~20 clinical workflows are thin, auditable compositions over a handful of shared computational engines (segmentation, vessel/centerline, registration, temporal), so each suite is small and testable rather than a monolith.

See ARCHITECTURE.md for the full system design and competitive positioning.


Repository layout

A Swift Package Manager monorepo: 33 packages under Packages/, 4 app shells under Apps/, and controlled documentation under Docs/.

Platform & core (Packages/)

Package Role
OneCore Shared value types, error taxonomy, viewport/presentation model, patient-context machine
OnePixel Strict decode, LUT chain, volume assembly + geometry gate (VolumeBuilder)
OneRender Metal 2D/3D rendering, MPR reformatting, GPU raycaster with CPU reference oracle
OneStore Content-addressed immutable vault, GRDB/SQLite library, verify-on-write
OnePACS DIMSE (ECHO/FIND/MOVE/GET/STORE) + DICOMweb (QIDO/WADO/STOW)
OneUI SwiftUI components, badges, overlays, orientation markers
OneAnnotate Measurement geometry, ROI statistics, calibration, GSPS/SR writers, undo/redo history
OneQuant · OneReport Volumetrics; structured-report model + DICOM SR authoring
OneAI · OneSec · OneAudit Signed CoreML runtime + SEG alignment gate; auth/RBAC; hash-chained audit log
OneCompanion · OneCompanionRelay Non-diagnostic companion domain (watch/tv), enforced by build-time boundary (D-16)

Computational engines (Packages/)

OneSegment (thresholding, region-grow, morphology, connected components, marker-controlled watershed) · OneVascular (exact distance transform, centerline extraction, vessel-tree assembly, diameter/stenosis) · OneRegister (affine/rigid, mutual information, B-spline FFD deformable solver, Green–Lagrange strain) · OneTemporal (4D time-series, kinetics, cine).

Map-producer cores — pure per-voxel/geometry lifts of the suites above (CPU oracles; the GPU/app display wiring is separate, see below): OnePerfusion (4D VolumeTimeSeries → CBF/CBV/MTT/Tmax ScalarField maps, lifting OneNeuro deconvolution per voxel — D-37, SRS-NEU-002, TC-NEU-002) · OneSpectralMaps (two co-registered energy volumes → 2-material/iodine/VMI + 3-material fraction/VNC maps, lifting OneSpectral decomposition per voxel — D-38, SRS-SPC-002, TC-SPC-002) · OneCPR (rotation-minimizing frame field + straightened & stretched trilinear CPR reformat, the CPU oracle for centerline→CPR — D-39, SRS-VAS-004, TC-VAS-004).

Clinical suites (Packages/)

Vendor-neutral, DICOMKit-free, phantom-tested — the quantification packs:

OneCalcium (Agatston/volume/mass + per-artery) · OneCoronary (plaque, stenosis, virtual stent) · OneCardiacFunction (EF/volumetrics) · OneStructuralHeart (TAVR/TMVR/LAA geometry) · OneAortic (EVAR planning) · OneCardiacMR (T1/T2/ECV, feature-tracking strain, flow) · OneNeuro (CT perfusion CBF/CBV/MTT/Tmax + mismatch, ASPECTS) · OneOncology (RECIST 1.1 / PERCIST + cross-timepoint lesion tracking) · OneBodyQuant (lung density, nodule doubling, Couinaud liver + resection) · OneSpectral (dual-energy VMI/iodine/VNC) · OneBreast (BI-RADS density).

Apps (Apps/)

App Status
OneImage-macOS The diagnostic reading workstation (primary)
OneImage-iOS Limited-indication viewer (scheduled)
OneImage-tvOS · OneImage-watchOS Non-diagnostic companions — watermarked renditions only, enforced at build time (D-16)

The macOS app today

The reading workstation surfaces:

  • Viewing — 2D stack scroll, cursor-anchored zoom / pan / rotate / flip, window-level with CT presets, MPR + on-device 3D volume rendering, multi-frame cine, series navigator, DICOM info overlay, orientation markers.
  • Measurement — length / angle calipers, ellipse / polygon ROIs with HU statistics, undo / redo (⌘Z / ⌘⇧Z), a measurements panel with per-row delete and select-to-highlight, and an Edit tool (d) to select a drawn caliper or grab and drag a length/angle handle — the moved value is recomputed on the displayed image's own calibration, never another slice's (RSK-011).
  • Persistence — export / import measurements as a DICOM SR file (local only, never transmitted). Import refuses a cross-patient or cross-study file outright and rebinds each measurement only to its exact referenced image (SOP-instance + series + class + frame), recomputing its value on that image's own calibration — a caliper can never land on the wrong image, and a partial import surfaces exactly what was skipped.
  • PACS — query / retrieve against DIMSE + DICOMweb.
  • Analysis workflows (the clinical-suite integration layer) — open from the Analysis menu:
    • Calcium Scoring — assembles the series volume, bridges to Hounsfield units, and runs OneCalcium (Agatston / volume / mass / lesion count) with a tunable threshold.
    • RECIST 1.1 — sums the reader's calibrated length calipers as target-lesion diameters and, against a documented prior, computes the OneOncology response category.
    • Segmentation — two OneSegment modes over the assembled series volume: a global HU threshold (with CT tissue presets) or a region grown from a clicked seed. Either way it reports segmented volume, voxel count, masked-region HU statistics (mean ± SD, range) and the region's longest axis (OneQuant, with its exact-vs-approximate method shown verbatim), and draws the mask as a translucent overlay placed on the correct slice by exact geometry and bound to its source series (never a wrong-slice or wrong-series overlay).
    • Clinical CalculatorsOneStructuralHeart device compression (TAVR/TMVR), OneBodyQuant nodule doubling time and future-liver-remnant, and OneNeuro hemisphere HU asymmetry.

Seven analysis packages are reachable in the app today (OneCalcium, OneOncology, OneSegment, OneQuant, OneStructuralHeart, OneBodyQuant, OneNeuro); the Analysis layer is the reusable scaffold. The remaining suites (coronary, aortic, cardiac function/MR, spectral, neuro perfusion) exist as tested packages but are not yet wired — and the CPU compute cores for the hardest of these now exist too: neuro-perfusion CBF/CBV/MTT/Tmax maps (OnePerfusion), spectral material/iodine/VMI/VNC maps (OneSpectralMaps), and the straightened & stretched CPR reformat (OneCPR) all ship as unit-tested, vendor-neutral map producers. What is still missing is the app/GPU wiring on top of those cores — parametric colour-map overlay display of the maps, VR picking, an interactive CPR pane with cross-section diameter/area read, and a Metal CPR kernel — plus the 4-D multi-series assembly path and external models/databases; that wiring was deliberately deferred because it needs a loaded PHI study and a GPU spot-check. That phased integration is in Docs/PLANS/full-parity-plan.md; the competitive framing is in Docs/COMPETITIVE/terarecon-gap-analysis.md.


Quality, safety & PHI

  • CI gate: make ci runs build (zero-warning) + test + swiftlint --strict + the companion-boundary check + traceability regeneration. It must be green before any change is considered done.
  • Traceability: make trace regenerates the requirements and traceability registers; new requirements need test cases in the same change.
  • Language policy: Swift 6.2 strict concurrency; SwiftUI shells; C only for performance-critical kernels behind Swift APIs, fuzz-tested and sanitizer-clean. Force-unwrap / try! are lint errors in production paths.
  • Architecture decisions: 39 ADRs in Docs/ADR/; dependency direction points downward only, DICOMKit is a pinned SPM dependency (never forked, D-1).
  • ⚠️ PHI: TestData/ (~19 GB DICOM) contains identifiable patient data. Never commit, upload, screenshot, or excerpt identity fields; anonymize per PS3.15 Annex E before anything leaves the machine. Tests treat it read-only. TestData/, .build/, and local config are git-ignored.

Build & run

Requires macOS with Xcode 26 / Swift 6.2+ selected (DEVELOPER_DIR must point at Xcode, not the Command-Line-Tools-only toolchain), plus swiftlint and OpenJPEG (brew install openjpeg) for the DICOMKit static link.

export DEVELOPER_DIR=/Applications/Xcode.app/Contents/Developer

# Full CI gate across all packages (build · test · lint · boundary · trace)
make ci

# A single package
cd Packages/OneCalcium && swift build -Xswiftc -warnings-as-errors && swift test

# The macOS reading app
cd Apps/OneImage-macOS && swift run OneImageMac

See BUILD.md for milestone exit criteria and the full toolchain notes.


Status & honest boundary

The computational surface is built and tested: the four engines and eleven clinical suites all pass make ci, validated against synthetic phantoms with committed tolerance bounds. The macOS reader is a working diagnostic shell with two clinical workflows wired in (calcium, RECIST) and the framework to add the rest.

What the code cannot produce — surfaced as "not available", never fabricated:

  • Normative databases (calcium percentiles), an anatomical atlas (ASPECTS territories, AHA-17, vertebral labels), and device libraries (TAVR / stent-graft).
  • Trained AI models — the AI runtime is built (signed CoreML, alignment gating, on-device inference), but ships with no trained weights; auto-segmentation and detection are upgrades once models clear validation.
  • Clinical validation corpora and, ultimately, regulatory clearance — the actual gate to clinical use. Everything here is pre-submission engineering.

Documentation

Doc What
ARCHITECTURE.md System architecture, layering, competitive positioning
ROADMAP.md · BUILD.md Milestones and exit criteria
Docs/SRS-baseline-v1.0.md Software requirements (IDs SRS-<AREA>-<NNN>)
Docs/QA/ Quality plan, test plan, test cases, traceability matrix
Docs/ADR/ 39 architecture decision records
Docs/PLANS/ · Docs/COMPETITIVE/ Parity plan; TeraRecon gap analysis
CLAUDE.md Binding instructions for AI-assisted sessions

Raster OneImage is developed by Raster Lab. DICOMKit and the imaging codecs are consumed as pinned upstream dependencies.

About

Raster OneImage — Apple-native, IEC 62304 Class C DICOM imaging workstation (diagnostic 2D/MPR/3D, streaming PACS, AI-native, non-diagnostic companions)

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages