How bettermedicine/ohif works
Main Components
• Viewer Application: This is the client‑facing progressive web app (PWA) contained in platform/app. It hosts the main user interface for rendering medical images.
• Core Business Logic: Found in platform/core, it encapsulates the essential services like the DICOM metadata store, display set services, hanging protocol management, panel coordination, and more.
• UI Library/Components: Under platform/ui (and platform/ui‑next), this houses the React component library that supplies the widgets (buttons, panels, toolbars, dialogs, etc.) used by the viewer.
• Extensions: The extensions directory contains modular plug‑ins for various functionalities (e.g., segmentation, measurement tracking, volume rendering, PDF and DICOM RT handling, and even whole slide microscopy). These enable high customizability and can be visualized as plugins that integrate with the core system.
• Modes: The modes folder provides different “modes” or configurations of the viewer (like basic development, longitudinal, TMTV, microscopy, etc.) that adapt behaviors/configurations for specific use cases.
• Supporting Modules:
• Internationalization (platform/i18n)
• Documentation (platform/docs)
• CLI tools (platform/cli) and project-level configuration (lerna.json, package.json, etc.)
• Viewer (platform/app) as the central user interface that communicates with the core business logic (platform/core) via clearly defined services.
• That the UI components (from platform/ui/ui‑next) feed into the viewer.
• Integration of extensions into the core architecture – for example, using a plug‑in pattern where extensions (e.g., cornerstone, dicom‑pdf, measurement‑tracking) extend or override default behaviors.
• CI/CD and deployment aspects (like Docker configuration, Netlify, CircleCI workflows) as supporting infrastructure components that deploy the viewer.
Architectural Patterns and Design Principles
• Modular and Plugin-based Architecture: Separate business logic, UI, and functionality are designed to be decoupled. Extensions and modes define clear interfaces for integration.
• Monorepo Project Organization: Managed with Lerna and Yarn Workspaces, which coordinates shared dependencies and common configuration across modules.
• Separation of Concerns: Notice that data access (DICOMweb via dedicated modules) is separated from presentation (UI components).