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 / quantitative-and-annotation-modes

Quantitative and annotation modes

Quantitative and annotation modes turn the shared viewer into a focused work area for dynamic preclinical data, PET/CT tumor-volume analysis, or ultrasound mark-up. Each mode accepts a narrow study shape, selects the panels and viewports for its task, and loads the capabilities that give the data meaning. See mode-driven workflows for the common mode lifecycle, and basic and longitudinal viewing and segmentation and microscopy modes for related workflow families.

Workflow scope

Mode definitions

The three modes serve different kinds of work. Their study rules and viewer plans are part of the product contract rather than small variations of general diagnostic viewing.

ModeMain taskRequired study shapeMain result
Preclinical 4DReview time-varying PET/CT data and study uptake over timeA matching preclinical 4D study with CT and PT dataROI segmentation and time-based analysis
TMTVMeasure total metabolic tumor volumeA PET/CT study with suitable CT and PT seriesThresholded tumor segmentation and metabolic report values
Ultrasound annotationMark pleura lines and B-lines on ultrasound framesA study with US seriesFrame-linked annotations and optional JSON export

These modes share the route and extension model. Their differences are visible in the data they accept, the panels they expose, and the hanging protocol that arranges the first view.

References: modes/…/index.tsx• L32-36 modes/…/index.ts• L150-199 modes/…/index.ts• L76-100 modes/…/index.ts• L294-300

Workflow path

Each workflow starts with a study match and ends with a task result. The mode validates the study first. Its protocol then places the source data in task-specific viewports while its panels and commands turn user actions into segmentations, statistics, or annotations.

This diagram shows the shared path and the different result types.

flowchart LR
    Study[Study and display sets] --> Match[Mode validity and protocol match]
    Match --> View[Task-specific viewer configuration]
    View --> FourD[Preclinical 4D review]
    View --> TMTV[TMTV threshold analysis]
    View --> US[Ultrasound annotation]
    FourD --> Kinetic[ROI and time-based analysis]
    TMTV --> Report[Metabolic values and report]
    US --> Export[Frame annotations and JSON]

References: modes/…/getWorkflowSettings.ts• L57-121 extensions/…/commandsModule.ts• L158-260 extensions/…/getCommandsModule.ts• L180-281

Preclinical 4D mode

Dynamic-volume review

The preclinical 4D mode is designed for time-varying PET/CT review. It gives the user synchronized volume views and controls for moving through time, so the user can check the data before measuring a region.

The mode uses the dynamic-volume route and the default4D protocol. The protocol matches reconstructable CT and PT data, then supplies PET-only views for preparation, CT/PT/fusion views for registration, fusion views for ROI work, and a chart view for kinetic analysis. The PT views use a PET color map and volume display settings that make uptake changes visible across the three main orientations.

References: modes/…/index.tsx• L14-25 modes/…/index.tsx• L171-205 extensions/…/getHangingProtocolModule.ts• L449-579

Analysis stages

The workflow moves from data preparation to registration, ROI quantification, and kinetic analysis. Each stage changes the view and the available controls without leaving the same mode.

StagePurposeViewer emphasis
Data PreparationInspect the dynamic PT data and move through framesThree orthogonal PT views with playback and frame controls
RegistrationCheck CT and PT alignmentCT, PT, and fused views in several orientations
ROI QuantificationDefine a region on the fused dataLabelmap tools and threshold-based ROI tools
Kinetic AnalysisReview the selected region over timeFused views and a time-series chart

The stage changes are coordinated by the workflow settings. ROI work creates a labelmap for the dynamic volume, and the final stage updates the chart display from that segmentation.

References: modes/…/getWorkflowSettings.ts• L57-121 modes/…/initWorkflowSteps.ts• L3-8 extensions/…/getHangingProtocolModule.ts• L579-660

Viewer configuration

The base 4D layout keeps the dynamic-volume controls and active viewport window-level panel on the left. It provides an image viewport and a chart viewport. Workflow stages replace the initial arrangement with their own protocol stage and can open the segmentation panel when ROI work starts.

The mode also prepares tool groups for PT, CT, fusion, and default viewports. Common navigation tools remain available across those groups. Threshold and brush tools become relevant to the ROI stage, while crosshair colors and synchronized orientations help the user relate the views.

References: modes/…/index.tsx• L174-205 modes/…/initToolGroups.tsx• L20-169 modes/…/getWorkflowSettings.ts• L26-55

TMTV mode

PET/CT tumor-volume analysis

The TMTV mode is designed to measure metabolically active tumor volume from PET/CT data. TMTV means total metabolic tumor volume: the volume selected by the user’s PET and CT threshold rules.

