Skip to content

fix(378/327/377/353): DICOM tag browser, worklist (including Modalities in Study when QIDO omits it), overlay colormaps, header badge behavior, and test/tooling updates#379

Open
igoroctaviano wants to merge 5 commits intomasterfrom
issues/378-327-377-353
Open

fix(378/327/377/353): DICOM tag browser, worklist (including Modalities in Study when QIDO omits it), overlay colormaps, header badge behavior, and test/tooling updates#379
igoroctaviano wants to merge 5 commits intomasterfrom
issues/378-327-377-353

Conversation

@igoroctaviano
Copy link
Collaborator

@igoroctaviano igoroctaviano commented Mar 23, 2026

Summary

DMV branch: ImagingDataCommons/dicom-microscopy-viewer#236

Bundles DICOM tag browser, worklist (including Modalities in Study when QIDO omits it), overlay colormaps, header badge behavior, and test/tooling updates. Relates to #378, #327, #377, #376, and #353 (header).

Changes

DICOM tag browser — Person Name (PN) display (#376)

  • Decode DICOMweb PN objects (Alphabetic / Ideographic / Phonetic) instead of showing JSON.stringify output (e.g. PatientName shows C3L-00452, not {"Alphabetic":"C3L-00452"}).
  • Uses VR PN when known; falls back to shape-based detection when VR is missing but the value matches the DICOMweb PN pattern.
  • Multiple component groups in one value are joined with |; multi-valued PN in metadata still uses \ between items (formatValue / formatTagValue).

DICOM tag browser — display sets by series (#378)

  • One row per SeriesInstanceUID; merge volume / overview / label images that share a series.
  • Dedupe instances by SOPInstanceUID (bucketContainsSopInstance).
  • @types/d3-dispatch@3.0.6 as devDependency plus override (lockfile / TypeScript alignment).

DICOM tag browser — metadata rows (#327)

  • Resolve tags via nameMap and full dcmjs dictionary when keys are numeric; normalize to (GGGG,EEEE) (punctuateTagId, resolveDictionaryEntry).
  • SQ handling uses dictionary VR/name; recurse into items.
  • Unknown / private: Unlisted attribute or Unlisted sequence; VR from _vrMap when available (vrFromVrMap).
  • Arrays/objects formatted with formatValue where appropriate (VR-aware for PN).

Worklist (#378)

  • Column search Input: treat missing selectedKeys[0] as ''; coerce to string when present (stable controlled value).
  • Modalities in Study: when QIDO study resources omit (0008,0061) or it is empty, derive modalities from searchForSeries per study (unique Modality per series), sorted.
  • Lazy enrichment: render the table immediately after study QIDO; backfill modalities in the background and merge into state. Generation counter drops stale results after pagination / new search / client change.
  • Column render: comma-separated list for ModalitiesInStudy arrays.

Overlays — distinct colormaps (#377)

  • distinctOverlayColormaps.ts: cycle colormaps for multiple fractional segments without DICOM display color, and for multiple parametric maps.
  • SlideViewer: call after addSegments / addParameterMappings; opacity-only setSegmentStyle avoids forcing a default palette so distinct LUTs stay intact.
  • Types: ColormapNames, createColormap, limitValues on parameter-mapping style (types/dicom-microscopy-viewer/index.d.ts).

Header (#353)

  • Per discussion on #353: green badge only when warning count > 0 (color={… ? 'green' : undefined}).

Testing & tooling

  • bun test: bunfig.toml preloads src/test/bun-preload.ts (happy-dom) so DOM globals exist; package.json script test:bun.
  • logger: safe when window is undefined (Bun / Node) so the singleton does not throw at import time.
  • logger.test.ts: configurable: true on window.config mock for cleanup under happy-dom.
  • Worklist.test.tsx: study without 00080061, mocked searchForSeries, casts for partial QIDO payloads vs dicomweb-client types.
  • dicomMicroscopyViewerMock.js: includes (0008,0060) Modality for Jest formatMetadata parity on series rows.

Files

Area Files
Tag browser DicomTagBrowser.tsx, dicomTagUtils.ts
Worklist Worklist.tsx, src/components/__tests__/Worklist.test.tsx
Viewer SlideViewer.tsx, src/utils/distinctOverlayColormaps.ts
Types types/dicom-microscopy-viewer/index.d.ts
Header Header.tsx
Logger src/utils/logger.ts, src/utils/logger.test.ts
Bun / Jest bunfig.toml, src/test/bun-preload.ts, src/__mocks__/dicomMicroscopyViewerMock.js
Deps package.json, bun.lock

Testing

@deepsource-io
Copy link

deepsource-io bot commented Mar 23, 2026

DeepSource Code Review

We reviewed changes in 4e37d65...c537806 on this pull request. Below is the summary for the review, and you can see the individual issues we found as inline review comments.

See full review on DeepSource ↗

PR Report Card

Overall Grade   Security  

Reliability  

Complexity  

Hygiene  

Code Review Summary

Analyzer Status Updated (UTC) Details
JavaScript Mar 24, 2026 12:01p.m. Review ↗
@sonarqubecloud
Copy link

Quality Gate Failed Quality Gate failed

Failed conditions
5 Security Hotspots
D Reliability Rating on New Code (required ≥ A)

See analysis details on SonarQube Cloud

Catch issues before they fail your Quality Gate with our IDE extension SonarQube for IDE

@igoroctaviano igoroctaviano self-assigned this Mar 24, 2026
@igoroctaviano igoroctaviano requested a review from fedorov March 24, 2026 12:15
@igoroctaviano igoroctaviano changed the title Issues/378 327 377 353 fix: 378 327 377 353 Mar 25, 2026
@igoroctaviano igoroctaviano changed the title fix: 378 327 377 353 fix(378/327/377/353): Bundles DICOM tag browser, worklist (including Modalities in Study when QIDO omits it), overlay colormaps, header badge behavior, and test/tooling updates Mar 25, 2026
@igoroctaviano igoroctaviano changed the title fix(378/327/377/353): Bundles DICOM tag browser, worklist (including Modalities in Study when QIDO omits it), overlay colormaps, header badge behavior, and test/tooling updates fix(378/327/377/353): DICOM tag browser, worklist (including Modalities in Study when QIDO omits it), overlay colormaps, header badge behavior, and test/tooling updates Mar 25, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

1 participant