Skip to content

Return sequences for singleton temporal coordinates - #487

Merged
CPBridge merged 2 commits into
ImagingDataCommons:masterfrom
jdotc1:bugfix/jdotc1-singleton-tcoord-20261022
Oct 24, 2026
Merged

CPBridge merged 2 commits into
ImagingDataCommons:masterfrom
jdotc1:bugfix/jdotc1-singleton-tcoord-20261022

Conversation

@jdotc1

@jdotc1 jdotc1 commented Oct 22, 2026 •

Copy link
Copy Markdown
Contributor

A one-value TCOORD POINT returns a scalar from value even though the API describes a sequence of time points.

Select the stored attribute as before and wrap scalar values in a one-element list. Preserve None, MultiValue, decoded ordinary lists, and NumPy arrays without copying or converting their elements. This also prevents decoded multi-value sample positions or NumPy-backed offsets from becoming nested containers. No DICOM tag or constructor change.

Testing

  • Reproduced the decoded-list failure with real pydicom/highdicom: 1 failed, 13 passed.

  • Added real serialized/read-back DS NumPy regressions for one and two offsets; the two-value case failed on the intermediate list-only correction.

  • Complete tests/test_sr.py: 328 passed on Python 3.12, pydicom 3.0.2, NumPy 2.3.5, and pytest 9.0.3.

  • Changed-file Flake8 and git diff --check: passed.

  • Tests check values, element types, DICOM multiplicity, and stored-container identity, and restore pydicom configuration in finally.

  • Hosted CI on 165dbc61ea100bbf711b96f618ec7e3020354648: all 13 checks passed, including all 12 OS/Python/dependency-matrix jobs and codespell. Unit matrix.

The complete repository matrix was validated by hosted CI; local validation covered the full SR module and changed-file lint.

Compatibility

Consumers relying on the accidental scalar result will observe a container. Multi-value container identity and pydicom element types are preserved; DS and DT values are not stringified.

@CPBridge CPBridge added the bug Something isn't working label Oct 22, 2026
Preserve decoded list and NumPy array values while wrapping scalar temporal values. Cover NumPy-backed DS roundtrips without changing element types or container identity.
@CPBridge

Copy link
Copy Markdown
Collaborator

Thanks

@CPBridge
CPBridge merged commit 3a9f71b into ImagingDataCommons:master Oct 24, 2026
13 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants