Skip to content

fix: return asl context for siemens dicom metadata#59

Open
AlwinXue wants to merge 1 commit intoOSIPI:mainfrom
AlwinXue:alwin/fix-issue-42
Open

fix: return asl context for siemens dicom metadata#59
AlwinXue wants to merge 1 commit intoOSIPI:mainfrom
AlwinXue:alwin/fix-issue-42

Conversation

@AlwinXue
Copy link
Copy Markdown

@AlwinXue AlwinXue commented Mar 31, 2026

Hi mentors! 👋

This PR addresses the DICOM endpoint crash reported in Issue #42.

The Problem:
The DICOM route expects get_bids_metadata() to return a two-item tuple: (metadata, asl_context). However, SiemensBasicSinglePLD.extract_bids_metadata() returned only the metadata dictionary, which caused the endpoint to fail with ValueError: not enough values to unpack when a Siemens ASL sequence matched.

The Solution:
Contract Alignment: Updated SiemensBasicSinglePLD.extract_bids_metadata() to return (bids, asl_context) like the GE ASL sequence implementations.
Default ASL Context: Added a default single-PLD Siemens ASL context of ["deltaM", "m0scan"], which matches the existing single-PLD assumptions in the backend flow.
Regression Coverage: Added a focused package test that verifies the Siemens sequence now returns both metadata and ASL context together.

Validation:
Ran python -m pytest package/src/pyaslreport/tests/test_siemens_basic_single_pld.py -q and the new sequence contract test passed.

Fixes #42

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.

DICOM endpoint crashes with ValueError: not enough values to unpack due to inconsistent extract_bids_metadata signatures

1 participant