Skip to content

fix: expand adapters patch to fix more PerFrameFunctionalGroupsSequence crashes - #145

Merged
igoroctaviano merged 1 commit into
masterfrom
fix/seg-labelmap-crashes
Oct 5, 2026
Merged

igoroctaviano merged 1 commit into
masterfrom
fix/seg-labelmap-crashes

Conversation

@igoroctaviano

Copy link
Copy Markdown
Collaborator

Summary

Expands the @cornerstonejs/adapters patch to fix additional crash locations when PerFrameFunctionalGroupsSequence is undefined.

Problem

After fixing checkOrientation, there were more crashes in labelmapImagesFromBuffer.js:

  • insertPixelDataPlanar - lines 555, 557, 558, 568
  • insertOverlappingPixelDataPlanar - line 821
  • getSegmentData - lines 914, 926, 929

All crash with "Cannot read properties of undefined (reading 'length')" or similar.

Solution

Added optional chaining (?.) and null checks throughout these functions.

Upstream Issue

cornerstonejs/cornerstone3D#2962

Test plan

  • Load a SEG study that was previously failing
  • Verify segmentation loads without crashing

…ce crashes

Adds null checks and optional chaining for PerFrameFunctionalGroupsSequence in:
- insertPixelDataPlanar (lines 555, 557, 558, 568)
- insertOverlappingPixelDataPlanar (line 821)
- getSegmentData (lines 914, 926, 929)

Fixes "Cannot read properties of undefined (reading 'length')" errors
when loading SEG files without PerFrameFunctionalGroupsSequence.
@igoroctaviano
igoroctaviano merged commit fe73128 into master Oct 5, 2026
1 of 3 checks passed

This branch is being deployed

1 queued deployment
fork-pr-approval — b98fea91 Deployed Oct 5, 2026 by igoroctaviano via playwright-tests (24.15.0) #123
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