Skip to content

Conversation

@jmannau
Copy link
Contributor

@jmannau jmannau commented Nov 3, 2025

Context

When loading multi-frame images using the wado-uri image loader, Image Position Patient is read from the SharedFunctionalGroupSequence or PerFrameFunctionalGroupSequence from either
SharedFunctionalGroupsSequence[0].PlanePositionSequence[0].ImagePositionPatient or PerFrameFunctionalGroupSequence[:frameId].PlanePositionSequence[0].ImagePositionPatient

However if PlanePositionSequence was empty an error is thrown by extractPositionFromDataset causing loading the image to fail.

This PR includes optional chaining checks to prevent an error in extractPositionFromDataset if ImagePositionPatient doesn't exist.

Changes & Results

calling metadata.get(Enums.MetadataModules.IMAGE_PLANE, imageId) previously would throw an error for some files. No error is now thrown.

Testing

A unit test has been added for this change.

Checklist

PR

  • My Pull Request title is descriptive, accurate and follows the
    semantic-release format and guidelines.

Code

  • My code has been well-documented (function documentation, inline comments,
    etc.)

Public Documentation Updates

  • [N/A] The documentation page has been updated as necessary for any public API
    additions or removals.

Tested Environment

  • "OS: MacOS 15.7.1"
  • "Node version:22"
  • "Browser: Brave"

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