Introducing a new way to review your PRs.

Read the announcement

ohif / viewers

OHIF zero-footprint DICOM viewer and oncology specific Lesion Tracker, plus shared extension packages

View on GitHub

21 documents · Updated Nov 23, 2026

docs / default-extension-capabilities

Default extension capabilities

The default extension provides the shared viewer foundation for standard modes. It joins study browsing, image display, layout, toolbar actions, DICOM data access, and common viewer services so each mode can focus on its own workflow. It is the baseline described by the extension ecosystem; basic and longitudinal viewing uses this foundation, while specialized modality extensions add modality-specific behavior.

Viewer composition

Work list

The work list is the standard study-list experience. It helps a user find a study, inspect its series, and open the right viewer workflow. A deployment can change the list style, preview mode, columns, and launch action without replacing the study-list flow.

When a source cannot provide thumbnails, the work list uses a list preview instead. This keeps study selection usable across different data sources.

References: extensions/…/workListCustomization.ts• L4-20 extensions/…/workListCustomization.ts• L22-46 extensions/…/workListCustomization.ts• L47-88 extensions/…/workListCustomization.ts• L90-106

Viewer layout

The viewer layout combines the header, side panels, and viewport grid into one working area. Standard modes can show a study browser beside the image view and add panels for measurements or segmentations. The layout can resize or close panels while the viewport grid remains the main image area.

References: extensions/…/getLayoutTemplateModule.js• L1-27 extensions/…/index.tsx• L13-30 extensions/…/index.tsx• L149-220 modes/…/index.tsx• L256-301

Viewer header

The viewer header gives standard modes a stable place for navigation, patient context, and viewer actions. It can provide a return action, preference and about views, appearance controls, and logout when the application supplies them.

The header also has an ordered right-side area. Undo and redo controls appear with patient information by default. Sites can reorder or remove these items without replacing the rest of the header.

References: extensions/…/ViewerHeader.tsx• L11-35 extensions/…/ViewerHeader.tsx• L40-115 extensions/…/HeaderUndoRedo.tsx• L7-43 extensions/…/HeaderPatientInfo.tsx• L6-11 extensions/…/headerRightSideCustomization.ts• L4-18 extensions/…/hideHeaderUndoRedoCustomization.ts• L3-21 extensions/…/package.json• L1-11

Study browser

The study browser is the standard panel for finding studies and series in the active data source. It groups content into study views, shows thumbnails or no-image markers, and lets a user open or add a display set to the active viewport. A display set is the viewer's unit for a series or another grouped DICOM result.

Users can switch between thumbnail and list views, sort series by series number or date, open the DICOM tag browser, and add a display set as a viewport layer. The default settings action opens the series sort and filter controls. Series without a number or date sort first, and equal sort values keep the browser's normal order. Double-clicking applies the selected display set through the active hanging protocol, so the mode keeps control of its layout rules. If that update fails, the browser reports the error instead of silently changing the viewport.

References: extensions/…/getPanelModule.tsx• L10-26 extensions/…/PanelStudyBrowser.tsx• L34-71 extensions/…/PanelStudyBrowser.tsx• L126-156 extensions/…/PanelStudyBrowser.tsx• L395-500 extensions/…/PanelStudyBrowserHeader.tsx• L13-79 extensions/…/actionIcons.ts• L3-10 extensions/…/actionIcon.ts• L1-7 extensions/…/studyBrowserCustomization.ts• L24-95 extensions/…/studyBrowserCustomization.test.ts• L7-68

Thumbnail details

Thumbnail details give a short summary below each series description. The default line shows the series number and image or frame count. Standard modes can add values from the display set or shown instance when those values apply to the display-set type.

References: extensions/…/PanelStudyBrowser.tsx• L77-109 extensions/…/resolveThumbnailDetails.ts• L35-53 extensions/…/thumbnailDetailsCustomization.ts• L15-40 extensions/…/thumbnailDetailsCustomization.ts• L48-91

Viewport types

The default extension supplies the chart viewport and the standard viewer layout. Standard modes combine it with viewport providers from other extensions for stacks, volumes, reports, segmentations, PDF files, video, and other content. This lets one study browser and layout host many content types without making the default extension own every renderer.

References: extensions/…/getViewportModule.tsx• L1-10 modes/…/index.tsx• L23-79 modes/…/index.tsx• L269-299

Toolbar actions

Toolbar structure

The default extension supplies the toolbar shell, tool rows, groups, layout selector, progress display, and state updates. Standard modes add the Cornerstone capability pack for the usual image-viewing actions. A capability can therefore exist without being visible or enabled when the active viewport cannot use it.