The mode accepts studies with both PT and CT and excludes whole-slide studies and the studies reserved for the preclinical 4D workflow. The PET/CT protocol favors reconstructable series and a corrected PT series when one is available. This matching is important because the threshold operation needs both source volumes and because the initial PET view depends on the available SUV scaling.

References: modes/…/index.ts• L186-199 extensions/…/getHangingProtocolModule.ts• L238-340 modes/…/index.ts• L92-121

Threshold and report flow

TMTV analysis starts with a PET/CT view and a new labelmap tied to the PT data. The user can define a percentage of maximum SUV or separate CT and PT value ranges. The mode applies those rules inside a selected ROI, calculates metabolic statistics, and exposes the values for report export.

The flow keeps the working segmentation and the report together. A report can include total metabolic tumor volume, lesion glycolysis, threshold settings, and segmentation statistics. The same analysis can also support a DICOM RT structure-set export through the TMTV extension.

References: extensions/…/ROIThresholdConfiguration.tsx• L14-165 extensions/…/commandsModule.ts• L142-235 extensions/…/commandsModule.ts• L237-260

Viewer configuration

The TMTV route uses one Cornerstone volume viewport in its base layout. The left series panel starts closed. The right side contains the TMTV segmentation panel and the PET SUV panel, so the user can inspect the study and control analysis without changing the main viewer shell.

The hanging protocol can expand this into several coordinated layouts. Its main arrangement shows CT, PT, and fusion views in axial, sagittal, and coronal orientations with a MIP view. Smaller layouts support focused fusion review or side-by-side CT and PT review. The mode configures the fusion viewport so crosshairs follow the CT display set and PET-specific tools act on the PT volume.

References: modes/…/index.ts• L124-148 extensions/…/getHangingProtocolModule.ts• L22-145 modes/…/setCrosshairsConfiguration.js• L3-31 modes/…/setFusionActiveVolume.js• L3-60

Ultrasound annotation mode

Frame annotation

The ultrasound annotation mode is designed for focused pleura and B-line review in ultrasound cine data. A pleura line marks the pleural boundary, and a B-line marks a vertical lung ultrasound finding. Both annotation types remain tied to the frame where the user draws them.

The mode is valid when the study includes US. The annotation panel lets the user switch annotation type, delete the last mark, show a depth guide, show a pleura percentage, and control the fan overlay. The panel also lists annotated frames so the user can return to a frame before export.

References: modes/…/index.ts• L294-300 extensions/…/USAnnotationPanel.tsx• L26-152 extensions/…/USAnnotationPanel.tsx• L210-240

Annotation export

The export path converts the selected ultrasound annotations into a JSON record. The record keeps the source instance, fan geometry, labels, and frame-indexed pleura and B-line coordinates together. This lets a downstream tool relate each mark to both the image frame and the ultrasound fan.

Fan geometry is a workflow dependency rather than a visual detail. The geometry provider is the place where a deployment supplies the center, angles, and radii for its ultrasound images. Without that data, fan overlays and exported geometry cannot fully describe the annotation space.

References: extensions/…/getCommandsModule.ts• L180-281 extensions/…/FanShapeGeometryProvider.ts• L3-25

Viewer configuration

The ultrasound mode uses a tracked Cornerstone viewport as its main image view. It places the ultrasound annotation panel, segmentation panel, and tracked measurements on the right. It can also show related SR, video, PDF, segmentation, parametric-map, radiotherapy, and microscopy data in their matching viewports.

The mode gives ultrasound annotation the primary interaction and keeps common image controls available around it. It uses a simplified measurement-tracking setting while active, then restores the prior application setting when the user leaves the mode. This keeps annotation review focused without changing later workflows.

References: modes/…/index.ts• L87-118 modes/…/index.ts• L302-369 modes/…/index.ts• L266-288 modes/…/initToolGroups.js• L15-100

Workflow dependencies

Data dependencies

Each mode depends on a data relationship that its viewer and analysis can use. A valid modality label alone is not enough when the task needs a matched pair of source volumes or a complete ultrasound frame description.

WorkflowData needed before the main task can work
Preclinical 4DReconstructable CT and PT volumes that the 4D protocol can place in its stages
TMTVMatched reconstructable CT and PT volumes, with usable PET scaling for SUV-based work
Ultrasound annotationUS frames plus fan geometry and frame metadata for overlay and export

These requirements explain why mode validity, protocol matching, and capability registration must change together. A mode can enter successfully and still fail to produce a useful view when its protocol cannot select the data that its panels expect.

References: extensions/…/getHangingProtocolModule.ts• L449-577 extensions/…/getHangingProtocolModule.ts• L238-338 extensions/…/getCommandsModule.ts• L245-260

Capability dependencies

