ohif-viewer/extensions/default/src/DicomWebDataSource
Alireza 70421225d7
fix(pt): resolve Philips PET private SUV bulkdata before scaling (#6096)
* fix(pt): resolve Philips PET private SUV bulkdata before scaling

When a DICOMweb server delivers the Philips PET private tags SUVScaleFactor
(7053,1000) / ActivityConcentrationScaleFactor (7053,1009) as bulkdata, dcmjs
naturalization leaves them as { BulkDataURI } objects. These were fed verbatim
to calculate-suv, which treats the object as a valid value and silently
corrupts the SUV scaling factors.

Resolve these scalar private tags to numbers during ingestion - in both the
lazy (async) and non-lazy (sync) DICOMweb metadata paths, before INSTANCES_ADDED
fires - by decoding the bulkdata (VR-aware: DS/IS text or little-endian FL/FD).
Harden getPTImageIdInstanceMetadata to coerce values to finite numbers (reusing
@ohif/core utils.toNumber) and reject unresolved bulkdata objects so they can
never reach calculate-suv. Share the bulkdata-attach helper between both
metadata paths. Adds unit tests for the bulkdata decoder/resolver and for
getPTImageIdInstanceMetadata.

* refactor(bulkdata): move PET bulkdata resolution to a generic core tag registry

Generalize resolvePETPrivateScalarBulkData into a datasource-agnostic
utils.resolveBulkDataTags in @ohif/core, backed by a static tag registry
seeded with the Philips PET SUV/activity-concentration scalar tags and
extensible via registerResolvedBulkDataTags.

* fix(bulkdata): strip NUL padding and refresh qido auth before resolution

Address review feedback:
- decodeText now strips NUL (0x00) padding, which String.trim() leaves
  intact, so NUL-padded DS/IS values no longer decode as NaN. Adds a
  regression test.
- refresh qidoDicomWebClient.headers before resolveBulkDataTags in both
  series-metadata paths; retrieveBulkData is bound to qidoDicomWebClient,
  matching every other qido op in this file.

* fix(dicomweb): await deferred metadata storage

* fix(dicomweb): support single-part bulkdata responses
2026-07-11 12:16:32 -04:00
..
utils feat(static-wado): add support for case-insensitive searching (#4603) 2025-01-27 11:20:00 -05:00
wado feat(dev): move to rsbuild for dev - faster (#4674) 2025-01-10 15:05:35 -05:00
dcm4cheeReject.js Handle 200 status response and add default error handling (#5227) 2025-07-23 14:14:08 -04:00
exampleInstances.js
index.ts fix(pt): resolve Philips PET private SUV bulkdata before scaling (#6096) 2026-07-11 12:16:32 -04:00
qido.js feat: Add customization URL parameter (#5992) 2026-07-07 15:30:27 -04:00
retrieveBulkData.test.ts fix(pt): resolve Philips PET private SUV bulkdata before scaling (#6096) 2026-07-11 12:16:32 -04:00
retrieveBulkData.ts fix(pt): resolve Philips PET private SUV bulkdata before scaling (#6096) 2026-07-11 12:16:32 -04:00
retrieveRendered.test.ts fix(dicom-pdf): enhance PDF loading with authentication support 2026-07-06 09:35:26 -04:00
retrieveRendered.ts fix(dicom-pdf): enhance PDF loading with authentication support 2026-07-06 09:35:26 -04:00
retrieveStudyMetadata.js fix(url): series query param filtering (#4328) 2024-08-06 09:26:34 -04:00
retrieveThumbnail.ts feat(WorkList): New Study List (WorkList based on ui-next); old study list renamed to LegacyWorklist (#6005) 2026-05-28 12:26:30 -04:00