References: extensions/…/getToolbarModule.tsx• L1-62 extensions/…/init.ts• L32-40 modes/…/index.tsx• L313-372 extensions/…/toolbarButtonsCustomization.ts• L713-804

Image interaction

Standard modes support the main actions for image review. These include zoom, pan, window and level, reset, rotate, flip, invert, stack scroll, cine playback, and slice synchronization. The toolbar also supports reference lines, image overlays, probe tools, and DICOM tag browsing when the active viewport supports them.

References: extensions/…/toolbarButtonsCustomization.ts• L185-349 extensions/…/toolbarButtonsCustomization.ts• L763-783 extensions/…/getToolbarModule.tsx• L258-360

Measurement and annotation

The baseline tool set supports common measurements and annotations. It covers length, bidirectional measurement, angles, Cobb angle, arrows, circle and rectangle regions, ellipse regions, freehand regions, spline regions, and livewire contours. These results use the shared measurement system and can be extended by a mode or site customization.

References: extensions/…/initToolGroups.ts• L20-85 extensions/…/toolbarButtonsCustomization.ts• L351-565 extensions/…/defaultContextMenuCustomization.ts• L1-21

Viewport controls

The toolbar includes controls for orientation, overlays, window and level, manual VOI, threshold, opacity, color bars, and advanced rendering. Each control follows the content in the active viewport. For example, orientation needs reconstructable data, while threshold and opacity need volume content or multiple overlayable display sets.

References: extensions/…/toolbarButtonsCustomization.ts• L89-183 extensions/…/toolbarButtonsCustomization.ts• L718-749 extensions/…/getToolbarModule.tsx• L175-360

Layout actions

The layout selector changes the viewport grid and can enlarge the active viewport for one-up review. It offers common grid layouts, advanced hanging-protocol layouts, and custom row-and-column grids. Sites can replace the preset sets while keeping the same layout controls.

References: extensions/…/commandsModule.ts• L382-489 extensions/…/commandsModule.ts• L548-684 extensions/…/ToolbarLayoutSelector.tsx• L18-125 extensions/…/ToolbarLayoutSelector.tsx• L127-187

Data-source integrations

DICOMweb source

The DICOMweb source connects standard modes to remote DICOM services. It supports study, series, and instance queries, image and metadata retrieval, thumbnails or rendered images, bulk data, and DICOM object storage. It applies the current authentication service to requests and can load study data lazily when configured.

The source accepts separate query, retrieve, and store roots, with fallback between roots when a deployment supplies only some of them. It also normalizes relative bulk-data links and can prefetch a multiframe instance so later frame loads can use the locally registered object.

References: extensions/…/getDataSourcesModule.js• L14-41 extensions/…/index.ts• L39-116 extensions/…/index.ts• L138-175 extensions/…/index.ts• L246-274 extensions/…/index.ts• L364-455 extensions/…/qido.js• L139-215 extensions/…/fixBulkDataURI.ts• L1-76

Data-source configuration

The default extension can expose the active source's settings through a common source control. The control reads the contract provided by that source and opens its source-specific setup view. It clears old settings when the active source changes and asks for setup when the current configuration is incomplete.

References: extensions/…/DataSourceConfigurationComponent.tsx• L18-77 extensions/…/DataSourceConfigurationComponent.tsx• L79-139

Proxy source

The DICOMweb proxy source resolves a remote server configuration from a URL before standard modes use it. It keeps the same query, retrieve, and store contract as the direct DICOMweb source, so proxied access follows the same viewer flow.

References: extensions/…/index.ts• L5-39 extensions/…/index.ts• L40-87

JSON source

The DICOM JSON source opens studies described by a JSON document. It maps the document into the viewer metadata model and builds image links from its URLs. This source fits prepared or static study descriptions rather than a full query-and-store service.

References: extensions/…/index.js• L63-120 extensions/…/index.js• L121-161 extensions/…/index.js• L179-253

Local source

The local source exposes DICOM objects already held in the browser's metadata store. It supports local study and series lookup, image and multiframe access, thumbnails, and local report output. It does not provide the remote query and store behavior of DICOMweb.

References: extensions/…/index.js• L49-118 extensions/…/index.js• L119-189 extensions/…/index.js• L190-270

Merged source

The merged source presents several configured sources as one source for study and series discovery. It removes duplicate results and remembers which source owns each series so later image retrieval uses the right source. Store actions use the configured default source.

References: extensions/…/getDataSourcesModule.js• L14-41 extensions/…/index.ts• L13-28 extensions/…/index.ts• L40-82 extensions/…/index.ts• L169-316