The mode package manifests define the capability boundary for each workflow. Preclinical 4D requires the shared viewer, Cornerstone, DICOM segmentation, dynamic-volume, default, and TMTV capabilities. TMTV requires the shared viewer, Cornerstone, DICOM SR, default viewing, PDF, video, measurement tracking, TMTV analysis, and the basic mode. Ultrasound annotation directly brings Cornerstone core and tools, the shared core, DICOM SR, and the pleura and B-line extension.

The preclinical 4D and TMTV manifests declare these host-supplied capabilities as peer dependencies. The ultrasound package declares its viewer and annotation capabilities as direct runtime dependencies. The manifests also keep each mode's package boundary explicit: the 4D and TMTV modes rely on the host to supply their shared extensions, while the ultrasound mode carries its core viewer and annotation packages with the mode. This boundary lets each mode provide the panels, viewports, commands, and display services that its workflow names.

The three mode packages now use release 3.14.0-beta.101. This is a package release alignment change; it does not change the workflow roles or the capability relationships described above.

If a package omits a required capability, the route can open without a required panel or command. It can also fail to place the display set that the task needs. Package dependencies therefore belong to the workflow contract rather than only to build setup.

References: modes/…/package.json• L1-39 modes/…/package.json• L1-44 modes/…/package.json• L1-37

Change checklist

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

  • When a 4D stage ID or viewport ID changes, update both the workflow stage settings and the default4D protocol stage or display-set references.
  • When CT or PT matching rules change, check the mode validity rule, fusion viewports, threshold commands, and PET window-level behavior as one contract.
  • When TMTV threshold fields or report metrics change, keep the panel labels, threshold action, calculated statistics, and exported report rows aligned.
  • When ultrasound annotation types or JSON fields change, update the panel actions, command definitions, frame grouping, and downstream export names together.
  • When ultrasound fan geometry changes, check both the overlay provider and every exported geometry field.
  • When a mode changes its panels or tool groups, check the matching extension dependency and the mode-exit cleanup for shared viewer state.
  • When a mode package adds or removes a peer or runtime dependency, check that every named panel, viewport, command, and display service is still registered at runtime.
  • When a mode package version changes, keep the related mode packages and any release metadata aligned without changing the capability contract by accident.

Important failure modes

TriggerConsequenceGuard
A 4D study lacks a reconstructable CT or PT display setRegistration, ROI work, or kinetic analysis has missing viewportsKeep the 4D protocol selectors aligned with the studies accepted by the mode
A 4D workflow stage is renamed in only one placeThe stage can show the wrong layout or fail to match a protocol stageTreat workflow settings and default4D stages as one contract
TMTV has no matched CT and PT volumesThreshold segmentation and metabolic statistics cannot runRequire both source modalities before enabling the TMTV workflow
The TMTV fusion match is incompleteCrosshairs or measurement tools use the wrong active volumeCheck the CT and PT display-set matches before applying fusion configuration
PET scaling or SUV data is unavailableSUV-based display or threshold interpretation is not reliableConfirm the selected PT series and its scaling metadata before analysis
Ultrasound fan geometry is missingFan overlays and exported spatial fields are incompleteProvide geometry for each supported image type or handle the missing state explicitly
A mode leaves shared tools or application settings activeThe next workflow inherits stale controls or measurement behaviorPair every mode-entry change with mode-exit restoration and service cleanup
A mode package omits a required peer or runtime capabilityThe route can load without a required panel or commandKeep package dependencies aligned with the mode's registered services

Key files

FileWhy to read it
modes/…/index.tsxDefines the preclinical 4D route, dependency set, layout, validity rule, and lifecycle.
modes/…/getWorkflowSettings.tsShows the user-facing 4D stages and how each stage changes the task.
extensions/…/getHangingProtocolModule.tsShows the 4D CT, PT, fusion, chart, and stage view plan.
modes/…/index.tsDefines TMTV study rules, layout, dependency set, and fusion setup.
extensions/…/getHangingProtocolModule.tsShows the coordinated PET/CT and fusion viewer layouts.
extensions/…/ROIThresholdConfiguration.tsxShows the user choices for SUV and CT/PT thresholding.
extensions/…/commandsModule.tsShows how thresholded segmentations become statistics and report output.
modes/…/index.tsDefines ultrasound validity, panels, viewports, controls, and lifecycle behavior.
extensions/…/USAnnotationPanel.tsxShows the annotation review controls and annotated-frame navigation.
extensions/…/getCommandsModule.tsShows annotation switching, overlay control, and JSON export.
extensions/…/FanShapeGeometryProvider.tsShows the data boundary for ultrasound fan geometry.
modes/…/package.jsonDefines the host capabilities and release version that the preclinical 4D mode expects.
modes/…/package.jsonDefines the host capabilities and release version required by TMTV.
modes/…/package.jsonDefines the runtime capabilities and release version required by the ultrasound workflow.