fix(RTStruct): RTSTRUCT contours rendered on first slice for multi-frame images without IPP - #5811
Merged
Merged
Conversation
✅ Deploy Preview for ohif-dev ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
Contributor
Author
|
Sample data: US multi-frame data download from https://nbia.cancerimagingarchive.net/ and removed the https://drive.google.com/file/d/1yBfsNprgm50lKony_Ytcbf_haruTUdEP/view?usp=sharing |
Contributor
Author
|
@sedghi Could you please review and share your feedback for this PR? |
wayfarer3130
approved these changes
Feb 23, 2026
wayfarer3130
pushed a commit
that referenced
this pull request
Apr 10, 2026
…ame images without IPP (#5811) Fix RTSTRUCT contours rendered on first slice for multi-frame images without IPP
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Context
Changes & Results
When a multi-frame DICOM dataset does not contain
ImagePositionPatient(IPP) in any of the expected locations (PerFrameFunctionalGroupsSequence,SharedFunctionalGroupsSequence, orDetectorInformationSequence), the RTSTRUCT contour mapping logic is unable to resolve the correct referenced image per contour. As a result, all contours are rendered on the first slice.This PR reintroduces and applies a fallback mechanism that assigns a synthetic IPP based on frame index (
[0, 0, frameNumber]) when no valid IPP is available anywhere in the dataset. This allows contour-to-frame resolution to behave deterministically and prevents all contours from collapsing onto the first slice.Before:
https://github.com/user-attachments/assets/c9a26b76-d9bf-46cd-8afd-9a50b7fd23ea
After:
https://github.com/user-attachments/assets/266ccc80-628f-4298-be90-10fa9425995e
Testing
Load a multi-frame
Drag and drop RTSTRUCT.
Scroll through slices.
Checklist
PR
semantic-release format and guidelines.
Code
etc.)
Public Documentation Updates
additions or removals.
Tested Environment
Greptile Overview
Greptile Summary
This PR fixes RTSTRUCT contour rendering for multi-frame DICOM images that lack
ImagePositionPatient(IPP) metadata. Previously, when IPP was absent fromPerFrameFunctionalGroupsSequence,SharedFunctionalGroupsSequence, andDetectorInformationSequence, contours would collapse onto the first slice.The fix adds
|| NumberOfFrames > 1to the condition atcombineFrameInstance.ts:35, ensuring all multi-frame datasets enter the code block that provides the synthetic IPP fallback[0, 0, frameNumber]at line 100. This guarantees deterministic contour-to-frame mapping based on frame index when no real IPP is available.The change is minimal, well-targeted, and directly addresses the reported issue without affecting single-frame images or multi-frame images with proper IPP metadata.
Confidence Score: 5/5
Important Files Changed
(2/5) Greptile learns from your feedback when you react with thumbs up/down!