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

Deidentification Exception in Filters #256

Open
wetzelj opened this issue Sep 11, 2023 · 0 comments
Open

Deidentification Exception in Filters #256

wetzelj opened this issue Sep 11, 2023 · 0 comments

Comments

@wetzelj
Copy link
Contributor

wetzelj commented Sep 11, 2023

When adding a filter rule which targeted a non-string field (DICOM VR - DS) the empty() function in filter.py throws an exception - "'DSfloat' object has no attribute 'value'".

Filter rule:

LABEL Check for Empty RepetitionTime
  empty RepetitionTime

Root cause:
Currently in filter.py - line 155 we assume that if the content (returned from pydicom.DataSet.get()) is not a string, it's a DataElement. With this assumption we then attempt to get the value property of the content object. Depending on the parameter passed into get(), the returned value will either be the value from the tag or a DataElement. In the case of our filter rule above, the value returned from get() was of type DSfloat (not string), and threw an exception/

Proposed fix (Pull request coming shortly)
Instead of checking content is not string, reverse the logic and instead explicitly check for content being an instance of DataElement.

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

No branches or pull requests

1 participant