Skip to content

Conversation

julianlinaress
Copy link
Contributor

… using Per-frame Functional Groups Sequence

Context

This PR addresses the issue of missing ImageOrientationPatient, ImagePositionPatient, and PixelSpacing in enhanced multiframe DICOM datasets (e.g., CT/MR) where these values are not present at the top level of the dataset.

When loading volumes from multiframe images, cornerstone failed to extract required spatial metadata, leading to errors such as:

ImageOrientationPatient is undefined

This happened because the current implementation only supports:

  • Top-level attributes
  • Some NM-specific structures

Enhanced DICOM datasets often store these values inside the Per-frame Functional Groups Sequence (5200,9230) or Shared Functional Groups Sequence (5200,9229), which were not considered until now.

Changes & Results

Added fallbacks as last resort in:

  • extractOrientationFromDataset() to read from Per-frame Functional Groups Sequence → Plane Orientation Sequence
  • extractPositionFromDataset() to read from Per-frame Functional Groups Sequence → Plane Position Sequence
  • extractSpacingFromDataset() to read from Shared Functional Groups Sequence → Pixel Measures Sequence

These fallbacks are only triggered when no value is found in standard locations, preserving existing logic and behavior for non-enhanced DICOMs.

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

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

Tested Environment

  • "OS: Windows 11
  • "Node version: v24.4.1
  • "Browser: Firefox 141.0, Chrome 138.0.7204.184

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