-
-
Notifications
You must be signed in to change notification settings - Fork 2.2k
Add DICOM (Digital Imaging and Communications in Medicine) protocol support #4891
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
base: master
Are you sure you want to change the base?
Conversation
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #4891 +/- ##
==========================================
- Coverage 80.85% 80.35% -0.50%
==========================================
Files 369 370 +1
Lines 90961 91682 +721
==========================================
+ Hits 73542 73671 +129
- Misses 17419 18011 +592
🚀 New features to boost your workflow:
|
|
Thanks for the PR. I’ve stared the unit tests. Looks good, however, could you please add type hints to your layer? |
| 0x59: "User Identity Server Response", | ||
| } | ||
|
|
||
| def _pad_ae_title(title): |
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 would recommend to introduced a StrFixedLenFieldWithPadding instead of the explicit call to the padding function for certain fields
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.
We have a PadField for that ! You can use pas with=" "
| class DICOMTransferSyntax(Packet): | ||
| name = "DICOM Transfer Syntax" | ||
| fields_desc = [ | ||
| StrLenField("uid", _uid_to_bytes(DEFAULT_TRANSFER_SYNTAX_UID), |
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 recommend to create a dedicated UID field (e.g. DICOMUIDField) which applies "_uid_to_bytes" internally.
|
|
||
| return DICOMVariableItem() / DICOMUserInformation(sub_items=sub_items) | ||
|
|
||
| class DICOMSession: |
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 would recommend to use a different "name", since Scapy uses the term "Session" for a different term. From you implementation, I would treat this class as a "DICOMSocket". This would indicate the application layer functionality.
Summary
DICOM communications is used in medical imaging systems. This PR adds Scapy layers for the DICOM Upper Layer Protocol (DICOM PS3.8).
Features
Usage
Testing
test/contrib/dicom.utsReferences