Skip to content

fix(seg): try bulk data fetch for PerFrameFunctionalGroupsSequence before full Part 10 fallback - #152

Merged
igoroctaviano merged 1 commit into
masterfrom
fix/seg-bulkdata-fallback
Oct 6, 2026
Merged

igoroctaviano merged 1 commit into
masterfrom
fix/seg-bulkdata-fallback

Conversation

@igoroctaviano

Copy link
Copy Markdown
Collaborator

Summary

Enhancement to the SEG loading fallback to try fetching PerFrameFunctionalGroupsSequence via bulk data before falling back to the full Part 10 file.

Context

This is a follow-up to PR #148 which added the fallback to buffer-based loader when PerFrameFunctionalGroupsSequence is missing from inline metadata.

Based on feedback from @fedorov on the upstream OHIF PR (#6333), some servers may provide the sequence via BulkDataURI rather than inline. This is more efficient for large SEGs as it avoids including the entire sequence in the JSON metadata response.

Loading Strategy (in order of preference)

  1. Inline metadata - If PerFrameFunctionalGroupsSequence is present as array → use efficient metadata-based loader
  2. Bulk data - If PerFrameFunctionalGroupsSequence has BulkDataURI → fetch bulk data, parse JSON, then use metadata-based loader
  3. Full Part 10 - If bulk data is unavailable or fetch fails → fall back to buffer-based loader (full DICOM file)

Changes

  • Check if PerFrameFunctionalGroupsSequence has a BulkDataURI or retrieveBulkData method
  • If available, fetch the bulk data and parse as JSON
  • Naturalize the sequence data using dcmjs
  • Update instance metadata and use the efficient metadata-based loader
  • If bulk data fetch fails, gracefully fall back to buffer-based loader

Related

…fore full Part 10 fallback

Before falling back to fetching the full DICOM Part 10 file when
PerFrameFunctionalGroupsSequence is not inline, first check if the
server provides it via BulkDataURI. If available, fetch the bulk data
and parse it as JSON, then use the metadata-based loader.

Loading strategy (in order of preference):
1. Inline PerFrameFunctionalGroupsSequence (array) → metadata-based loader
2. BulkDataURI for PerFrameFunctionalGroupsSequence → fetch bulk data, then metadata-based loader
3. No bulk data or fetch fails → buffer-based loader (full Part 10 file)
@igoroctaviano
igoroctaviano merged commit e2596f4 into master Oct 6, 2026
2 of 3 checks passed

This branch was successfully deployed

No deployments
fork-pr-approval — d8cd034e Deployed Oct 6, 2026 by igoroctaviano via playwright-tests (24.15.0) #129
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.

1 participant