Skip to content

Allow US export to CSC - #657

Merged
stefpiatek merged 12 commits into
mainfrom
stefpiatek/encapsulate_pixel_data
Aug 12, 2026
Merged

Allow US export to CSC#657
stefpiatek merged 12 commits into
mainfrom
stefpiatek/encapsulate_pixel_data

Conversation

@stefpiatek

Copy link
Copy Markdown
Contributor

At point of writing the entire pydicom object to bytes was getting an error compressed Pixel Data not being encapsulated

orthanc-anon-1  |   File "/.venv/lib64/python3.13/site-packages/pydicom/filewriter.py", line 659, in write_dataset
orthanc-anon-1  |     with tag_in_exception(tag):
orthanc-anon-1  |          |                -> (7fe0, 0010)
orthanc-anon-1  |          -> <function tag_in_exception at 0x7fe517c236a0>
orthanc-anon-1  |
orthanc-anon-1  |   File "/usr/lib/python3.13/contextlib.py", line 162, in __exit__
orthanc-anon-1  |     self.gen.throw(value)
orthanc-anon-1  |     |    |   |     -> ValueError("(7FE0,0010) Pixel Data has an undefined length indicating that it's compressed, but the data isn't encapsulated a...
orthanc-anon-1  |     |    |   -> <method 'throw' of 'generator' objects>
orthanc-anon-1  |     |    -> <generator object tag_in_exception at 0x7fe4d7e71140>
orthanc-anon-1  |     -> <contextlib._GeneratorContextManager object at 0x7fe3b42ea4a0>
orthanc-anon-1  |
orthanc-anon-1  |   File "/.venv/lib64/python3.13/site-packages/pydicom/tag.py", line 32, in tag_in_exception
orthanc-anon-1  |     raise type(exc)(msg) from exc
orthanc-anon-1  |                     -> 'With tag (7fe0, 0010) got exception: (7FE0,0010) Pixel Data has an undefined length indicating that it\'s compressed, but th...
orthanc-anon-1  |
orthanc-anon-1  | ValueError: With tag (7fe0, 0010) got exception: (7FE0,0010) Pixel Data has an undefined length indicating that it's compressed, but the data isn't encapsulated as required. See pydicom.en
caps.encapsulate() for more information

@stefpiatek
stefpiatek requested a review from tomaroberts August 3, 2026 08:51
@codecov

codecov Bot commented Aug 3, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 92.30769% with 1 line in your changes missing coverage. Please review.
✅ Project coverage is 88.09%. Comparing base (16a311c) to head (94053cb).

Files with missing lines Patch % Lines
pixl_dcmd/src/pixl_dcmd/main.py 75.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #657      +/-   ##
==========================================
- Coverage   88.10%   88.09%   -0.01%     
==========================================
  Files          81       81              
  Lines        3883     3890       +7     
==========================================
+ Hits         3421     3427       +6     
- Misses        462      463       +1     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@stefpiatek
stefpiatek enabled auto-merge (squash) August 12, 2026 08:49
@stefpiatek stefpiatek changed the title Encapsulate compressed pixel data Allow US export to CSC Aug 12, 2026
@stefpiatek
stefpiatek disabled auto-merge August 12, 2026 08:49
@tomaroberts

Copy link
Copy Markdown
Contributor

Looks like sensible bugfixing and ftps implementation. Checks passing. All good Stef.

@stefpiatek
stefpiatek merged commit d00b7c7 into main Aug 12, 2026
11 checks passed
@stefpiatek
stefpiatek deleted the stefpiatek/encapsulate_pixel_data branch August 12, 2026 08:50
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.

2 participants