-
-
Notifications
You must be signed in to change notification settings - Fork 44
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
Compatible with pydicom v3 #272
Conversation
This looks great! One design suggestion that I think will make this hugely easier - we can add a function to utils that basically returns the pydicom read_file / dcmread function, and that way if/when the way to read dicom changes (it has changed multiple times over the years) we can change just one spot. What do you think? |
Just a couple of thoughts:
|
I am not saying changes to pydicom, I'm saying that in some utils.py you'd have: def dcmread(filename)
return pydicom.dcrmread(filename) And then across the code base: import deid.utils as utils
dcm = utils.dcmread(filename) And then if there is a change to pydicom (which there has been several times already for this specific function) we are changing one place instead of 200. Does that make sense? |
As primary owner/maintainer I will let you decide on changes such as that. I just wanted to get the fix for v3 across the line! |
@howff I think that would be the better design. Would you have time to work on this? |
I would prefer to keep this PR for a bug fix and use a different PR for a feature request, but since you asked so nicely and deid really needs to be fixed asap I've made the requested changes. |
to prevent circular import
to prevent circular import
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you!
deid/dicom/dcmread.py
Outdated
__copyright__ = "Copyright 2025, Andrew Brooks" | ||
__license__ = "MIT" | ||
|
||
import pydicom |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please add this as a function to the utils.py file:
https://github.com/pydicom/deid/blob/1a0ef4480bf958966f1fd9d153247664dd0fc169/deid/dicom/utils.py
Then for use you can do:
import deid.dicom.utils as utils
dcm = utils.dcmread(filename)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It didn't work, circular reference
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What if we did:
utils/
__init__.py
fileio.py
dcmread.py
To avoid the circular reference? The basic idea is around organization - we want dcmread to clearly be in a utils module.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As a maintainer I review for functionality and design, with an eye for looking forward. I gave you my feedback and design suggestions, which did not have any bug. The only problem here is this comment. Please try to follow the code of conduct moving forward.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've done everything which you asked me to do, but this PR has been closed without being merged. Can you confirm that you've done everything which this PR did, but in your own PR, so that I know whether to delete this branch?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@vsoch Please excuse my frustration. The fix only required
- deleting two space characters
- deleting
,<2
but I spent two days doing the extra work (and my wife complained because I was still working on it after 11pm). I am glad that you managed to achieve everything yourself in about 20 minutes.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For transparency, this is the comment I responded to above (that you deleted).
I was respectful in my interactions, kind, and always asked for your thoughts and if you had time to work on it. I'm sorry for your frustration - I hope you find strategies to respond to review that don't lead to that in the future.
Co-authored-by: Vanessasaurus <[email protected]>
Description
Related issues: #266
Finishing off PR #268
Checklist
Open questions
Questions that require more discussion or to be addressed in future development: