Skip to content

Update pydicom to version 3 - #671

Merged
p-j-smith merged 2 commits into
paul/665-uv-lock-formatfrom
paul/665-pydicom-3
Sep 17, 2026
Merged

p-j-smith merged 2 commits into
paul/665-uv-lock-formatfrom
paul/665-pydicom-3

Conversation

@p-j-smith

Copy link
Copy Markdown
Contributor

Description

Part of #665

  • update to pydicom==3.0.2. This also means when need to update the versions of deid and dicom-analyzer
  • write_like_original=False has been removed in pydicom 3. Use enforce_file_format=True instead
  • we need to pass implicit_vr=True and little_endian=True as arguments when saving a Dataset, rather than setting them as attributes
  • make pixel_data np.uint16 to correspond to the BitsAllocated=16 tag we set when generating the test dataset, otherwise pydicom 3 raises a warning, which would make test_anonymise_and_validate_dicom fail as we check there are no warnings in the logs

Type of change

Please delete options accordingly to the description.

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • This change requires a documentation update

Suggested Checklist

  • I have performed a self-review of my own code.
  • I have made corresponding changes to the documentation.
  • My changes generate no new warnings.
  • I have commented my code, particularly in hard-to-understand areas.
  • I have passed on my local host device. (see further details at the CONTRIBUTING document)
  • Make sure your branch is up-to-date with main branch. See CONTRIBUTING for a general example to syncronise your branch with the main branch.
  • I have requested review to this PR.
  • I have addressed and marked as resolved all the review comments in my PR.
  • Finally, I have selected squash and merge

@p-j-smith
p-j-smith added this pull request to stack #672 September 17, 2026 07:31
@codecov

codecov Bot commented Sep 17, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 88.37%. Comparing base (301bc9d) to head (8c4fc61).

Additional details and impacted files
@@                     Coverage Diff                      @@
##           paul/665-uv-lock-format     #671       +/-   ##
============================================================
+ Coverage                    67.31%   88.37%   +21.05%     
============================================================
  Files                           56       81       +25     
  Lines                         2408     3956     +1548     
============================================================
+ Hits                          1621     3496     +1875     
+ Misses                         787      460      -327     

☔ 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.

We also need to update to:
deid 0.4.12
dicom-anonymizer 2.0.0

Update uv.lock
write_like_original=False to ds.save_as is deprecated
use enforce_file_format=True instead

don't set ds.is_implicit_VR and ds.is_little_endian attributes
they are not dicom tags, but pydicom dataset attributes, and are no longer used in pydicom 3
instead, pass implicit_vr=True, little_endian=True to ds.save_as
@p-j-smith
p-j-smith merged commit ac32be9 into main Sep 17, 2026
11 checks passed
@p-j-smith
p-j-smith deleted the paul/665-pydicom-3 branch September 17, 2026 15:04
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