Display-set and protocol behavior

Standard image handling

The default image handler turns supported image series into display sets that can appear as stacks. It separates multiframe content and single-image modalities when needed, and it marks unsupported series so the study browser can explain why they cannot be viewed.

The same image model carries reconstructability, dynamic-volume information, frame counts, thumbnails, and the image-loading identity. This gives standard layouts enough information to choose image controls without owning each image format.

References: extensions/…/getSopClassHandlerModule.js• L19-48 extensions/…/getSopClassHandlerModule.js• L60-118 extensions/…/makeImageSetDisplaySet.ts• L118-197 extensions/…/stackSopClassUids.ts• L5-60 extensions/…/getDisplaySetsFromUnsupportedSeries.js• L4-62

Chart data handling

The default extension recognizes chart data and exposes each chart result as a derived display set. Chart content can therefore use the same study browser and sorting flow as other display sets, while the chart viewport provides its visual form.

Chart display sets can represent a sequence of revisions as one viewer item. The active or latest revision supplies the displayed date and other summary values, so a later result updates the existing item instead of creating a separate visual entry.

References: extensions/…/chartSOPClassHandler.ts• L7-14 extensions/…/chartSOPClassHandler.ts• L20-87 extensions/…/chartSOPClassHandler.ts• L99-127

Metadata-driven display-set splitting

Metadata-driven display-set splitting is an optional path that groups instances by shared data rules before the viewer creates display sets. Standard modes can enable it through customization when a series must become several meaningful viewer items, such as separate image sizes, diffusion values, or regular volume groups.

The default rules use a shared metadata context and rule order. Their data-only form can also be applied by a server, which keeps client-side and server-side grouping aligned. The URL module checks apply the same required modules, update rules, and optional rules on both sides. Image groups use the common stack behavior, while a named handler can pass the group to a modality or content-specific extension.

References: extensions/…/metadataDisplaySetCustomization.ts• L7-54 extensions/…/metadataContextCustomization.ts• L4-27 extensions/…/makeDisplaySetFromInstanceGroup.ts• L134-153 extensions/…/makeImageSetDisplaySet.ts• L181-197 extensions/…/getCustomizationModule.tsx• L48-56 extensions/…/urlSplitModules.test.ts• L19-115 extensions/…/urlSplitModules.test.ts• L147-163

Hanging protocols

A hanging protocol is a set of rules that chooses display sets and places them in viewports. The default extension provides a one-up stack protocol and makes grid comparison, current-versus-prior comparison, scale presets, and mammography layouts available to standard modes.

The multi-view grid protocols also treat image, ECG, whole-slide, and PDF display sets as viewable content. They choose a stage from the content that matches the study, support grids up to 4 by 2, and preserve a user's selected display set when the stage changes. Sites can change the grid protocols through named hanging-protocol customizations.

These protocols let a mode choose a useful layout from the study content instead of placing every series by hand. The basic mode selects the default protocol for its route, while other protocols can be selected when the study and mode support them.

References: extensions/…/getHangingProtocolModule.js• L6-73 extensions/…/getHangingProtocolModule.js• L124-152 extensions/…/hpMNGrid.ts• L21-45 extensions/…/hpMNGrid.ts• L59-231 extensions/…/hpMNGrid.ts• L241-417 extensions/…/hangingProtocolsCustomization.ts• L1-15 extensions/…/seriesSelectors.ts• L24-62 extensions/…/registerHangingProtocolAttributes.ts• L5-13 modes/…/index.tsx• L360-371

Layout state reuse

Layout state reuse remembers the active hanging-protocol stage, viewport shape, and display-set choices for a study and protocol. When a user returns to that context, the viewer can restore the prior arrangement instead of rebuilding it only from the protocol defaults.

The cached state includes custom grid layouts and the selected display set for each protocol selector. This preserves user choices when a protocol moves between stages with different viewport counts.

References: extensions/…/reuseCachedLayouts.ts• L12-20 extensions/…/reuseCachedLayouts.ts• L28-49 extensions/…/reuseCachedLayouts.ts• L51-89 extensions/…/hpMNGrid.test.ts• L78-95

Viewport layers

Standard modes can place more than one display set in a viewport when the content can be combined. The default commands check whether a layer is allowed and update the protocol viewport. They also remove derived overlays when a layer is removed, which keeps the layout state consistent.

References: extensions/…/commandsModule.ts• L63-131 extensions/…/commandsModule.ts• L133-204 extensions/…/commandsModule.ts• L714-775

Scaling metadata

