Structured reports and measurements
Structured reports and measurements connect image findings to a shared OHIF record and to DICOM Structured Report (SR) data. The Cornerstone SR extension provides report exchange and report views. The measurement-tracking extension links those reports to tracked findings in viewer tools, panels, and navigation.
Measurement model
Shared measurement records
The measurement service is the common state for findings that appear in tools, panels, navigation, and reports. A measurement record keeps its value and geometry with the study, series, image, frame, and display-set references needed to show the finding again.
Cornerstone remains the drawing surface. The service keeps a source identity and mappings for each tool family so that a tool annotation can become a measurement record and a record can become an annotation again. This separation also allows report data to enter the same path without first being drawn by a user.
References: platform/…/MeasurementService.ts• L15-31 platform/…/MeasurementService.ts• L107-117 platform/…/MeasurementService.ts• L482-577
Annotation mappings
An annotation mapping defines how a tool's shape and metadata match the shared measurement form. The Cornerstone extension registers mappings for the main length, angle, region, probe, freehand, contour, and ultrasound tools.
When a tool adds or changes an annotation, the mapping updates the matching measurement. When a panel or report workflow changes a measurement, the reverse mapping updates the annotation. The shared identifier is what keeps the drawing and the record aligned.
References: extensions/…/initMeasurementService.ts• L22-63 extensions/…/initMeasurementService.ts• L77-107 extensions/…/initMeasurementService.ts• L202-282 extensions/…/initMeasurementService.ts• L407-455
Tracking workflow
Tracked series
A tracked series is a series whose measurements belong to the current reporting work. The measurement-tracking extension holds the series identifiers and publishes changes so the measurement panel, toolbar, and viewport status stay in step. It works with the DICOM SR extension when the tracked findings must become report data.
The tracking context also keeps the active study, ignored series, and whether the report has unsaved changes. It coordinates display-set loading, viewport changes, SR hydration prompts, and commands that restore or clear tracked series. It changes state when the user starts tracking, adds another series, moves to another study, removes tracking, saves a report, or restores an SR.
References: extensions/…/package.json• L30-47 extensions/…/TrackedMeasurementsService.ts• L3-9 extensions/…/TrackedMeasurementsService.ts• L31-65 extensions/…/TrackedMeasurementsContext.tsx• L38-51 extensions/…/TrackedMeasurementsContext.tsx• L282-393 extensions/…/measurementTrackingMachine.js• L13-28 extensions/…/measurementTrackingMachine.js• L105-177
Tracking decisions
The first annotation on a series can start tracking or remain temporary. A temporary measurement stays in the image view but does not become part of the tracked report set. When tracking is active, a new series or study causes a new decision so the user does not mix findings by accident.
The state machine marks work as dirty when a new tracked finding or tracking change can lose report data. It treats SR restoration as clean because the restored findings already represent saved report data. Before a destructive action in simplified tracking mode, the workflow can ask the user to save the current report.
This diagram shows how a finding moves from an image tool to tracked state or to a temporary state.
flowchart LR
A[User draws annotation] --> B{Track this series?}
B -->|No| C[Temporary annotation]
B -->|Yes| D[Tracked series]
D --> E[Measurement record]
E --> F[Measurement panel]
E --> G[Save as DICOM SR]
References: extensions/…/measurementTrackingMachine.js• L43-103 extensions/…/measurementTrackingMachine.js• L179-239 extensions/…/measurementTrackingMachine.js• L466-530 platform/…/measurement-tracking.md• L27-35
Tracked viewport behavior
The tracked viewport connects the shared measurement service to the active Cornerstone viewport. It marks a viewport as tracked when its series is in the tracking context, uses a distinct annotation style for tracked and untracked series, and provides controls to move between measurements in the active display set.
Measurement-added events are handled once through the active viewport. The viewport then marks the work as dirty and sends the series and measurement identity to the tracking state machine. This keeps drawing activity, report state, and navigation in one flow without making the drawing viewport responsible for report storage.
References: extensions/…/TrackedCornerstoneViewport.tsx• L11-26 extensions/…/TrackedCornerstoneViewport.tsx• L28-106 extensions/…/TrackedCornerstoneViewport.tsx• L108-154 extensions/…/TrackedCornerstoneViewport.tsx• L198-248
Measurement panel
The tracking panel shows measurements for the active tracked study and its tracked series. It gives the user a place to review findings, remove tracking, and start report creation without coupling the panel to a particular drawing tool.
The panel uses measurement events and tracking events to refresh its view. The study browser receives the active data source and image and display-set helpers so it can keep study navigation connected to the same tracking workflow.
References: extensions/…/PanelMeasurementTableTracking.tsx• L18-44 extensions/…/PanelMeasurementTableTracking.tsx• L58-107 extensions/…/index.tsx• L22-43 platform/…/MeasurementService.ts• L71-83 extensions/…/index.tsx• L32-42
Structured-report exchange
Report creation
Report creation turns the selected tracked measurement records into a DICOM SR instance. The save workflow filters records by the tracked study and series, asks for report details and a destination, and then sends the generated report to a download path or to the configured data source.
The report generator converts the matching Cornerstone annotation state into the DICOM SR form. SR-specific display variants are mapped to the base tool types expected by the DICOM adapter, while their finding labels remain part of the report content. The SR command rejects a report with no imaging content or no SOP class, then applies the store boundary and returns the generated report data. The tracking workflow uses the save result to clear or replace the working annotations according to the user's save choice.
References: extensions/…/promptSaveReport.tsx• L10-29 extensions/…/promptSaveReport.tsx• L31-77 extensions/…/generateReport.ts• L22-55 extensions/…/getFilteredCornerstoneToolState.ts• L4-10 extensions/…/getFilteredCornerstoneToolState.ts• L28-61 extensions/…/commandsModule.ts• L21-45 extensions/…/commandsModule.ts• L81-145 extensions/…/createReportAsync.tsx• L5-42
Report display sets
The DICOM SR handler turns supported SR instances into derived display sets. It accepts common text and imaging measurement SR classes, including 3D imaging reports and X-Ray Radiation Dose SR reports, and keeps the newest instance as the active report version. For an imaging measurement report, it records the report's referenced images and measurement groups. Dose reports remain in the structured text report path rather than entering measurement hydration.
The handler treats an SR as an imaging measurement report only when its report body is present. An empty report is surfaced as a display-set problem instead of entering the measurement path. A report with content that does not match the supported measurement mappings can still be viewed, but it cannot restore those findings as editable viewer measurements.
The handler can attach report measurements after their source display sets arrive. It matches 2D findings to known source image identifiers and 3D findings to a source display set with the right frame of reference. Derived or overlay display sets are not source targets, and unknown image identifiers do not block other valid source images. This keeps report loading independent from the order in which the report and its referenced image series become available.
The SR viewport uses the report type selected by the display set. Imaging measurement reports use the measurement view. Other SR reports use the text view, where nested containers and their content remain readable as a structured report.
References: extensions/…/package.json• L32-46 extensions/…/getSopClassHandlerModule.ts• L41-47 extensions/…/getSopClassHandlerModule.ts• L125-169 extensions/…/getSopClassHandlerModule.ts• L212-267 extensions/…/getSopClassHandlerModule.ts• L276-383 extensions/…/getSopClassHandlerModule.ts• L464-564 extensions/…/getSopClassHandlerModule.test.ts• L169-190 extensions/…/OHIFCornerstoneSRViewport.tsx• L7-15 extensions/…/OHIFCornerstoneSRContainer.tsx• L10-43 extensions/…/OHIFCornerstoneSRContainer.tsx• L47-59
SR viewport state
The SR tool state keeps the report findings that belong to each active viewport. This prevents the same report annotation from appearing in a viewport that shows the same image but is not the report's selected view.
The SR display tools use report-specific variants when a finding needs a report label instead of live image statistics. Point findings use a cross marker and rectangle findings show their semantic label, while export maps these variants back to the base tool types required by DICOM SR. This keeps report annotations visually distinct without changing the normal viewer tools.
Viewport state is read defensively during display-set changes. If a viewport has already been disabled, report selection returns no active identifiers instead of failing while the old view is being removed.
References: extensions/…/dicomSRModule.js• L3-18 extensions/…/dicomSRModule.js• L20-76 extensions/…/init.ts• L16-52 extensions/…/SRPointTool.ts• L17-20 extensions/…/SRPointTool.ts• L63-111 extensions/…/srToolGetTextLines.ts• L1-23 extensions/…/getFilteredCornerstoneToolState.ts• L4-8
Report hydration
Hydration is the process that converts supported SR measurement groups into the shared measurement service and Cornerstone annotation state. It reads the report geometry, labels, findings, and references, then adds each supported finding with a new viewer annotation identity.
Two-dimensional findings use a referenced SOP instance and frame to locate an image. Three-dimensional findings use a frame of reference and a suitable source display set. The loader can attach findings when matching source display sets become available. After hydration, the tracking context marks the referenced study and series as tracked and can return the active viewport to the restored finding.
This diagram shows the path from stored SR content back to a tracked image finding.
flowchart LR
A[DICOM SR display set] --> B[Read measurement groups]
B --> C{Supported mapping?}
C -->|No| D[View report without hydration]
C -->|Yes| E[Resolve image or frame of reference]
E --> F[Add shared measurement]
F --> G[Create Cornerstone annotation]
G --> H[Track referenced series]
H --> I[Jump to restored finding]
References: extensions/…/hydrateStructuredReport.ts• L40-67 extensions/…/hydrateStructuredReport.ts• L91-137 extensions/…/hydrateStructuredReport.ts• L201-263 extensions/…/hydrateStructuredReport.tsx• L3-27 extensions/…/TrackedMeasurementsContext.tsx• L304-363 extensions/…/measurementTrackingMachine.js• L281-321
Report viewing
Before hydration, an imaging SR can act as a report-driven view. The SR measurement viewport selects one report finding, creates a view from its referenced image, and shows the finding with its tracking identifiers. This gives the user a way to review the report even when the report is not part of the active tracked measurement state.
When an SR is loaded into an already tracked series, its findings are treated as read-only report content. The user can inspect the report and draw temporary findings, but the saved SR finding is not changed by normal viewer editing.
References: extensions/…/OHIFCornerstoneSRMeasurementViewport.tsx• L23-51 extensions/…/OHIFCornerstoneSRMeasurementViewport.tsx• L64-135 extensions/…/OHIFCornerstoneSRMeasurementViewport.tsx• L233-275 platform/…/measurement-tracking.md• L105-113
Measurement navigation
Reference resolution
Every report-capable measurement carries enough image context to move from a panel row or restored finding back to the source view. The navigation path uses the display-set reference and the image or frame reference to choose the image position.
For an image-based finding, the active viewport can switch to the referenced display set and image index. For a volume-based finding, the system uses the frame of reference and a matching source volume so the annotation appears in the correct spatial context.
References: extensions/…/TrackedMeasurementsContext.tsx• L56-101 extensions/…/TrackedMeasurementsContext.tsx• L103-137 extensions/…/hydrateStructuredReport.ts• L139-169 extensions/…/hydrateStructuredReport.ts• L343-402
Referenced image views
An SR measurement view may need a small image display set made from the images referenced by the report. This view is a derived browsing aid. It does not replace the source series or change the report data.
The same references support report review and later hydration. If a report points to an image that is not available in the current study data, the viewer cannot place the finding in its source view.
References: extensions/…/createReferencedImageDisplaySet.ts• L14-39 extensions/…/createReferencedImageDisplaySet.ts• L42-92 extensions/…/OHIFCornerstoneSRMeasurementViewport.tsx• L241-257
Related pages
- Cornerstone imaging integration explains the service boundary that connects measurements and report views to the image viewer.
- Cornerstone viewport and tools explains viewport interaction and the annotation-to-measurement bridge.
- DICOM segmentation and RT explains related derived-image and structure-set workflows.
Change checklist
When these files or sections are changed, remember to consider these:
- Changes to measurement mappings must preserve both directions: tool annotations must still become valid measurement records and report-restored records must still become drawable annotations.
- Changes to SR-specific tool variants must preserve their visual labels and their mapping back to the base tool types used for report export.
- Changes to measurement identity or reference fields must preserve panel filtering, jump-to-measurement behavior, SR export, and SR hydration.
- Changes to tracked-series transitions must preserve the dirty-report guard before measurements are cleared or replaced.
- Changes to SR content parsing must keep the report's tracking identifier tied to one measurement group and must keep 2D image references separate from 3D frame-of-reference references.
- Changes to SR display-set loading must keep report review available when hydration is not supported and must not send empty report content into the measurement path.
- Changes to source display-set matching must exclude derived or overlay image sets and must tolerate image identifiers that have no metadata without hiding valid source images.
- Changes to viewport-specific SR state must preserve the selected report identifiers and must tolerate a viewport being disabled during display-set changes.
- Changes to report storage must preserve the distinction between a local download and a server store, including the generated report data used by the tracking workflow.
- Changes to the SR and measurement-tracking extension boundary must keep the tracking extension able to invoke report creation and restoration.
Important failure modes
| Trigger | Consequence | Guard |
|---|---|---|
| A tool has no measurement mapping or an SR display variant has no export alias | The annotation can appear in the viewport but cannot enter the shared panel or report state, or the report adapter cannot serialize its tool type | Register a matching source mapping and map SR-only display variants to their base report tool types |
| A measurement has no stable study, series, display-set, or image reference | The panel cannot filter it correctly or jump to its source image | Preserve reference metadata in both annotation-to-measurement and SR-to-measurement conversion |
| A user clears dirty tracked measurements without saving | Findings are removed from the current report work | Use the dirty-state prompt before destructive tracking changes |
| An SR has no report content | The report is shown as a display-set problem and cannot provide findings | Keep empty reports out of the imaging measurement path |
| An SR contains only unsupported measurement types | The report can be visible but its findings do not become editable viewer measurements | Check rehydratability against the active measurement mappings and keep unsupported content in report view |
| A report is matched to a derived or overlay display set | Hydration can target labelmap or overlay images instead of source images | Exclude derived and overlay display sets before resolving image IDs |
| A source display set contains an image ID with no known metadata | The loader can fail before it checks later valid source images | Skip unknown image IDs and continue matching known IDs |
| A 2D SR reference points to an unavailable image or frame | The viewer cannot place the finding on the source image | Match SOP instance and frame references to loaded image IDs before adding the annotation |
| A 3D SR reference has no usable source display set for its frame of reference | The annotation has no volume context and navigation is incomplete | Select a matching non-derived display set and use its spatial reference when available |
| A generated report has no imaging content or SOP class | The report is not stored | Validate report content before calling the selected store function |
| A viewport is disabled while SR identifiers are being updated | Report selection can fail during a display-set switch | Check the enabled viewport before reading or writing viewport-specific SR state |
Key files
| File | Why to read it |
|---|---|
| platform/…/MeasurementService.ts | Shared measurement records, source mappings, events, filtering, and navigation contracts |
| extensions/…/initMeasurementService.ts | The two-way connection between Cornerstone annotations and shared measurements |
| extensions/…/package.json | The extension boundary between tracked measurements, DICOM SR, Cornerstone, and the viewer shell |
| extensions/…/measurementTrackingMachine.js | Tracking states, save prompts, dirty-report rules, and SR restore transitions |
| extensions/…/TrackedMeasurementsContext.tsx | Coordination between tracking state, active viewports, measurement records, display-set loading, and hydration |
| extensions/…/TrackedCornerstoneViewport.tsx | Tracked viewport status, measurement event handoff, and measurement navigation |
| extensions/…/PanelMeasurementTableTracking.tsx | Tracked measurement review and report actions exposed to the user |
| extensions/…/index.tsx | Study browsing and display-set helpers connected to the active data source |
| extensions/…/package.json | The SR extension boundary for report views and Cornerstone SR support |
| extensions/…/getSopClassHandlerModule.ts | SR display-set creation, report parsing, source-image matching, and support checks |
| extensions/…/getSopClassHandlerModule.test.ts | Coverage for report class selection and safe source-image matching |
| extensions/…/generateReport.ts | Conversion of tracked annotation state into a DICOM SR dataset |
| extensions/…/getFilteredCornerstoneToolState.ts | Filtering of tracked annotations and normalization of SR-specific tool variants for export |
| extensions/…/hydrateStructuredReport.ts | Conversion of supported SR findings into shared measurements and image or volume annotations |
| extensions/…/dicomSRModule.js | Viewport-specific SR finding selection and safe display-set switching |
| extensions/…/SRPointTool.ts | Report-specific point display and semantic labels |
| extensions/…/srToolGetTextLines.ts | Text shown for SR point and rectangle findings |
| extensions/…/commandsModule.ts | Report generation, validation, storage, and hydration command contracts |
| extensions/…/OHIFCornerstoneSRViewport.tsx | Selection of text and imaging measurement report views |
| extensions/…/OHIFCornerstoneSRContainer.tsx | Structured rendering of nested SR content containers |
| extensions/…/OHIFCornerstoneSRMeasurementViewport.tsx | Report-driven review of a finding on its referenced image |
| extensions/…/promptSaveReport.tsx | Study and series filtering that prepares tracked findings for report creation |