ohif-viewer/platform/core/src
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
..
__mocks__ chore(prettier): full repo linting and code reformatting once and for all (#3627) 2023-09-01 16:19:39 -04:00
classes fix(MetadataProvider): Correctly assign imageId for multiframe images and remove unused frame information retrieval method (#5965) 2026-07-10 15:35:09 -04:00
contextProviders feat: add viewport overlays to microscopy mode (#4776) 2025-02-11 12:39:45 -05:00
DataSources feat(DataSource): Allow for dynamic data source configuration and creation (#3543) 2023-07-20 11:43:05 -04:00
defaults fix(hotkeyBindings): consolidate Escape hotkey behavior for contour drawing tools (#6104) 2026-06-26 08:20:22 -04:00
DICOMWeb [Ready] fix 5288 removal of accept header options in retrieve metadata (#5293) 2025-10-16 20:01:34 -04:00
enums fix(demo): Deploy issue (#3951) 2024-02-22 14:42:46 -05:00
extensions fix: Several new worklist issues (#6130) 2026-07-10 08:16:16 -04:00
hooks feature(segmentation): Add contour tools and utilities in a side panel (#5517) 2025-10-29 14:15:52 -04:00
measurements/tools feat(SR): Measurement adapter mappings and save to same series (#3140) 2023-02-17 16:44:21 -05:00
services feat: Add extensibility for tmtv and segmentation modes (#6128) 2026-07-10 12:43:17 -04:00
types feat(next): native Generic Viewport migration (useNextViewports) (#6101) 2026-07-11 12:13:54 -04:00
utils fix(pt): resolve Philips PET private SUV bulkdata before scaling (#6096) 2026-07-11 12:16:32 -04:00
errorHandler.js feat: configuration to hook into XHR Error handling 2020-04-22 22:01:34 -04:00
ie.js Chore/kill yalc with fire (#629) 2019-08-13 15:36:46 -04:00
index.ts fix: A couple of changes to enable cs3d integration build (#5944) 2026-04-10 16:51:37 -04:00
log.js feat(debug): Add timing information about time to first image/all images, and query time (#3681) 2023-10-03 17:01:00 -04:00
object.js lint(curly): consistent use of curly brackets in codebase (#3584) 2023-08-09 10:07:33 -04:00
string.js chore(prettier): full repo linting and code reformatting once and for all (#3627) 2023-09-01 16:19:39 -04:00
user.ts [Ready] fix 5288 removal of accept header options in retrieve metadata (#5293) 2025-10-16 20:01:34 -04:00