Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: upgrade to pydicom 3 #268

Closed

Conversation

sammaxwellxyz
Copy link
Contributor

@sammaxwellxyz sammaxwellxyz commented Oct 1, 2024

Description

Related issues: #266 #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

  • I have commented my code, particularly in hard-to-understand areas
  • My changes generate no new warnings
  • 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

@sammaxwellxyz sammaxwellxyz force-pushed the fix/pydicom-version branch 2 times, most recently from 2ab9825 to 349f364 Compare October 1, 2024 21:15
@sammaxwellxyz sammaxwellxyz marked this pull request as ready for review October 1, 2024 21:18
@vsoch
Copy link
Member

vsoch commented Oct 2, 2024

Tiny conflict and then ready to test!

@vsoch
Copy link
Member

vsoch commented Oct 2, 2024

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

@vsoch
Copy link
Member

vsoch commented Oct 2, 2024

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

@howff
Copy link
Contributor

howff commented Jan 27, 2025

Is it possible to get deid supporting pydicom v3 please?

@howff
Copy link
Contributor

howff commented Jan 27, 2025

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?

@vsoch
Copy link
Member

vsoch commented Jan 27, 2025

What you can do is remove or change the pins and then run tests, and fix any issues that arise.

@howff
Copy link
Contributor

howff commented Jan 27, 2025

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",
  • tests/test_replace_identifiers.py
    • remove spaces from tags strings, so "(0009, 0010)" becomes "(0009,0010)"
    • and same for "(0010, 0020)" becomes "(0010,0020)"

@vsoch
Copy link
Member

vsoch commented Jan 27, 2025

@sammaxwellxyz are you able and willing to update the PR with those changes?

@sammaxwellxyz
Copy link
Contributor Author

sammaxwellxyz commented Jan 29, 2025

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

@vsoch
Copy link
Member

vsoch commented Jan 29, 2025

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.

@howff howff mentioned this pull request Jan 29, 2025
3 tasks
@vsoch
Copy link
Member

vsoch commented Jan 31, 2025

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!

@vsoch vsoch closed this Jan 31, 2025
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.

3 participants