3.1 KiB
Architecture
Overview
The OHIF/Viewers repository contains the source code for the OHIF Medical Imaging Viewer. It is effectively a React progressive web app (PWA) that combines the business logic housed in OHIF/ohif-core and the components in our React Component library OHIF/react-viewerbase. It provides customization for common use cases through configuration and for adding functionality via extensions.
The purpose of this documentation is to better illustrate how these pieces work together to create a Viewer and where you should direct your attention for contributions.
Business Logic
Our goal is to maintain the majority of our business logic in OHIF/ohif-core. ohif-core offers pre-packaged solutions for features common to Web-based medical imaging viewers. For example:
- Hotkeys
- DICOM Web
- Hanging Protocols
- Managing a study's measurements
- Managing a study's DICOM metadata
- A flexible pattern for extensions
- And many others
It does this while remaining decoupled from any particular view library or rendering logic. While we use it to power our React Viewer, it can be used with Vue, React, Vanilla JS, or any number of other frameworks.
Misc. Extensions
Want to add custom logic or UI Components to the OHIF Viewer, but don't want to maintain a fork? We expose common integration points via extensions to make that possible. For a list of extensions maintained by OHIF, check out this helpful table.
If you find yourself thinking "I wish the Viewer could do X", and you can't accomplish it with an extension today, create a GitHub issue! We're actively looking for ways to improve our extensibility ^_^
Click here to read more about extensions!
Diagram
This diagram is a conceptual illustration of how the Viewer is architected.
- (optional)
extensionscan be registered withohif-core's extension manager ohif-coreprovides bussiness logic and a way forviewerto access registered extensions- The
viewercomposes and provides data to components from our component library (react-viewerbase) - The
viewercan be built and served as a stand-alone PWA, or as an embeddable package (ohif-viewer)
Common Questions
Can I create my own Viewer using Vue.js or Angular.js?
You can, but you will not be able to leverage as much of the existing code and components. ohif-core could still be used for business logic, and to provide a model for extensions. react-viewerbase would then become a guide for the components you would need to recreate.