The default extension adds display-time scaling information for PET and RT Dose data. This lets viewer controls use SUV or dose values without changing the source data. Invalid scaling data does not stop the normal image flow.

References: extensions/…/init.ts• L42-50 extensions/…/init.ts• L101-169

Common viewer services

User preferences

The user preferences view gives standard modes one place to change language, keyboard shortcuts, and the modifier used with MPR crosshairs when available. Users can save, cancel, or reset these settings. A language change reloads the page so all interface text uses the new language.

References: extensions/…/userPreferencesCustomization.tsx• L94-135 extensions/…/userPreferencesCustomization.tsx• L154-170 extensions/…/userPreferencesCustomization.tsx• L208-235 extensions/…/userPreferencesCustomization.tsx• L237-335

Report and object actions

Common commands can save a report through a selected data source, download a DICOM object, copy a DICOM object to the clipboard, and load a study into the active viewer. Report saving can use the current series, create a new series, or replace another loaded series of the same type.

These actions connect user work to the data-source store contract. Locally created objects remain available for immediate viewing, and remote storage refreshes study metadata so later discovery can include the new object.

References: extensions/…/commandsModule.ts• L272-296 extensions/…/commandsModule.ts• L830-899 extensions/…/createReportDialogPrompt.tsx• L25-49 extensions/…/createReportDialogPrompt.tsx• L50-127 extensions/…/reportDialogCustomization.tsx• L49-84 extensions/…/reportDialogCustomization.tsx• L161-244 extensions/…/reportDialogCustomization.tsx• L305-365 extensions/…/promptSaveReport.tsx• L29-81

Stored object continuity

Stored DICOM objects remain usable in the viewer without a second fetch. The default extension links each stored instance to its image identity and DICOM UIDs before it enters the metadata store. This link lets a later report save continue the series that produced the object when the data source provides a usable image path.

References: extensions/…/commandsModule.ts• L872-899 extensions/…/registerStoredInstanceImageId.ts• L7-21 extensions/…/registerStoredInstanceImageId.ts• L23-60 extensions/…/retrieveStudyMetadata.js• L81-103

Context menus and notifications

The default extension provides shared context-menu and notification commands. Its default measurement menu lets a user delete a measurement or add a label. Applications can extend these menus through customization without changing the viewer layout.

References: extensions/…/commandsModule.ts• L257-306 extensions/…/defaultContextMenuCustomization.ts• L1-21 extensions/…/getCustomizationModule.tsx• L76-105

Mode lifecycle

Standard modes use the default extension to reset shared viewer state when a mode ends. The reset covers layout, UI state, display-set selection, hanging-protocol state, and locally generated objects. Startup also connects toolbar updates to cine and hotkey events and registers metadata used by hanging protocols.

References: extensions/…/index.ts• L43-80 extensions/…/init.ts• L16-99 modes/…/index.tsx• L185-254

Change checklist

When these files or sections are changed, remember to consider these:

  • Keep standard mode panel and viewport module IDs aligned with the modules registered by the default and Cornerstone extensions.
  • Keep toolbar capability IDs aligned with toolbar section membership. A button without a section is not part of the standard toolbar.
  • Keep data-source methods aligned with the shared query, retrieve, image-ID, and store contract. The merged source can expose a missing method only when a mode uses that path.
  • Keep deferred DICOMweb bulk-data retrieval tied to the current authentication state.
  • Keep bulk-data URI transforms, prefix replacement, and relative resolution aligned with the server's returned paths.
  • Keep general SOP handler order aligned with specialized handlers so common image handling does not claim content owned by another extension.
  • Keep split-rule handler names aligned with the handlerNames declared by the owning SOP class handler.
  • Keep metadata context lists and display-set rule order aligned between browser customizations and server-applied split modules. Validate every URL split module with the same standard update commands and required-module order.
  • Keep hanging-protocol selectors aligned with display-set attributes. Preserve valid content with zero image frames and numeric values supplied as text.
  • Keep cached layout selector keys aligned with hanging-protocol stage and viewport identifiers.
  • Keep PET and RT Dose scaling metadata available before dependent controls process metadata events.
  • Keep the peer dependency and Node engine contract aligned with the viewer services used by the extension. This includes react-window for study-browser list rendering and compatible React and viewer package versions.
  • Keep header-right customization items as prop-free component types and preserve site-added items when filtering defaults.
  • Keep report destination data aligned with the series identity used by stored display sets. A missing predecessor image ID changes a follow-up save from extending a series to creating a new one.
  • Keep work-list preview behavior aligned with source thumbnail support. A source without thumbnails must not leave the preview in an unusable image mode.
  • Keep work-list launch commands aligned with registered applicable workflows.
  • Keep active-source configuration items aligned with the active source. Clear old items before loading the new source's settings.
  • Keep study-browser action IDs aligned with the controls that consume them. Preserve tooltip labels when adding or replacing an action icon.
  • Keep study-browser sort labels aligned with their sort functions. Preserve the rule that missing values sort first and equal values return control to the browser's default order.
  • Keep the package runtime contract aligned with the host application. The default extension now requires Node.js 24 or newer and the declared peer versions must remain compatible with the standard viewer stack.

