-
Notifications
You must be signed in to change notification settings - Fork 180
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
[MRG] Support for pydicom v3 #972
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #972 +/- ##
=========================================
Coverage 100.00% 100.00%
=========================================
Files 28 28
Lines 8708 8707 -1
=========================================
- Hits 8708 8707 -1
|
The coverage went down a bit as the |
This should hopefully have 100% coverage again. There is one caveat. It behaves differently than before when loading a dataset (because |
Good to know ... ruff formatting is not fully compatible with black. But for that conda error I am unguilty 😉. |
Yeah, it probably makes sense to introduce Conda seemed to have a temporary problem - I restarted the test, and it seems to work now. |
BTW, I think you can remove this "WIP" - I'll leave the actual review to @scaramallion, but for me it all looks good! |
One thing that just came to my mind. Now that I create the dataset manually in |
After much thought, I would like to propose a change where the transfer syntax is always preferred over the encoding of the dataset in the This means that the priority of the selected encoding in
I don't have a strong opinion about this. That's why I want to discuss this before implementing it. If this change is unwanted I will of course do it in a different way, but we need a clear way of how to handle the encoding in |
pynetdicom/dsutils.py
Outdated
# File Meta Information is always encoded as Explicit VR Little Endian | ||
file_meta.is_little_endian = True | ||
file_meta.is_implicit_VR = False |
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.
file_meta.set_original_encoding(False, True)
pynetdicom/dsutils.py
Outdated
if elem.VM == 1: | ||
value = f"(Sequence with {len(elem.value)} item)" | ||
# Sequence elements always have a VM of 1 | ||
assert elem.VM == 1 |
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.
Remove the assert
pynetdicom/events.py
Outdated
ds.is_little_endian = t_syntax.is_little_endian | ||
ds.is_implicit_VR = t_syntax.is_implicit_VR | ||
|
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.
Use ds.set_original_encoding(...)
The actual encoding of the dataset is what's important when sending, as we need to determine if it matches the agreed upon transfer syntax, and if not then convert the dataset to match. For example, if a dataset:
Then the dataset can be sent as-is with no conversion. If the agreed upon transfer syntax were instead Implicit VR Little Endian it would need to be read into memory and converted to implicit VR prior to sending. If the dataset is new, then you can just use the agreed upon transfer syntax. |
Thanks a lot for the explanation. I think I understood it (at least I hope so). I have integrated your code comments and adjusted the |
Thanks! |
Reference issue
Support for pydicom v3, but drops support for pydicom v2.
Tasks