deid
deid copied to clipboard
fix: upgrade to pydicom 3
Description
Related issues: #266 https://github.com/pydicom/deid/issues/266
Please include a summary of the change(s) and if relevant, any related issues above. update read_file to dcmread as per suggestion from pydicom 3 release notes https://github.com/pydicom/pydicom/releases/tag/v3.0.0
I couldn't tell if the other changes would cause external breaking changes.
I've run no testing
Checklist
- [x] I have commented my code, particularly in hard-to-understand areas
- [x] My changes generate no new warnings
- [x] My code follows the style guidelines of this project
Open questions
Questions that require more discussion or to be addressed in future development: The approach as here https://github.com/pydicom/deid/pull/267/files may be worthwhile as well to avoid a similar case in the future
Tiny conflict and then ready to test!
Was there possibly a change with private fields?
######################END########################
.............................WARNING Empty values list encountered. No fields will be identified.
WARNING Empty values list encountered. No fields will be identified.
.................................
======================================================================
FAIL: test_fieldset_remove_private (test_replace_identifiers.TestDicom.test_fieldset_remove_private)
%fields field_set2_private
----------------------------------------------------------------------
Traceback (most recent call last):
File "/home/runner/work/deid/deid/deid/tests/test_replace_identifiers.py", line 518, in test_fieldset_remove_private
self.assertTrue("(0009, 0010)" in parser.lookup["field_set2_private"])
AssertionError: False is not true
another idea is to have a set of helper scripts - not integrated into the main client, but optional to install (and support this extra functionality).
Is it possible to get deid supporting pydicom v3 please?
Why are the requirements changed like this?
"numpy>=1.20,<2.0" - why is numpy now restricted to <2? pydicom itself works with numpy>=2. Please can this be removed?
"matplotlib<4.0" - just wondering why?
"python-dateutil<3.0" - just wondering why?
What you can do is remove or change the pins and then run tests, and fix any issues that arise.
Ok, I can't add commits to someone else's branch, but I can confirm the tests pass with numpy v2
after making the required changes:
- deid/version.py
- change to
"numpy>=1.20",
- change to
- tests/test_replace_identifiers.py
- remove spaces from tags strings, so
"(0009, 0010)"becomes"(0009,0010)" - and same for
"(0010, 0020)"becomes"(0010,0020)"
- remove spaces from tags strings, so
@sammaxwellxyz are you able and willing to update the PR with those changes?
Hey,
@howff you should be able to fork off my branch to add your own commits and then raise a new PR from that.
are you able and willing to update the PR with those changes?
@vsoch willing, but won't be able to get to it for a while
Thanks @sammaxwellxyz, either of those options work for me. @howff, you can fork and PR if you want this change imminently. Otherwise, we can wait for @sammaxwellxyz to finish the work here.
Thank you for this work @sammaxwellxyz - I have finished up the PR in #273 with a slightly different design to import the pydicom.dcrmread in one place that can be edited in the future. Please let me know if you run into any issues, and have a good weekend!