Skip to content

feat(idc): instance-level SR qualitative annotations (TID 1500/1501)#129

Open
igoroctaviano wants to merge 13 commits into
masterfrom
feat/idc-instance-sr-qualitative-annotations
Open

feat(idc): instance-level SR qualitative annotations (TID 1500/1501)#129
igoroctaviano wants to merge 13 commits into
masterfrom
feat/idc-instance-sr-qualitative-annotations

Conversation

@igoroctaviano

Copy link
Copy Markdown
Collaborator

Summary

Implements OHIF/Viewers#3358 — support for instance-level SR qualitative annotations — entirely within the IDC extension (extensions/idc), per the request to have it available as an extension in the IDC fork.

When a study contains a DICOM SR (TID 1500 Imaging Measurement Report) whose Measurement Group (TID 1501) holds one or more IMAGE content items and one or more CODE content items, but no geometric coordinates (SCOORD/SCOORD3D), the coded values are rendered as concept: value labels over the referenced image instance (e.g. Target Region: Neck). Hovering a label reveals the code value / coding scheme designator and any modifiers (subordinate codes), addressing the modifier concern raised in the issue thread (OHIF#3108).

What's included

  • extractInstanceAnnotations — pure TID 1500/1501 parser that walks Imaging Measurements → Measurement Group, skips geometric groups, and maps each referenced SOP Instance UID to its qualitative codes (+ modifiers, tracking identifier).
  • instanceAnnotationStoreSOPInstanceUID → annotations store with a lightweight pub/sub so the overlay re-renders once SRs finish loading.
  • InstanceAnnotationsOverlay — viewport overlay item rendering concept: value labels with an optional colored dot and a tooltip (code value / scheme / modifiers).
  • registerInstanceAnnotations — parses already-loaded and future SR display sets and appends the item to viewportOverlay.bottomRight via the customization service.
  • Wired into the extension's onModeEnter (the IDC extension's lifecycle hooks run globally), so no mode changes are required. Configurable/disable-able via app config instanceAnnotations (enabled, maxLabels, showColor, colors).

Design notes

  • Rendered in the bottom-right overlay region to avoid colliding with the bottom-left text overlays (per design discussion in the issue).
  • The required CODE/IMAGE content items live directly in instance metadata, so no bulk-data load is needed before parsing.
  • Colors are configurable and can be turned off; a stable per-concept color is derived from the palette.

Test plan

  • Unit tests for the parser (extractInstanceAnnotations.test.ts): extracts codes from the issue's example, captures modifiers, ignores geometric groups, ignores groups without an IMAGE reference, handles empty input. Run: npx jest --projects extensions/idc/jest.config.js.
  • Manual: load a study + TID 1500 SR with instance-level qualitative annotations (e.g. the IDC qualitative annotation sample / 1.3.6.1.4.1.32722.99.99.62087908186665265759322018723889952421) and verify labels appear on the referenced instances with working tooltips, and that scrolling updates them per instance.

Closes OHIF#3358

jbocce and others added 12 commits May 27, 2026 10:44
…elease 3.12.5 (OHIF#6086)

* Update playwright config to output html report and always include video.

* Output playwright html report to results zip.

* Fix MeasurementPanel.spec.ts to use new measurement row locator.
Implements OHIF#3358 in the IDC extension.

When a TID 1500 Imaging Measurement Report contains a Measurement Group
(TID 1501) with IMAGE content items and CODE content items but no
geometric coordinates (SCOORD/SCOORD3D), the coded values are rendered as
"concept: value" labels in the bottom-right viewport overlay over the
referenced image instance (e.g. "Target Region: Neck"). A tooltip shows
the code value / coding scheme designator and any modifiers.

- extractInstanceAnnotations: pure TID 1500/1501 parser (+ unit tests)
- instanceAnnotationStore: SOPInstanceUID -> annotations store with pub/sub
- InstanceAnnotationsOverlay: viewport overlay item with tooltips
- registerInstanceAnnotations: parses SR display sets and registers the
  viewportOverlay.bottomRight customization
- wired into the extension onModeEnter; configurable via app config
  `instanceAnnotations` (enabled/maxLabels/showColor/colors)
Color was derived from the concept name, so annotations sharing a concept
(e.g. two "Finding Site" items) rendered with an identical dot and looked
like "no colors". Derive the color from the coded value instead (falling
back to value text, then concept label) so distinct findings get distinct
colors, color the value text as well, and slightly enlarge the dot for
visibility.
@igoroctaviano

Copy link
Copy Markdown
Collaborator Author

@fedorov feel free to test this one

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Feature Request] Support for Instance Level SR Qualitative Annotations

3 participants