-
Notifications
You must be signed in to change notification settings - Fork 1
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
59 correct series invalidity #60
Conversation
1371194
to
0a340ea
Compare
@@ -627,6 +652,23 @@ def sanitize_dicom_dataset( | |||
return dataset_dictionary, True | |||
|
|||
|
|||
def validate_numerical_dataset_element(element: str) -> str | float: |
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.
ensure this function is able to sanitize None Type values as well
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.
additionally ansure unit testing for this function with different cases. Be careful using typehints and ensure that function won't crush the tool when encountering wrong type
dataset_dictionary[field] = dataset[field].value | ||
dataset_dictionary[field] = validate_numerical_dataset_element( | ||
dataset_value | ||
) | ||
elif field == "Manufacturer": |
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 fields that do not use the new "validate_numerical_dataset_element" function, ensure that they are sanitized for the None Type
we have to ensure that the code is sanitized and test cover the None Type fields that I believe could be returned by pydicom in their DatasetElement object. |
ENH: added catch for returning None value from dataset elements
727c66c
to
156d9e5
Compare
STYLE: black fixes TEST: testing verbose printing for dicom tag error ENH: separated operations for improved debugging FIX?: git lfs files are pulled from remote on github action
156d9e5
to
c1974ee
Compare
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.
good work!
Overview
This pull request addresses a bug where invalid inputs to non-required fields are not being caught, resulting in an "INVALID" modality classification error.
Implementation
Testing
Problems Faced
There were issues deciding upon what was the best way to catch cases with optional input fields that were empty. We decided to initialize every optional value in the data set dictionary with a default empty value and overrode the value if provided.
Notes
N/A