Important failure modes

TriggerConsequenceGuard
A mode uses a panel or viewport module from an undeclared extensionThe layout cannot resolve the componentRegister the extension dependency and use the exact module reference
A toolbar section names a missing button or omits the Cornerstone capability packThe expected action is absentKeep capability IDs and mode composition aligned
A DICOMweb source lacks a usable query or retrieve rootStudy discovery or image loading failsProvide the required roots or use a complete local or JSON source
A DICOMweb server returns a relative bulk-data path that the configured resolution does not matchMetadata values that need bulk data cannot loadSet the matching relative resolution or transform the returned path
A series cannot form a valid image display setThe browser marks it as unsupported and content controls stay disabledUse a compatible handler or a specialized extension
A merged source loses the owner of a seriesLater retrieval can use the wrong sourcePreserve the source marker during merge operations
A split rule raises an error while grouping a studyDisplay-set creation stops instead of falling back to the legacy handler pathValidate the rule and its metadata context before enabling the split path
A client or server applies different URL split modules or rule updatesThe viewer and server create different display setsRun the parity checks and keep module dependencies and update commands aligned
A hanging protocol does not match the study display setsThe requested layout cannot be appliedUse a protocol whose selectors match the study or use the default protocol
A cached layout selector points to a display set no longer presentA restored stage can leave a viewport empty or select the wrong contentRebuild or clear cached state when display-set identity changes
A stored instance has no usable image identityA later report save cannot continue its seriesPreserve the data source image path or local image URL
A source changes while old configuration items remain visibleThe user sees settings for another serverClear old items before loading the new source configuration
The host uses Node.js below version 24The package runtime contract is not met and the extension may fail to run or buildRun the extension in Node.js 24 or newer

Key files

FileWhy to read it
extensions/…/index.tsShows the capability surface registered by the default extension
extensions/…/package.jsonDefines the package purpose, Node engine, and peer runtime contract for basic image viewing
extensions/…/getPanelModule.tsxShows the baseline study browser panel
extensions/…/PanelStudyBrowser.tsxShows how studies, display sets, thumbnails, and browser actions reach the panel
extensions/…/PanelStudyBrowserHeader.tsxShows the study-browser settings action, view controls, and tooltips
extensions/…/studyBrowserCustomization.tsShows the default study-browser menus, sort choices, view presets, and double-click behavior
extensions/…/workListCustomization.tsShows the study-list preview and workflow launch contract
extensions/…/getDataSourcesModule.jsShows the data-source types available to standard modes
extensions/…/DataSourceConfigurationComponent.tsxShows how the active source exposes its setup contract
extensions/…/index.tsShows the DICOMweb query, retrieval, bulk-data, and storage contract
extensions/…/index.tsShows how several configured sources appear as one source
extensions/…/getSopClassHandlerModule.jsShows how common image, chart, and unsupported series become display sets
extensions/…/makeDisplaySetFromInstanceGroup.tsShows the common viewer bridge for metadata-driven display-set groups
extensions/…/metadataDisplaySetCustomization.tsShows how metadata-driven display-set splitting is enabled and customized
extensions/…/urlSplitModules.test.tsShows that URL split modules keep server and viewer grouping rules aligned
extensions/…/commandsModule.tsShows shared actions for layouts, protocols, layers, storage, and navigation
extensions/…/ViewerHeader.tsxShows the standard header and its customization area
extensions/…/ToolbarLayoutSelector.tsxShows the common, advanced, and custom layout choices
extensions/…/userPreferencesCustomization.tsxShows the baseline language, hotkey, and crosshair preferences
extensions/…/reportDialogCustomization.tsxShows report destination and series description behavior
extensions/…/hpMNGrid.tsShows the standard content-aware grid stages
extensions/…/reuseCachedLayouts.tsShows how selected layouts and display sets are remembered
extensions/…/chartSOPClassHandler.tsShows how chart results enter the common display-set flow
modes/…/index.tsxShows how a standard mode composes the default extension with other extensions
extensions/…/toolbarButtonsCustomization.tsShows the standard image-viewing action set used by basic modes